/* Visionneuse d'images moderne et professionnelle */
.modern-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.88);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--easing-smooth);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modern-lightbox.active {
  opacity: 1;
  visibility: visible;
}

/* Container principal */
.modern-lightbox-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 120px 20px;
  position: relative;
}

/* Header avec bouton fermer */
.lightbox-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 10001;
}

.lightbox-title {
  color: white;
  font-size: 1.1rem;
  font-weight: 500;
}

.lightbox-close {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Zone de l'image principale */
.lightbox-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  max-width: 90vw;
  max-height: calc(100vh - 180px);
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease;
}

/* Boutons de navigation */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

/* Barre de prévisualisation en bas */
.lightbox-thumbnails {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  z-index: 10001;
}

.lightbox-thumbnails::-webkit-scrollbar {
  display: none;
}

.lightbox-thumbnail {
  min-width: 80px;
  height: 60px;
  margin-right: 10px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}

.lightbox-thumbnail:hover {
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

.lightbox-thumbnail.active {
  border-color: white;
  transform: scale(1.1);
}

.lightbox-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Indicateur de position */
.lightbox-counter {
  position: absolute;
  top: 70px;
  right: 20px;
  color: white;
  background: rgba(0, 0, 0, 0.5);
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Boutons de contrôle avancés */
.lightbox-controls {
  position: absolute;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.lightbox-control-btn {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lightbox-control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Styles pour la lightbox moderne */
.modern-lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  transition: all var(--duration-fast) var(--easing-smooth);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modern-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Navigation */
.modern-lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: all var(--duration-fast) var(--easing-smooth);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modern-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.modern-lightbox-nav.prev {
  left: 20px;
}

.modern-lightbox-nav.next {
  right: 20px;
}

/* Contenu principal */
.modern-lightbox-content {
  max-width: 90vw;
  max-height: 80vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modern-lightbox-image {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modern-lightbox-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Informations */
.modern-lightbox-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 20px;
  padding: 0 20px;
}

.modern-lightbox-title {
  color: white;
  font-size: 1.1rem;
  font-weight: 500;
}

.modern-lightbox-counter {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* Miniatures */
.modern-lightbox-thumbnails {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 20px;
  overflow-x: auto;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.modern-lightbox-thumbnail {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.6;
  transition: all var(--duration-fast) var(--easing-smooth);
  border: 2px solid transparent;
  flex-shrink: 0;
}

.modern-lightbox-thumbnail:hover,
.modern-lightbox-thumbnail.active {
  opacity: 1;
  border-color: white;
  transform: scale(1.05);
}

.modern-lightbox-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Responsive */
@media (max-width: 768px) {
  .modern-lightbox-nav {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
  
  .modern-lightbox-nav.prev {
    left: 10px;
  }
  
  .modern-lightbox-nav.next {
    right: 10px;
  }
  
  .modern-lightbox-close {
    top: 10px;
    right: 10px;
    width: 45px;
    height: 45px;
    font-size: 20px;
  }
  
  .modern-lightbox-content {
    max-width: 95vw;
    max-height: 85vh;
  }
  
  .modern-lightbox-image {
    max-height: 65vh;
  }
  
  .modern-lightbox-thumbnails {
    height: 80px;
    padding: 10px;
  }
  
  .modern-lightbox-thumbnail {
    width: 60px;
    height: 60px;
  }
  
  .modern-lightbox-info {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* Animations */
@keyframes lightboxFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-image {
  animation: lightboxFadeIn 0.3s ease;
}

/* Loading state */
.lightbox-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 1.1rem;
}

.lightbox-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
