/**
 * 2024 Change Vivienne
 *
 * CSS pour le switch de vues tableau/cards
 *
 * @author    Simon Taeib
 * @copyright 2024 Change Vivienne
 * @license   Commercial license
 */

/* Container principal pour le toggle */
.view-toggle-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 15px auto;
  max-width: 280px;
  z-index: 100;
}

/* Style des labels */
.view-toggle-label {
  display: flex;
  align-items: center;
  font-weight: 500;
  color: #777;
  transition: color 0.3s ease;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0 10px;
  white-space: nowrap;
}

.view-toggle-label.active {
  color: #2fb5d2;
  font-weight: 600;
}

.view-toggle-label i {
  margin-right: 5px;
  font-size: 1rem;
}

/* Style du toggle switch */
.view-toggle {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 26px;
  margin: 0 10px;
}

/* Cache la checkbox HTML mais la garde accessible */
.view-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Le slider */
.view-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #f0f0f0;
  transition: .4s;
  border-radius: 34px;
  border: 1px solid #ddd;
}

.view-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 2px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Changements quand la checkbox est cochée */
.view-toggle input:checked + .view-toggle-slider {
  background-color: #2fb5d2;
}

.view-toggle input:checked + .view-toggle-slider:before {
  transform: translateX(28px);
}

/* Effet hover */
.view-toggle:hover .view-toggle-slider {
  box-shadow: 0 0 5px rgba(47, 181, 210, 0.3);
}

/* Pour Creative Elements */
.elementor .view-toggle-container {
  margin: 15px 15px 30px;
}

/* Style adaptatif */
@media (max-width: 767px) {
  .view-toggle-container {
    margin: 10px auto;
  }
  
  .view-toggle-label {
    font-size: 0.8rem;
  }
  
  .view-toggle {
    width: 48px;
    height: 22px;
  }
  
  .view-toggle-slider:before {
    height: 16px;
    width: 16px;
  }
  
  .view-toggle input:checked + .view-toggle-slider:before {
    transform: translateX(24px);
  }
}

/* Styles pour désactiver temporairement les transitions pendant les changements de vue */
.view-switching * {
  transition: none !important;
} 