/* ============================================================
   SIRA+ — Design system
   Palette : nuit indigo + or sahélien + terre cuite (bogolan)
   Type    : Syne (titres) / Inter (texte)
   ============================================================ */

:root {
  --ink: #0C0A14;        /* fond nuit */
  --panel: #171225;      /* surfaces */
  --panel-2: #1F1930;
  --line: #2B2440;
  --gold: #E8A33D;       /* accent principal */
  --gold-soft: #F4C476;
  --clay: #C75B39;       /* accent secondaire */
  --sand: #F2E9DA;       /* texte principal */
  --mute: #9A92AC;       /* texte secondaire */
  --danger: #E0564B;
  --ok: #4CAF7D;
  --radius: 14px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --zigzag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='10' viewBox='0 0 28 10'%3E%3Cpath d='M0 9 7 1l7 8 7-8 7 8' fill='none' stroke='%23E8A33D' stroke-width='2'/%3E%3C/svg%3E");
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--sand);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.01em; }
main { min-height: 70vh; }

::selection { background: var(--gold); color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 14px 4vw;
  background: linear-gradient(to bottom, rgba(12,10,20,.96), rgba(12,10,20,.85));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--font-display); font-weight: 800; font-size: 1.5rem;
  display: flex; align-items: center; gap: 8px; color: var(--sand);
}
.brand-mark { width: 26px; height: 26px; color: var(--gold); }
.brand-plus { color: var(--gold); }
.nav-links { display: flex; gap: 22px; font-weight: 500; font-size: .95rem; color: var(--mute); }
.nav-links a:hover { color: var(--sand); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.nav-search input {
  background: var(--panel); border: 1px solid var(--line); color: var(--sand);
  border-radius: 99px; padding: 8px 16px; width: 220px; font-family: inherit;
  transition: border-color .2s, width .25s;
}
.nav-search input:focus { border-color: var(--gold); width: 260px; outline: none; }
.nav-user { position: relative; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--gold);
  background: var(--clay); color: var(--sand); font-weight: 700; font-size: 1rem;
  cursor: pointer; font-family: var(--font-display);
}
.user-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; display: none; box-shadow: 0 18px 40px rgba(0,0,0,.5);
}
.user-menu.open { display: block; }
.user-menu a { display: block; padding: 9px 12px; border-radius: 8px; font-size: .92rem; }
.user-menu a:hover { background: var(--panel-2); color: var(--gold-soft); }
.user-menu-name { display: block; padding: 6px 12px 0; font-weight: 700; }
.user-menu-sub { display: block; padding: 0 12px 8px; font-size: .8rem; color: var(--mute); border-bottom: 1px solid var(--line); margin-bottom: 6px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; padding: 11px 22px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; font-family: var(--font-body);
  transition: transform .15s, background .2s, border-color .2s;
}
.btn:active { transform: scale(.97); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-soft); }
.btn-ghost { background: rgba(242,233,218,.08); color: var(--sand); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); }
.btn-clay { background: var(--clay); color: var(--sand); }
.btn-lg { padding: 15px 32px; font-size: 1.05rem; border-radius: 12px; }
.btn-block { width: 100%; }

/* ---------- Hero (landing & catalogue) ---------- */
.hero {
  position: relative; min-height: 78vh; display: flex; align-items: flex-end;
  padding: 0 4vw 64px; overflow: hidden; isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background-size: cover; background-position: center top;
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--ink) 4%, rgba(12,10,20,.55) 45%, rgba(12,10,20,.25)),
    linear-gradient(to right, rgba(12,10,20,.8), transparent 60%);
}
.hero-content { max-width: 640px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 14px;
}
.hero-eyebrow::before { content: ''; width: 28px; height: 10px; background: var(--zigzag) repeat-x; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); font-weight: 800; margin-bottom: 16px; }
.hero p { color: var(--mute); font-size: 1.05rem; max-width: 54ch; margin-bottom: 26px; }
.hero-meta { display: flex; gap: 14px; color: var(--gold-soft); font-size: .9rem; font-weight: 600; margin-bottom: 14px; flex-wrap: wrap; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Strip bogolan (signature) ---------- */
.strip, .footer-strip { height: 10px; background: var(--zigzag) repeat-x center; opacity: .85; }

/* ---------- Rangées catalogue ---------- */
.rows { padding: 34px 0 60px; display: flex; flex-direction: column; gap: 42px; }
.row h2 {
  font-size: 1.3rem; font-weight: 700; padding: 0 4vw 14px;
  display: flex; align-items: baseline; gap: 12px;
}
.row h2 small { font-size: .78rem; color: var(--mute); font-family: var(--font-body); font-weight: 500; }
.row-scroll {
  display: flex; gap: 14px; overflow-x: auto; padding: 6px 4vw 18px;
  scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.card {
  flex: 0 0 168px; scroll-snap-align: start; position: relative;
  border-radius: var(--radius); overflow: hidden; background: var(--panel);
  transition: transform .25s, box-shadow .25s; outline: 1px solid transparent;
}
.card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.card:hover { transform: translateY(-6px) scale(1.03); box-shadow: 0 16px 36px rgba(0,0,0,.55); outline-color: var(--gold); }
.card-label {
  position: absolute; inset: auto 0 0 0; padding: 28px 10px 10px;
  background: linear-gradient(to top, rgba(12,10,20,.95), transparent);
  font-size: .85rem; font-weight: 600;
}
.card-badge {
  position: absolute; top: 8px; left: 8px; background: var(--clay); color: var(--sand);
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px;
}
.card-progress { position: absolute; bottom: 0; left: 0; height: 4px; background: var(--gold); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; padding: 24px 4vw 60px; }
.grid .card { flex: none; }

.section-title { padding: 36px 4vw 0; font-size: 1.6rem; }
.section-sub { padding: 4px 4vw 0; color: var(--mute); }

/* ---------- Page détails ---------- */
.details-body { padding: 0 4vw 50px; display: grid; grid-template-columns: 240px 1fr; gap: 36px; margin-top: -90px; position: relative; }
.details-poster { border-radius: var(--radius); overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.6); outline: 1px solid var(--line); }
.details-info h1 { font-size: clamp(1.8rem, 4vw, 3rem); margin-bottom: 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 5px 14px; font-size: .8rem; color: var(--mute); }
.synopsis { max-width: 70ch; color: var(--sand); }

.episodes { padding: 10px 4vw 60px; }
.season-tabs { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.season-tab { background: var(--panel); border: 1px solid var(--line); color: var(--mute); border-radius: 10px; padding: 8px 18px; cursor: pointer; font-weight: 600; }
.season-tab.active { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.episode-list { display: flex; flex-direction: column; gap: 10px; }
.episode {
  display: flex; gap: 16px; align-items: center; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px;
  transition: border-color .2s;
}
.episode:hover { border-color: var(--gold); }
.episode-num { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--gold); min-width: 38px; }
.episode-info { flex: 1; }
.episode-info strong { display: block; }
.episode-info span { font-size: .85rem; color: var(--mute); }

/* ---------- Lecteur ---------- */
.player-wrap { background: #000; }
.player-wrap video { width: 100%; max-height: 82vh; display: block; }
.player-bar { padding: 18px 4vw 40px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.player-bar h1 { font-size: 1.4rem; }
.player-bar .chip { margin-left: auto; }

/* ---------- Formulaires / Auth ---------- */
.auth-wrap {
  min-height: 86vh; display: grid; place-items: center; padding: 40px 4vw;
  background:
    radial-gradient(ellipse 70% 50% at 80% 10%, rgba(199,91,57,.18), transparent),
    radial-gradient(ellipse 60% 40% at 10% 90%, rgba(232,163,61,.12), transparent);
}
.auth-card {
  width: 100%; max-width: 440px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 20px; padding: 38px 34px;
}
.auth-card h1 { font-size: 1.8rem; margin-bottom: 6px; }
.auth-card .auth-sub { color: var(--mute); font-size: .92rem; margin-bottom: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--gold-soft); }
.field input, .field select, .field textarea {
  width: 100%; background: var(--ink); border: 1px solid var(--line); color: var(--sand);
  border-radius: 10px; padding: 12px 14px; font-family: inherit; font-size: .95rem;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); outline: none; }
.auth-alt { margin-top: 18px; font-size: .9rem; color: var(--mute); text-align: center; }
.auth-alt a { color: var(--gold); font-weight: 600; }

.alert { border-radius: 10px; padding: 12px 16px; font-size: .9rem; margin-bottom: 18px; }
.alert-error { background: rgba(224,86,75,.12); border: 1px solid rgba(224,86,75,.4); color: #F2A6A0; }
.alert-ok { background: rgba(76,175,125,.12); border: 1px solid rgba(76,175,125,.4); color: #9ADBBB; }

/* ---------- Plans ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; padding: 30px 4vw 70px; max-width: 1100px; margin: 0 auto; }
.plan {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 30px 26px; display: flex; flex-direction: column; gap: 8px; position: relative;
  transition: transform .2s, border-color .2s;
}
.plan:hover { transform: translateY(-5px); border-color: var(--gold); }
.plan.popular { border-color: var(--gold); background: linear-gradient(180deg, rgba(232,163,61,.08), var(--panel) 55%); }
.plan-tag { position: absolute; top: -12px; left: 24px; background: var(--gold); color: var(--ink); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 12px; border-radius: 99px; }
.plan h3 { font-size: 1.25rem; }
.plan-price { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--gold); }
.plan-price small { font-size: .85rem; color: var(--mute); font-family: var(--font-body); font-weight: 500; }
.plan p { color: var(--mute); font-size: .9rem; flex: 1; }
.plan-quality { font-size: .8rem; color: var(--gold-soft); font-weight: 700; letter-spacing: .05em; }

/* ---------- Landing sections ---------- */
.feature-band { padding: 70px 4vw; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 30px; max-width: 1200px; margin: 0 auto; }
.feature h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--gold-soft); }
.feature p { color: var(--mute); font-size: .92rem; }
.feature-icon { font-size: 1.6rem; margin-bottom: 12px; }

/* ---------- Compte ---------- */
.account { max-width: 760px; margin: 0 auto; padding: 40px 4vw 70px; display: flex; flex-direction: column; gap: 22px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
.panel h2 { font-size: 1.15rem; margin-bottom: 14px; }
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .93rem; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--mute); }
.tag-ok { color: var(--ok); font-weight: 700; }
.tag-bad { color: var(--danger); font-weight: 700; }

/* ---------- Footer ---------- */
.footer { margin-top: 40px; border-top: 1px solid var(--line); }
.footer-inner { padding: 36px 4vw 46px; display: flex; gap: 30px; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; }
.footer-brand { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; }
.footer-tag { color: var(--mute); font-size: .88rem; }
.footer-links { display: flex; gap: 18px; font-size: .9rem; color: var(--mute); }
.footer-links a:hover { color: var(--gold); }
.footer-copy { color: var(--mute); font-size: .82rem; }

/* ---------- Tables admin ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { color: var(--gold-soft); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.table tr:hover td { background: rgba(242,233,218,.03); }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .nav { gap: 14px; flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; justify-content: space-between; font-size: .9rem; }
  .nav-search input { width: 140px; }
  .nav-search input:focus { width: 170px; }
  .details-body { grid-template-columns: 1fr; margin-top: -40px; }
  .details-poster { max-width: 200px; }
  .hero { min-height: 64vh; padding-bottom: 44px; }
  .card { flex-basis: 132px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   SIRA+ — Ajouts v2
   ============================================================ */

/* ---------- Cloche notifications ---------- */
.notif-bell {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; color: var(--mute);
  transition: color .2s, background .2s;
}
.notif-bell:hover { color: var(--sand); background: var(--panel-2); }
.notif-bell svg { width: 20px; height: 20px; }
.notif-badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px;
  background: var(--clay); color: var(--sand); font-size: .62rem; font-weight: 800;
  border-radius: 99px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1;
}

/* ---------- Système de notation étoiles ---------- */
.star-rating {
  display: flex; flex-direction: row-reverse; justify-content: center;
  gap: 4px; margin-top: 14px;
}
.star-rating input { display: none; }
.star-rating label {
  font-size: 1.6rem; color: var(--line); cursor: pointer;
  transition: color .15s, transform .12s;
}
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label { color: var(--gold); }
.star-rating label:hover { transform: scale(1.15); }

/* ---------- Page nouveautés liste-view ---------- */
.new-item {
  display: flex; gap: 16px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 16px; transition: border-color .2s;
}
.new-item:hover { border-color: var(--gold); }

/* ---------- Modal bande-annonce ---------- */
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
#trailerModal { animation: fadeIn .2s ease; }

/* ---------- Barre de progression reprise lecture ---------- */
.resume-bar { background: var(--line); border-radius: 2px; height: 4px; width: 300px; max-width: 100%; margin-top: 6px; }
.resume-bar-fill { height: 100%; background: var(--gold); border-radius: 2px; }

/* ---------- Overlay autoplay épisode suivant ---------- */
.autoplay-overlay {
  position: absolute; inset: 0;
  background: rgba(12,10,20,.88);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
  color: var(--sand); text-align: center; z-index: 10;
}
.autoplay-overlay.show { display: flex; }
.autoplay-countdown {
  font-family: var(--font-display); font-size: 4rem; font-weight: 800; color: var(--gold);
}
.autoplay-bar { width: 220px; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.autoplay-bar-fill { height: 100%; background: var(--gold); transition: width 1s linear; }

/* ---------- Recherche avancée ---------- */
.search-filters { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 28px; align-items: flex-end; }
.search-filters label { font-size: .8rem; color: var(--mute); display: block; margin-bottom: 4px; }
.search-filters input,
.search-filters select {
  background: var(--panel); border: 1px solid var(--line); color: var(--sand);
  border-radius: 10px; padding: 11px 14px; font-family: inherit; font-size: .93rem;
}
.search-filters input:focus,
.search-filters select:focus { border-color: var(--gold); outline: none; }

/* ---------- Open Graph share button ---------- */
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .85rem; color: var(--mute); border: 1px solid var(--line);
  border-radius: 99px; padding: 6px 14px; cursor: pointer; background: none;
  transition: border-color .2s, color .2s;
}
.share-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- Animation chargement carte ---------- */
@keyframes shimmer {
  0%   { background-position: -400px 0 }
  100% { background-position:  400px 0 }
}
.card-skeleton {
  flex: 0 0 168px; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 2/3;
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
}

/* ---------- PWA install banner ---------- */
.pwa-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: var(--panel); border-top: 1px solid var(--line);
  padding: 14px 4vw; display: flex; align-items: center; gap: 14px;
  transform: translateY(100%); transition: transform .3s;
}
.pwa-banner.show { transform: translateY(0); }
.pwa-banner p { flex: 1; font-size: .9rem; }
