:root {
  --bg-dark: #121212;
  --bg-darker: #1e1e1e;
  --bg-darkest: #111;
  --color-text: #e0e0e0;
  --color-accent: #00ffff;
  --color-available: #00ff88;
  --color-unavailable: #ff4444;
  --color-favori: gold;
  --color-a_voir: #ffcc00;
  --font-family: 'Segoe UI', sans-serif;
}

/* === Thème sombre global === */
body, body.dark-theme {
  background-color: var(--bg-dark);
  color: var(--color-text);
  font-family: var(--font-family);
  margin: 0;
  padding: 0;
}

h1, header h1 {
  text-align: center;
  color: var(--color-accent);
  text-shadow: 0 0 10px var(--color-accent);
  margin: 30px 0;
  font-size: 32px;
}

/* === Conteneur principal des films === */
.films-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  padding: 40px;
  background: var(--bg-dark);
}

/* === Carte de film === */
.film-card {
  background: var(--bg-darker);
  border-radius: 10px;
  padding: 10px;
  width: 200px;
  min-height: 600px; /* ajout unité */
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
  text-align: center;
  color: var(--color-text);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
}
.film-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px var(--color-accent);
}

/* Film actif dans une saga */
.film-card.current-film {
  outline: 2px solid var(--color-accent);
  outline-offset: -4px;
  box-shadow: 0 0 15px var(--color-accent);
}
.film-card.current-film h3 {
  text-shadow: 0 0 6px var(--color-accent);
}

/* === Affiche de film === */
.poster-container {
  position: relative;
}
.poster-container img,
.film-card img {
  width: 100%;
  border-radius: 10px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}

/* === Texte carte === */
.film-card h3 {
  color: var(--color-accent);
  margin: 10px 0 5px;
  font-size: 1rem;
  line-height: 1.3;
  text-shadow: 0 0 6px var(--color-accent);
}
.film-card p {
  margin: 5px 0;
  font-size: 0.95rem;
  line-height: 1.4;
}
.film-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: auto;
  padding: 5px 0;
  min-height: 100px;
  flex-grow: 1;
}

/* === Statut de disponibilité sur carte === */
.status-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 14px;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.75);
  padding: 4px 7px;
  border-radius: 50%;
  z-index: 10;
}
.status-badge.available {
  color: var(--color-available);
  text-shadow: 0 0 6px var(--color-available);
  box-shadow: 0 0 10px var(--color-available);
}
.status-badge.unavailable {
  color: var(--color-unavailable);
  text-shadow: 0 0 6px var(--color-unavailable);
  box-shadow: 0 0 10px var(--color-unavailable);
}

/* === Badge "vu", "favori", "à voir" === */
.film-badges {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 0;
}

.badge {
  cursor: pointer;
  opacity: 0.3;
  font-size: 24px;
  transition: transform 0.2s ease, opacity 0.2s;
  filter: drop-shadow(0 0 4px rgba(0, 255, 136, 0.5));
}
.badge:hover {
  transform: scale(1.2);
  filter: drop-shadow(0 0 4px rgba(0, 255, 136, 0.5));
}
.badge.active {
  opacity: 1;
}
.badge.vu {
  color: var(--color-available);
}
.badge.favori {
  color: var(--color-favori);
  text-shadow: 0 0 5px var(--color-favori);
}
.badge.a_voir {
  color: var(--color-a_voir);
  text-shadow: 0 0 5px var(--color-a_voir);
}

/* === Bouton "Afficher plus" === */
#loadMoreBtn {
  display: block;
  margin: 30px auto;
  padding: 10px 20px;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  background: transparent;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}
#loadMoreBtn:hover {
  box-shadow: 0 0 12px #00ffff88, 0 0 20px #00ffff88;
  transform: scale(1.05);
  text-shadow: 0 0 6px #00ffff88;
}

/* === Barre de recherche === */
.search-box {
  display: block;
  width: 300px;
  margin: 30px auto 20px;
  padding: 10px 15px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  background: var(--bg-darker);
  color: var(--color-accent);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}
.search-box:focus {
  outline: none;
  box-shadow: 0 0 20px #00ffff88;
}

/* === Bouton retour === */
a.retour {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 20px;
  text-decoration: none;
  color: var(--color-accent);
  font-weight: bold;
  border: 1px solid var(--color-accent);
  border-radius: 8px;
  transition: all 0.3s ease;
}
a.retour:hover {
  box-shadow: 0 0 12px #00ffff88, 0 0 20px #00ffff88;
  transform: scale(1.05);
  text-shadow: 0 0 6px #00ffff88;
}

/* === Résumé scrollable === */
.resume-scrollable {
  max-height: 100px;
  overflow-y: auto;
  padding-right: 10px;
  margin-top: 5px;
  line-height: 1.6;
  color: #eee;
}
.resume-scrollable::-webkit-scrollbar {
  width: 6px;
}
.resume-scrollable::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 10px;
}
.resume-scrollable::-webkit-scrollbar-track {
  background: var(--bg-darkest);
}

/* === Animation apparitions === */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInMove 0.8s ease-out forwards;
}
.fade-in:nth-child(1) { animation-delay: 0s; }
.fade-in:nth-child(2) { animation-delay: 0.3s; }

@keyframes fadeInMove {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Section Saga === */
.saga-section {
  margin-top: 50px;
  padding: 20px;
  background-color: var(--bg-darkest);
}

/* === Film détail === */
.film-detail {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  max-width: 1200px;
  margin: 30px auto;
  padding: 30px;
  background-color: #1c1c1c;
  border-radius: 15px;
  box-shadow: 0 0 20px #00ffff33;
}
.film-poster img {
  width: 100%;
  max-width: 300px;
  border-radius: 10px;
  box-shadow: 0 0 15px #00ffff88;
  object-fit: cover;
  display: block;
}
.film-info {
  flex: 2;
  color: #eee;
  font-size: 16px;
  line-height: 1.6;
}
p strong {
  color: var(--color-accent);
}

/* Statut disponibilité */
.status.available,
.availability-label.available {
  color: var(--color-available);
  font-weight: bold;
  text-shadow: 0 0 6px var(--color-available);
}
.status.unavailable,
.availability-label.unavailable {
  color: var(--color-unavailable);
  font-weight: bold;
  text-shadow: 0 0 6px var(--color-unavailable);
}

.availability-label {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 1.4rem;
  font-weight: bold;
  padding: 8px 16px;
  border-radius: 8px;
  z-index: 5;
  /* text-shadow répétée dans classes spécifiques */
}

/* === Bouton centré === */
.center-button {
  text-align: center;
  margin-top: 20px;
}
.center-button a.retour {
  display: inline-block;
  padding: 10px 20px;
  background-color: #444;
  color: white;
  border-radius: 5px;
  text-decoration: none;
  transition: background-color 0.3s;
}
.center-button a.retour:hover {
  background-color: #666;
}
.saison-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.saison-block {
  background-color: var(--bg-darker);
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.05);
  margin: 20px 0;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  width : 100%;
  max-width: 700px;
}
.saison-block:hover {
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.15);
}

.episode-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.episode-list strong {
  color: var(--color-accent); /* hérite du parent (p.ex. pour thème sombre) */
  font-weight: bold;
}


.episode-list li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--color-text);
}

.accordion {
  background-color: transparent;
  color: var(--color-accent);
  font-family: var(--font-family);
  padding: 16px 20px;
  font-size: 18px;
  font-weight: bold;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  transition: background-color 0.3s ease;
  text-align: left;
}

.accordion:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.accordion.active {
  background-color: #333;
}

.accordion .arrow {
  transition: transform 0.3s ease;
  font-size: 18px;
}

.accordion.active .arrow {
  transform: rotate(90deg);
}

.panel {
  background-color: var(--bg-darkest);
  color: var(--color-text);
  padding: 15px 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: none;
}

.panel p {
  margin: 6px 0;
  color: #ccc;
}

.episode-badge {
  cursor: pointer;
  margin-left: 10px;
  font-size: 1.2em;
  transition: transform 0.2s ease;
}
.episode-badge.active {
  color: limegreen;
  transform: scale(1.2);
}
.episode-badge.loading {
  opacity: 0.5;
  pointer-events: none;
}
.badge.loading {
  opacity: 0.6;
  pointer-events: none;
}

.badge.vu.active {
  filter: drop-shadow(0 0 5px #00ffcc); /* ou un autre effet lumineux */
  transform: scale(1.1);
  transition: all 0.2s ease;
}
.login-form {
  display: flex;
  flex-direction: column;
  max-width: 350px;
  margin: 80px auto;
  background-color: var(--bg-darkest);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.15);
  color: #f0f0f0;
}
.login-form input {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.login-form input {
  margin-bottom: 15px;
  padding: 12px;
  border: 1px solid #00ffff;
  border-radius: 6px;
  background-color: #1a1a1a;
  color: #fff;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.login-form input:focus {
  border-color: #00ffff;
  box-shadow: 0 0 6px #00ffff;
}
.login-form button {
  padding: 12px;
  background-color: #00ffff;
  color: #000;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.login-form button:hover {
  background-color: #00e6e6;
  box-shadow: 0 0 10px #00ffff;
}
.film-card.hidden {
  display: none;
}
.centered-message {
  text-align: center;
  margin-top: 2rem;
  font-size: 1.2em;
  opacity: 0.8;
}

