/* Galerie Photo Fullscreen */

.photo-gallery {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
}

.photo-gallery.open {
  display: flex;
}

/* Overlay de fond */
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  cursor: pointer;
}

/* Conteneur principal */
.gallery-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  flex-direction: column;
}

/* Bouton de fermeture */
.gallery-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
  z-index: 10000;
  padding: 10px;
  transition: transform 0.2s;
}

.gallery-close:hover {
  transform: scale(1.2);
}

/* Zone principale de l'image */
.gallery-main {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96vw;
  max-width: 96vw;
  max-height: 88vh;
  padding: 10px;
}

/* Image */
.gallery-image {
  max-width: 94vw;
  max-height: 84vh;
  object-fit: contain;
  animation: fadeIn 0.3s ease-in;
}

.gallery-title {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 80vw;
  padding: 8px 14px;
  color: white;
  background: rgba(0, 0, 0, 0.65);
  font-size: 1rem;
  text-align: center;
}

.gallery-difficulty {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 80vw;
  padding: 4px 12px;
  color: white;
  background: rgba(0, 0, 0, 0.65);
  font-size: 0.9rem;
  text-align: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Compteur de photos */
.gallery-counter {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  white-space: nowrap;
}

/* Boutons de navigation */
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 28px;
  padding: 15px 20px;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 9998;
  border-radius: 4px;
}

.gallery-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.4);
}

.gallery-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gallery-prev {
  left: 20px;
}

.gallery-next {
  right: 20px;
}

/* Miniatures */
.gallery-thumbnails {
  width: 100%;
  max-width: 90vw;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
}

.thumbnails-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0;
  justify-content: center;
  flex-wrap: wrap;
}

.thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, border 0.2s;
  border: 2px solid transparent;
}

.thumbnail:hover {
  opacity: 1;
}

.thumbnail.active {
  opacity: 1;
  border-color: white;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
  .gallery-nav {
    padding: 10px 15px;
    font-size: 24px;
  }

  .gallery-prev {
    left: 10px;
  }

  .gallery-next {
    right: 10px;
  }

  .gallery-close {
    top: 10px;
    right: 10px;
    font-size: 28px;
  }

  .gallery-counter {
    font-size: 12px;
    padding: 6px 12px;
  }

  .thumbnail {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 480px) {
  .gallery-main {
    max-height: 70vh;
  }

  .gallery-nav {
    padding: 8px 10px;
    font-size: 20px;
  }

  .gallery-prev {
    left: 5px;
  }

  .gallery-next {
    right: 5px;
  }

  .thumbnails-scroll {
    gap: 5px;
  }

  .thumbnail {
    width: 40px;
    height: 40px;
  }
}
