/* CSS minimal pour le thème clair et doré - Bootstrap fait le reste */

:root {
  --primary-color: #0B172E;
  --accent-color: #0A1426;
  --background: #FFFFFF;
  --background-light: #F9FAFB;
  --text-dark: #151520;
  --text-white: #FFFFFF;
  --text-light: #6B7280;
  --text-secondary: #A7B2C7;
  --border-color: #E5E7EB;
}

body {
  background-color: var(--background);
  color: var(--text-dark);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  max-width: 100vw;
  position: relative;
}

html {
  overflow-x: hidden;
  max-width: 100vw;
}

* {
  box-sizing: border-box;
}

/* Empêcher le défilement horizontal sur tous les appareils */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100% !important;
  position: relative;
}

/* S'assurer que tous les conteneurs principaux ne débordent pas */
.container,
.container-fluid {
  max-width: 100%;
}

/* Empêcher les éléments de dépasser */
img, video, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

/* Laisser la grille Bootstrap fonctionner normalement - ne pas modifier .row */

/* Styles pour les hover effects sur les cards d'albums */
.hover-opacity-100:hover {
  opacity: 1 !important;
}

.transition-opacity {
  transition: opacity 0.3s ease;
}

/* Styles pour la zone de drop */
#uploadArea.dragover {
  border-color: #FFD700 !important;
  background-color: rgba(255, 215, 0, 0.1);
}

/* Preview des fichiers */
.file-preview-item {
  position: relative;
}

.file-preview-item img,
.file-preview-item video {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
}

.file-preview-item .btn-remove {
  position: absolute;
  top: 5px;
  right: 5px;
}

/* Lightbox amélioré */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
}

.lightbox-video {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 12px;
  background-color: #000;
}

.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10000;
}

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

.lightbox-prev {
  left: -70px;
}

.lightbox-next {
  right: -70px;
}

.lightbox-info {
  margin-top: 20px;
  text-align: center;
  color: white;
}

.lightbox-caption {
  font-size: 1.1rem;
  margin-bottom: 10px;
  max-width: 80vw;
  word-break: break-word;
}

.lightbox-counter {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Responsive lightbox */
@media (max-width: 768px) {
  .lightbox-prev {
    left: 10px;
  }
  
  .lightbox-next {
    right: 10px;
  }
  
  .lightbox-close {
    top: 10px;
    right: 10px;
  }
}

/* Amélioration de la netteté des images dans les cartes */
.card img,
.gallery-item img,
.album-thumbnail,
.file-preview img,
img[class*="w-100"],
img[style*="object-fit"] {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: auto;
  -ms-interpolation-mode: bicubic;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  filter: contrast(1.05) brightness(1.02);
  object-fit: cover;
  object-position: center;
}

/* Amélioration de la galerie */
.gallery-item {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* 6 colonnes pour la galerie sur les grands écrans */
@media (min-width: 1200px) {
  .gallery-item-col {
    flex: 0 0 16.666666% !important;
    max-width: 16.666666% !important;
  }
}

/* Cartes carrées avec hauteur réduite */
.gallery-item {
  aspect-ratio: 1;
  max-height: 280px;
  overflow: hidden;
}

.gallery-item .card {
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
}

.gallery-item .position-relative:first-child {
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.gallery-item img,
.gallery-item video {
  border-radius: 12px 12px 0 0;
}

/* Améliorer la visibilité du sélecteur sur mobile */
select.form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.5rem;
}

select.form-select option {
  color: var(--text-dark);
  background-color: var(--background);
  padding: 0.5rem;
  display: block;
}

/* Sur mobile, s'assurer que le sélecteur est toujours cliquable */
@media (max-width: 991.98px) {
  select.form-select {
    opacity: 1;
    background-color: var(--background);
    color: var(--text-dark);
    font-size: 1rem;
    pointer-events: auto;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }
  
  select.form-select option {
    color: var(--text-dark) !important;
    background-color: var(--background) !important;
    padding: 0.75rem;
    font-size: 1rem;
  }
}

/* Barre de navigation mobile en bas */
.mobile-bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  background-color: var(--background);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.5rem 0;
  z-index: 9999 !important;
  height: 70px;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
  /* Pour Safari iOS - s'assurer que le menu reste visible */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  overflow: hidden;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 0;
}

.mobile-nav-item i {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  transition: all 0.2s ease;
}

.mobile-nav-item span {
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.mobile-nav-item.active {
  color: #F0A20A;
}

.mobile-nav-item.active i {
  transform: scale(1.1);
  color: #F0A20A !important;
}

.mobile-nav-item:active {
  transform: scale(0.95);
}

/* Ajouter un padding-bottom au body pour éviter que le contenu soit caché par la barre mobile */
@media (max-width: 991.98px) {
  body {
    padding-bottom: 70px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }
  
  html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }
  
  .container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  /* S'assurer que le footer n'est pas caché */
  footer {
    margin-bottom: 70px;
  }
  
  /* Empêcher le débordement horizontal */
  img, video {
    max-width: 100%;
    height: auto;
  }
  
  .card {
    max-width: 100%;
  }
}

