:root {
  --bg-color: #121212;
  --surface-color: #1e1e1e;
  --surface-hover: #2c2c2c;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --accent-color: #bb86fc;
  --accent-glow: rgba(187, 134, 252, 0.2);
  --border-color: #333333;
}

/* ============================================================
   VIDÉO D'ARRIÈRE-PLAN
   ============================================================ */

.video-background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  overflow: hidden;
  background-color: #000; /* Fond noir derrière la vidéo */
}

.video-background {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  opacity: 0.1; /* Transparence qui tire vers le noir */
}

/* Ajustement de l'overlay pour compléter l'assombrissement */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6); /* Overlay noir supplémentaire */
  z-index: -1;
}

/* Désactiver la vidéo pour les utilisateurs sensibles au mouvement */
@media (prefers-reduced-motion: reduce) {
  .video-background {
    display: none;
  }
  
  .video-overlay {
    background: var(--bg-color);
  }
}

/* Optionnel : désactiver la vidéo sur mobile pour économiser batterie et données */
@media (max-width: 768px) {
  .video-background {
    display: none;
  }
  
  .video-overlay {
    background: var(--bg-color);
  }
}

body {
  background-color: transparent; /* Devient transparent pour laisser voir la vidéo */
  color: var(--text-primary);
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* --- HEADER (structure deux colonnes) --- */
.main-header {
  margin-bottom: 40px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}

.header-content {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 30px;
  text-align: left;
  max-width: 900px;
  margin: 0 auto;
}

.header-image-box {
  flex: 0 0 375px;
  max-width: 30%;
}

.header-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-img:hover {
  transform: scale(1.025);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
}

.header-text-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
}

.header-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 10px;
  width: 100%;
}

.header-title-row h1 {
  margin: 0;
  flex: 1;
  color: var(--accent-color);
  text-shadow: 0 0 10px var(--accent-glow);
}

/* Le menu des langues est injecté par langues.js dans .header-title-row */

/* Description courte */
.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin: 0 0 20px 0;
  font-style: italic;
}

/* Description longue */
.long-text-container {
  background: rgba(255, 255, 255, 0.04);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  width: 100%;
}

.long-text {
  transition: max-height 0.5s ease, opacity 0.5s ease;
  overflow: hidden;
  opacity: 0.9;
  max-height: 100px;
}

.long-text p {
  margin: 10px 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-align: justify;
}

.long-text h4 {
  margin: 10px 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-align: justify;
  font-style: italic;
}

.toggle-btn {
  background: none;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s;
  display: block;
  width: fit-content;
}

.toggle-btn:hover {
  background: var(--accent-color);
  color: #000;
}

/* --- SECTIONS & GALERIES --- */
.act-section {
  margin: 50px 0;
  text-align: left;
}

.act-title.centered {
  text-align: center;
  border-left: none;
  border-bottom: 3px solid var(--accent-color);
  padding: 0 0 15px 0;
  margin: 40px auto 30px auto;
  max-width: 300px;
  position: relative;
}

.act-title.centered::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent-color);
  margin: 10px auto 0;
  border-radius: 2px;
}

#gallery-roles-principaux {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  justify-content: center;
}

.media-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  flex: 1 1 210px;
  max-width: 262px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.media-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
  border-color: var(--accent-color);
}

.img-wrapper {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  max-height: 300px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.img-wrapper img {
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 0.5s ease;
  pointer-events: none;
}

.media-card:hover .img-wrapper img {
  transform: scale(1.05);
}

.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.media-card:hover .play-overlay {
  opacity: 1;
}

.card-title {
  color: var(--accent-color);
  margin: 8px 0 4px;
  font-size: 1rem;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-role-preview {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 6px auto 12px;
  text-align: center;
  line-height: 1.3;
  max-height: 4em;
  overflow: hidden;
  width: 95%;
}

/* --- MODALE CARTE SCÈNE --- */
.modal {
  display: none;
  position: fixed;
  z-index: 10001;  /* ← MODIFIÉ : était 1000 */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

/* Masquer les menus quand la modale est ouverte */
body.modal-open .burger-menu-container,
body.modal-open .language-menu-floating {
  display: none !important;
}

.modal-content {
  background-color: var(--surface-color);
  border-radius: 12px;
  width: 95%;
  max-width: 1200px;
  position: relative;
  border: 1px solid var(--accent-color);
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--surface-color);
  z-index: 10;
}

.modal-header-title {
  flex: 1;
  text-align: center;
  color: var(--accent-color);
  font-size: 1.3rem;
  margin: 0;
  order: 1;
}

.close-btn {
  font-size: 32px;
  font-weight: bold;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
  order: 2;
}

.close-btn:hover {
  color: var(--accent-color);
}

.modal-two-columns {
  display: flex;
  flex-direction: row;
  gap: 30px;
  padding: 20px;
}

.modal-left {
  flex: 1.2;
  min-width: 0;
}

.modal-right {
  flex: 0.8;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.media-wrapper {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-image {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  display: block;
  border-radius: 12px;
}

.media-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  border-radius: 12px;
}

.info-section {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
}

.info-section div {
  margin-bottom: 20px;
}

.info-section div:last-child {
  margin-bottom: 0;
}

.info-section strong {
  color: var(--accent-color);
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
}

.info-section span {
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: justify;
  display: block;
}

.action-area {
  text-align: center;
  margin-top: auto;
}

.btn-modal {
  display: inline-block;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--accent-color), #9b59b6);
  color: #000;
  border: none;
  border-radius: 40px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 8px;
  width: 100%;
  max-width: 280px;
}

.btn-modal:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(187, 134, 252, 0.4);
}

.btn-stop {
  background: linear-gradient(135deg, #555, #333);
  color: #fff;
}

/* Animation pour la notification */
@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  15% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  85% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
}

/* Galerie horizontale */
.gallery-wrapper {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

#gallery-personnages {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 5px 20px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color, #bb86fc) transparent;
}

#gallery-personnages::-webkit-scrollbar {
  height: 6px;
}

#gallery-personnages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

#gallery-personnages::-webkit-scrollbar-thumb {
  background: var(--accent-color, #bb86fc);
  border-radius: 10px;
}

/* Cartes dans la galerie */
#gallery-personnages .media-card {
  flex: 0 0 220px;
  min-width: 200px;
  max-width: 220px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(187, 134, 252, 0.15);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  margin: 0;
}

#gallery-personnages .media-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-color, #bb86fc);
  box-shadow: 0 8px 30px rgba(187, 134, 252, 0.15);
}

#gallery-personnages .media-card .img-wrapper {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  position: relative;
}

#gallery-personnages .media-card .img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

#gallery-personnages .media-card:hover .img-wrapper img {
  transform: scale(1.03);
}

#gallery-personnages .media-card .card-title {
  padding: 12px 16px 4px;
  color: var(--text-primary, #e0e0e0);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

#gallery-personnages .media-card .card-year {
  padding: 0 16px 12px;
  color: var(--text-secondary, #a0a0a0);
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0;
}

/* Boutons de scroll */
.scroll-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

.scroll-btn {
  background: rgba(187, 134, 252, 0.15);
  border: 1px solid rgba(187, 134, 252, 0.3);
  color: var(--text-primary, #e0e0e0);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-btn:hover {
  background: var(--accent-color, #bb86fc);
  color: #000;
  transform: scale(1.05);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .header-image-box {
    flex: 0 0 auto;
    max-width: 280px;
    width: 80%;
  }

  .header-text-box {
    width: 100%;
    align-items: center;
  }

  .header-title-row {
    flex-wrap: wrap;
    justify-content: center;
  }

  .header-title-row h1 {
    width: 100%;
    text-align: center;
    order: 1;
  }

  .long-text p {
    text-align: left;
  }

  h1 {
    font-size: 1.6rem;
  }

  .act-title.centered {
    font-size: 1.4rem;
    max-width: 250px;
  }

  .media-card {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .modal-two-columns {
    flex-direction: column;
    gap: 20px;
    padding: 15px;
  }

  .modal-left,
  .modal-right {
    flex: auto;
  }

  .btn-modal {
    width: 100%;
  }

  .info-section {
    padding: 15px;
  }
}