/* ========================
   🎨 VARIABLES GLOBALES
======================== */
:root {
  --main-color: #ffc107;
  --main-hover: #ff9800;
  --bg-dark: #111;
  --bg-card: rgba(28, 28, 28, 0.85);
  --glass: rgba(17, 17, 17, 0.7);
  --text-light: #f1f1f1;
  --text-muted: #ccc;
  --radius: 16px;
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* ========================
   ✨ RESET & BASE
======================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(to right, #111, #1a1a1a);
  color: var(--text-light);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Scrollbar stylisée */
.content::-webkit-scrollbar {
  width: 8px;
}
.content::-webkit-scrollbar-track {
  background: transparent;
}
.content::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

/* ========================
   🧭 SIDEBAR
======================== */
.sidebar {
  width: 240px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 2rem 1rem;
  box-shadow: var(--shadow);
}

.sidebar img {
  width:100%;
  margin-bottom: 100px;
}

.sidebar ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar ul li {
  cursor: pointer;
  position: relative;
  transition: color 0.3s;
}

.sidebar ul li:hover {
  color: var(--main-color);
}

.sidebar ul li::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--main-color);
  transition: width 0.3s ease;
}

.sidebar ul li:hover::after {
  width: 100%;
}

/* ========================
   📺 CONTENU PRINCIPAL
======================== */
.content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

#category-title {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

#episode-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.episode-card {
  background-color: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.5s ease-out;
}

.episode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(255, 193, 7, 0.4);
}

.episode-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.episode-card:hover img {
  transform: scale(1.05);
}

.episode-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.episode-info h3 {
  color: var(--main-color);
  font-size: 1rem;
  font-weight: 600;
}

.episode-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========================
   ▶️ LECTURE / REPRISE
======================== */
.resume-section {
  margin-bottom: 2rem;
  background-color: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: fadeIn 0.5s ease-out;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.resume-section h2 {
  margin-bottom: 1rem;
  color: var(--main-color);
}

.resume-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.resume-card img {
  width: 160px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
}

.resume-card h3 {
  margin: 0;
  color: var(--main-color);
}

.resume-card p {
  margin: 0.5rem 0;
  color: var(--text-muted);
}

.resume-card button {
  padding: 0.5rem 1rem;
  background-color: var(--main-color);
  color: black;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s, transform 0.2s;
}

.resume-card button:hover {
  background-color: var(--main-hover);
  animation: pulse 0.3s ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* =========================
   🎥 LECTEUR VIDEO RESPONSIVE
========================= */
.video-player {
  width: 100%;
  max-width: 900px;
  margin: 2rem auto;
}

.responsive-video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  max-height: 70vh;
  min-height: 180px;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.video-player iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
  border-radius: var(--radius);
  background: #000;
  box-shadow: var(--shadow);
  max-height: 70vh;
}

/* Sur mobile : le player est moins haut */
@media (max-width: 800px) {
  .video-player {
    max-width: 100vw;
    margin: 1rem 0;
  }
  .responsive-video-wrapper {
    max-height: 42vw;
    min-height: 140px;
    padding-bottom: 56.25%;
  }
  .video-player iframe {
    max-height: 240px;
    min-height: 140px;
  }
}

/* ========================
   🌍 LANG SELECT DROPDOWN
======================== */
.lang-switcher {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 999;
}

.lang-switcher img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid white;
  background-color: black;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s;
}

.lang-switcher img:hover {
  transform: scale(1.1);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: 70px;
  right: 0;
  background-color: #1c1c1c;
  border: 1px solid #444;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.lang-dropdown div {
  padding: 0.6rem 1rem;
  cursor: pointer;
  color: white;
}

.lang-dropdown div:hover {
  background-color: var(--main-color);
  color: black;
}

/* ========================
   🌀 SCROLL HORIZONTAL (CARROUSEL)
======================== */
.scroll-horizontal {
  display: flex !important;
  flex-direction: row;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.scroll-horizontal .episode-card {
  flex: 0 0 calc(15% - 1rem);
  scroll-snap-align: start;
}

.scroll-horizontal::-webkit-scrollbar {
  height: 15px;
}
.scroll-horizontal::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

/* ========================
   ✨ ANIMATIONS GLOBALES
======================== */
.fade-in {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================
   📱 RESPONSIVE (Mobile)
======================== */
@media screen and (max-width: 768px) {
  body {
    flex-direction: column;
    height: auto;
    overflow: auto !important;
    height: auto !important;
    display: block !important;
  }

  .sidebar {
    position: fixed;
    bottom: 0;
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
    background-color: var(--bg-card);
    padding: 0.75rem 0;
    z-index: 1000;
  }

  .sidebar img {
    display: none;
  }

  .sidebar ul {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
  }

  .sidebar ul li {
    font-size: 0.9rem;
    text-align: center;
  }

  .content {
    padding: 1rem;
    margin-bottom: 80px;
    height: auto;
  }

  .resume-card {
    flex-direction: column;
    text-align: center;
  }

  .resume-card img {
    width: 100%;
    max-width: 320px;
  }

  .scroll-horizontal .episode-card {
    flex: 0 0 calc(50% - 1rem);
  }
}

/* ================================
   🌐 PAGE DE SÉLECTION DE LANGUE
================================ */
.language-select {
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-family: 'Segoe UI', sans-serif;
  color: white;
  padding: 1rem;
}

.language-container {
  text-align: center;
}

.language-container h1 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--main-color);
}

.lang-options {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.lang-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
  animation: fadeIn 0.5s ease-in-out;
}

.lang-card img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid white;
  object-fit: cover;
  background-color: black;
}

.lang-card p {
  margin-top: 1rem;
  font-size: 1.1rem;
  color: white;
}

.lang-card:hover {
  transform: scale(1.05);
}