/**
 * Styles pour lazy loading et optimisation - BEAUTE DESILES
 */

/* ========================================
   LAZY LOADING ANIMATION
   ======================================== */

/* Placeholder pendant le chargement */
.lazy-image {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  min-height: 200px;
  object-fit: cover;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Image chargée - fade in */
.lazy-loaded {
  animation: fadeInImage 0.4s ease-in-out;
  background: none;
}

@keyframes fadeInImage {
  from { 
    opacity: 0;
    transform: scale(0.98);
  }
  to { 
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================================
   GALLERY ITEMS
   ======================================== */

.gallery-item {
  padding: 8px;
}

.gallery-item-inner {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #f8f8f8;
  height: 280px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item-inner:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gallery-item-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

/* Video preview (shows first frame) */
.gallery-item-inner .video-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  pointer-events: none;
}

.gallery-item-inner:hover img,
.gallery-item-inner:hover .video-preview {
  transform: scale(1.05);
}

/* ========================================
   GALLERY OVERLAY
   ======================================== */

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(220, 20, 60, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item-inner:hover .gallery-overlay {
  opacity: 1;
}

.gallery-zoom {
  width: 50px;
  height: 50px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #DC143C;
  font-size: 20px;
  transition: transform 0.3s ease;
}

.gallery-zoom:hover {
  transform: scale(1.1);
  color: #DC143C;
}

/* ========================================
   VIDEO ITEMS
   ======================================== */

.gallery-video-item {
  cursor: pointer;
}

.video-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Badge vidéo */
.gallery-video-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #DC143C 0%, #B91030 100%);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(220, 20, 60, 0.4);
}

.gallery-video-badge i {
  font-size: 10px;
}

/* Bouton play */
.gallery-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-video-item:hover .gallery-play-overlay {
  opacity: 1;
}

.gallery-play-btn {
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #DC143C;
  font-size: 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.gallery-play-btn:hover {
  transform: scale(1.1);
  background: #fff;
}

.gallery-play-btn i {
  margin-left: 5px; /* Centre visuel du triangle */
}

/* Vidéo en lecture */
.gallery-video-element {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 15;
  background: #000;
}

/* ========================================
   FILTER BUTTONS
   ======================================== */

.gallery-filter {
  margin-bottom: 30px;
}

.filter-btn {
  background: transparent;
  border: 2px solid #DC143C;
  color: #DC143C;
  padding: 10px 20px;
  margin: 5px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: #DC143C;
  color: #fff;
}

/* ========================================
   CAROUSEL NAVIGATION
   ======================================== */

#gallery-carousel .owl-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  padding: 0 10px;
  box-sizing: border-box;
}

#gallery-carousel .owl-nav button {
  pointer-events: all;
  width: 45px;
  height: 45px;
  background: #DC143C !important;
  border-radius: 50%;
  color: #fff !important;
  font-size: 20px;
  transition: all 0.3s ease;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gallery-carousel .owl-nav button:hover {
  background: #B91030 !important;
  transform: scale(1.1);
}

#gallery-carousel .owl-dots {
  text-align: center;
  margin-top: 20px;
}

#gallery-carousel .owl-dot {
  width: 12px;
  height: 12px;
  background: #ddd;
  border-radius: 50%;
  margin: 0 5px;
  border: none;
  transition: all 0.3s ease;
}

#gallery-carousel .owl-dot.active {
  background: #DC143C;
  transform: scale(1.2);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .gallery-item-inner {
    height: 220px;
  }
  
  .filter-btn {
    padding: 8px 15px;
    font-size: 12px;
    margin: 3px;
  }
  
  .gallery-play-btn {
    width: 55px;
    height: 55px;
    font-size: 22px;
  }
  
  #gallery-carousel .owl-nav button {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .gallery-item-inner {
    height: 200px;
  }
  
  .gallery-video-badge {
    padding: 4px 8px;
    font-size: 10px;
  }
  
  .gallery-video-badge span {
    display: none;
  }
}

/* ========================================
   PRELOADER OPTIMIZATION
   ======================================== */

/* Réduire le temps du preloader */
#preloader {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.loaded #preloader {
  opacity: 0;
  visibility: hidden;
}

/* ========================================
   HERO SLIDER OPTIMIZATION  
   ======================================== */

/* Précharger uniquement la première image */
.main_slide:first-child {
  background-size: cover;
  background-position: center;
}

.main_slide:not(:first-child) {
  background-image: none !important;
}

.main_slide:not(:first-child).owl-item-active {
  background-size: cover;
  background-position: center;
}
