: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-top: 80px;
}

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;
  z-index: 1;
}
.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);
}
/* Barre de recherche stylée */
.search-box-global {
  width: 100%;
  padding: 10px 15px;
  border-radius: 8px;
  border: none;
  box-sizing: border-box;

  
  font-size: 16px;
  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;
}
.search-box-global: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);
}
.scrollbar::-webkit-scrollbar {
  width: 6px;
}
.scrollbar::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 10px;
}
.scrollbar::-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: 1200px;
}
.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;
}

.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: 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 {
  outline: none;
  box-shadow: 0 0 20px #00ffff88;
}
.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.fade-in {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInMove 0.5s ease-out forwards;
}

.film-card.fade-in:nth-child(1) { animation-delay: 0s; }
.film-card.fade-in:nth-child(2) { animation-delay: 0.1s; }
.film-card.fade-in:nth-child(3) { animation-delay: 0.2s; }

.film-card.hidden {
  display: none;
}
.centered-message {
  text-align: center;
  margin-top: 2rem;
  font-size: 1.2em;
  opacity: 0.8;
}
nav {
  background-color: #333;
  padding: 10px;
}

nav ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

nav ul li {
  margin-right: 20px;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 18px;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
  color: #00ffff;
  text-shadow: 0 0 6px #00ffff;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed; /* Fixée en haut de la page */
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 10px 20px;
  background-color: var(--bg-darker); /* ou autre selon ton thème */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Utilisateur à droite */
.user-info {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}
.username {
  text-decoration: none;
  color: var(--color-text);
}
.username:hover {
  text-decoration: none;
  color: #00e6e6;
  text-shadow: 0 0 6px #00e6e6;
}

.logout-button {
  text-decoration: none;
  border-color: #00e6e6;
  color: #ff5555;
  font-size: 18px;
  transition: transform 0.2s ease, color 0.3s ease;
  text-shadow: 0 0 6px #ff5555;
}

.logout-button:hover {
  color: #ff8888;
}

/* Menu links */
.menu {
  display: flex;
  gap: 15px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.menu a {
  text-decoration: none;
  color: var(--color-accent);
}
.menu li a {
  white-space: nowrap; /* ✅ Empêche les retours à la ligne */
  padding: 6px 10px;
  display: inline-block;
}

.menu a.active {
  font-weight: bold;
  border-bottom: 2px solid var(--color-accent);
}
/* Le menu à gauche */
.menu-wrapper {
  flex: 1;
  display: flex;
}
.menu-wrapper ul.menu {
  display: flex;
  flex: 1;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.menu-wrapper ul.menu li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 18px;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
.menu-wrapper ul.menu li a:hover,
.menu-wrapper ul.menu li a.active {
  color: #00ffff;
  text-shadow: 0 0 6px #00ffff;
}
/* Barre de recherche centrée */
.global-search-container {
  position: relative;
  display: flex;
  justify-content: center; /* ✅ Centre la barre dans le conteneur */
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.search-box:focus {
  outline: none;
  box-shadow: 0 0 20px #00ffff88;
}
.search-results-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0 auto;           /* ✅ Centre horizontalement */
  width: 100%;              /* ✅ Même largeur que la search box */
  z-index: 999;
  background: var(--bg-darker);
  border-top: none;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  list-style: none;
  padding: 0;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-radius: 6px;
}
.search-results-list li {
  padding: 10px 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.search-results-list li:hover {
  background-color: rgba(0, 255, 255, 0.05);
  width: 100%;
}
.media-type {
  color: var(--color-accent);
  font-weight: bold;
}
.film-card.empty-card {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #222;
  color: #aaa;
  font-size: 1.1em;
  font-weight: bold;
  height: 300px; /* adapte à la taille des autres cards */
  border: 2px dashed #555;
  border-radius: 8px;
  text-align: center;
  padding: 20px;
}

.age-overlay-message {
  padding: 10px;
  text-align: center;
  color: var(--color-accent);
}
.availability-icon {
  margin-right: 6px;
  font-size: 1.1em;
}

.status-episode {
  font-weight: bold;
  font-size: 12px;
  margin-right: 6px;
  display: inline-block;
  width: 1.2em;
  text-align: center;
  border-radius: 50%;
  padding: 4px 5px;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  z-index: 10;
}
.status-episode.available {
  color: var(--color-available);
  text-shadow: 0 0 6px var(--color-available);
  box-shadow: 0 0 10px var(--color-available);
}
.status-episode.unavailable {
  color: var(--color-unavailable);
  text-shadow: 0 0 6px var(--color-unavailable);
  box-shadow: 0 0 10px var(--color-unavailable);
}

#loadMoreBtn.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInMove 0.6s ease-out forwards;
}

.episode-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1em;
}

.episode-table th, .episode-table td {
  border: 1px solid #444;
  padding: 8px;
  text-align: center;
}

.episode-table th {
  background-color: #222;
  color: #fff;
}

.episode-table td.available {
  color: var(--color-available);
  text-shadow: 0 0 6px var(--color-available);
  font-size: 1.2em;
}

.episode-table td.unavailable {
  color: var(--color-unavailable);
  text-shadow: 0 0 6px var(--color-unavailable);
  font-size: 1.2em;
}
.fa-arrow-down {
  color: var(--color-accent);
  text-shadow: 0 0 6px var(--color-accent);
  font-size: 1.2em;
  margin: 0 10px;
  transition: transform 0.2s ease;
}
.fa-tv {
  color: var(--color-accent);
  text-shadow: 0 0 6px var(--color-accent);
  font-size: 1.2em;
  margin: 0 10px;
  transition: transform 0.2s ease;
}

.fa-arrow-down:hover{
  transform: scale(1.4);
  color: var(--color-accent);
  text-shadow: 0 0 10px var(--color-accent);
}
.fa-tv:hover{
  transform: scale(1.2);
  color: var(--color-accent);
  text-shadow: 0 0 10px var(--color-accent);
}
.media-collection {
  text-decoration: none;
  color: var(--color-text);
  text-shadow: 0 0 10px var(--color-text);
}

.media-collection:hover {
  color: var(--color-accent);
  text-shadow: 0 0 20px var(--color-accent);

}
.search-settings-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  font-size: 1.4rem;
  background: none;
  border: none;
  color: var(--color-accent);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.search-settings-button:hover {
  transform: scale(1.3);
  color: #00ffff;
  text-shadow: 0 0 8px #00ffff;
}

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1300px;
  margin: 30px auto;
  padding: 20px;
  background-color: var(--bg-darker);
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.filter-row.center {
  justify-content: center;
}

.filter-bar input[type="text"],
.filter-bar input[type="number"],
.filter-bar select {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #00ffff;
  background-color: #1a1a1a;
  color: #ffffff;
  font-size: 14px;
  width: 220px;
  transition: all 0.2s ease-in-out;
}

.filter-bar input:focus,
.filter-bar select:focus {
  outline: none;
  border-color: #00cccc;
  box-shadow: 0 0 20px #00ffff88;
}

.filter-bar button {
  display: inline-block;
  padding: 10px 24px;
  margin-left: 12px;
  background-color: #00ffff;
  color: #000;
  border: none;
  border-radius: 6px;
  text-decoration: none; /* ✅ retire le soulignement */
  transition: background-color 0.2s ease, color 0.2s ease;
  font-family: 'Segoe UI', sans-serif;
  font-size: 16px;
}

.filter-bar button:hover {
  background-color: #00e6e6;
  box-shadow: 0 0 10px #00ffff;
}
.short-select {
  width: 250px !important;
}
.reset-button {
  display: inline-block;
  padding: 10px 24px;
  margin-left: 12px;
  background-color: #00ffff;
  color: #000;
  border: none;
  border-radius: 6px;
  text-decoration: none; /* ✅ retire le soulignement */
  transition: background-color 0.2s ease, color 0.2s ease;
}
.reset-button:hover {
  background-color: #00e6e6;
  box-shadow: 0 0 10px #00ffff;
  text-decoration: none;
}
.stat-link {
  color: inherit;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s ease;
}

.stat-link:hover {
  color: #00ffff;
  text-decoration: none;
  text-shadow: 0 0 8px #00ffff;
}
.profile-form input[type="text"],
.profile-form input[type="password"],
.profile-form select {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #00ffff;
  background-color: #1a1a1a;
  color: #ffffff;
  font-size: 14px;
  width: 220px;
  transition: all 0.2s ease-in-out;
}

.profile-form input:focus,
.profile-form select:focus {
  outline: none;
  border-color: #00cccc;
  box-shadow: 0 0 20px #00ffff88;
}

.profile-form button {
  display: inline-block;
  padding: 10px 24px;
  margin-left: 12px;
  background-color: #00ffff;
  color: #000;
  border: none;
  border-radius: 6px;
  text-decoration: none; /* ✅ retire le soulignement */
  transition: background-color 0.2s ease, color 0.2s ease;
  font-family: 'Segoe UI', sans-serif;
  font-size: 16px;
}

.profile-form button:hover {
  background-color: #00e6e6;
  box-shadow: 0 0 10px #00ffff;
}
.film-card.blurred .poster-container img {
  filter: blur(12px);
}
.film-card.blurred .poster-container::after {
  content: "Contenu sensible";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 6px;
}
.poster-container {
  position: relative;
}
.blurred img {
  filter: blur(10px);
}
.blurred::after {
  content: "Contenu sensible";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  pointer-events: none;
}
.film-poster {
  position: relative;
}
.poster-container.blurred img {
  filter: blur(10px);
}

.poster-container.blurred::after {
  content: "Contenu sensible";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  background: rgba(0, 0, 0, 0.7);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 2;
}

.poster-container {
  position: relative;
}
