/* ============================================================
   STREAMPROX — Thème sombre
   ============================================================ */
:root {
  --bg: #0d1117;
  --bg-2: #141b24;
  --bg-3: #1c2531;
  --border: #26303d;
  --text: #e6edf3;
  --muted: #8b98a9;
  --accent: #e50914;
  --accent-2: #f5f5f1;
  --green: #2ea44f;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #fff; padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 0; }

.muted { color: var(--muted); }

main { flex: 1; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 8px; border: 1px solid transparent;
  font-weight: 700; font-size: 14.5px; transition: all .18s ease;
  background: var(--bg-3); color: var(--text);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #ff1a25; }
.btn-outline { border-color: var(--border); background: rgba(255,255,255,.04); }
.btn-outline:hover { border-color: var(--muted); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg-3); }
.btn-danger { background: #b91c1c; color: #fff; }
.btn-icon { padding: 10px 12px; background: var(--bg-3); border-color: var(--border); }
.btn-lg { padding: 14px 30px; font-size: 16.5px; border-radius: 10px; }
.btn-sm { padding: 7px 14px; font-size: 13.5px; }
.btn-block { width: 100%; justify-content: center; }

.btn-play {
  background: var(--accent-2); color: #111;
}
.btn-play:hover { background: #fff; transform: scale(1.03); }

/* ---------- Barre de navigation ---------- */
.navbar {
  position: sticky; top: 0; z-index: 90;
  background: linear-gradient(180deg, rgba(13,17,23,.98), rgba(13,17,23,.9));
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(8px);
}
.navbar.scrolled { border-bottom-color: var(--border); }

.nav-inner {
  max-width: 1320px; margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; gap: 26px; height: 64px;
}

.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 900; font-size: 21px; letter-spacing: -.5px; white-space: nowrap;
}

.nav-links { display: flex; gap: 4px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 13px; border-radius: 8px; color: var(--muted);
  font-weight: 600; font-size: 14.5px; transition: all .15s;
}
.nav-link:hover { color: var(--text); background: var(--bg-3); }
.nav-link.active { color: var(--text); background: rgba(229,9,20,.14); }
.nav-link.active svg { color: var(--accent); }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.search-box {
  position: relative; display: flex; align-items: center; gap: 8px;
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 24px;
  padding: 7px 14px; color: var(--muted); width: 230px; transition: all .2s;
}
.search-box:focus-within { border-color: var(--accent); width: 300px; color: var(--text); }
.search-box input {
  background: none; border: none; outline: none; color: var(--text); width: 100%;
}
.search-box input::placeholder { color: var(--muted); }

.suggest {
  position: absolute; top: 48px; right: 0; width: 340px; z-index: 100;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden;
}
.suggest-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  transition: background .12s;
}
.suggest-item:hover { background: var(--bg-3); }
.suggest-thumb {
  width: 40px; height: 56px; border-radius: 6px; flex-shrink: 0;
  background: var(--c, var(--bg-3));
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 11px;
}
.suggest-item small { color: var(--muted); display: block; }
.suggest-type {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--accent); font-weight: 800;
}

/* menu utilisateur */
.user-menu { position: relative; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #e50914, #8b1a2b);
  color: #fff; font-weight: 800; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.avatar:hover { border-color: var(--accent); }
.dropdown {
  position: absolute; right: 0; top: 46px; width: 240px; z-index: 100;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden;
}
.dropdown a { display: flex; align-items: center; gap: 10px; padding: 11px 16px; font-size: 14px; color: var(--text); }
.dropdown a:hover { background: var(--bg-3); color: var(--accent); }
.dropdown-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.dropdown-head small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.dd-sep { height: 1px; background: var(--border); margin: 4px 0; }

.auth-links { display: flex; gap: 10px; align-items: center; }

/* ---------- Messages flash ---------- */
.flash-wrap { position: fixed; top: 76px; right: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; }
.flash {
  padding: 13px 42px 13px 16px; border-radius: 10px; font-size: 14px;
  background: var(--bg-3); border: 1px solid var(--border); box-shadow: var(--shadow);
  position: relative; animation: slide-in .25s ease;
  max-width: 380px;
}
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.flash-success { border-color: var(--green); }
.flash-danger { border-color: var(--accent); background: #2b1216; }
.flash-info { border-color: #1d6fb8; }
.flash-warning { border-color: #d29922; }
.flash-close {
  position: absolute; right: 8px; top: 8px; background: none; border: none;
  color: var(--muted); font-size: 18px; line-height: 1;
}
.flash-close:hover { color: var(--text); }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--accent-2); color: #111; font-weight: 700; font-size: 14px;
  padding: 12px 24px; border-radius: 30px; z-index: 130; box-shadow: var(--shadow);
  animation: toast-in .3s ease;
}
@keyframes toast-in { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- Héro ---------- */
.hero { position: relative; min-height: 440px; display: flex; align-items: center; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 75% 20%, var(--hero-c, #5b21b6) 0%, transparent 55%),
    linear-gradient(180deg, rgba(13,17,23,0) 30%, var(--bg) 92%),
    linear-gradient(90deg, rgba(13,17,23,.88) 0%, rgba(13,17,23,.45) 60%, rgba(13,17,23,.25) 100%),
    var(--bg-2);
}
.hero-content {
  position: relative; max-width: 1320px; margin: 0 auto; padding: 60px 22px;
  width: 100%; max-width: 760px;
}
.hero-badge {
  display: inline-block; padding: 5px 12px; border-radius: 20px;
  background: rgba(229,9,20,.18); border: 1px solid var(--accent);
  color: #ff6b74; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px;
}
.hero-title { font-size: clamp(34px, 5vw, 62px); font-weight: 900; line-height: 1.05; margin: 16px 0 10px; letter-spacing: -1px; }
.hero-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14.5px; color: var(--muted); margin-bottom: 14px; }
.meta-year { color: var(--text); font-weight: 700; }
.meta-rating { color: #f5c518; font-weight: 700; }
.meta-quality { padding: 2px 9px; border: 1px solid var(--muted); border-radius: 4px; font-size: 12px; font-weight: 700; }
.hero-desc { color: #c9d3df; max-width: 620px; line-height: 1.6; margin-bottom: 22px; }
.hero-actions { display: flex; gap: 12px; align-items: center; }

/* ---------- Rangées ---------- */
.rows { max-width: 1320px; margin: 0 auto; padding: 10px 22px 40px; }
.row { margin-top: 34px; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.row-title { font-size: 21px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.row-more { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.row-more:hover { color: var(--accent); }

.live-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: #ff3b30; margin-right: 2px;
  box-shadow: 0 0 0 0 rgba(255,59,48,.7);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,59,48,.7); }
  70% { box-shadow: 0 0 0 9px rgba(255,59,48,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,59,48,0); }
}

.row-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr);
  gap: 14px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin;
}
.row-track::-webkit-scrollbar { height: 6px; }
.row-track::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ---------- Cartes ---------- */
.card { display: block; transition: transform .18s ease; min-width: 0; }
.card:hover { transform: translateY(-4px); z-index: 2; }
.card-poster {
  position: relative; aspect-ratio: 2/3; border-radius: 10px; overflow: hidden;
  background: linear-gradient(140deg, var(--bg-3), var(--c, #1f2430) 70%);
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.card-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-poster img { transform: scale(1.06); }
.card-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45); opacity: 0; transition: opacity .2s;
}
.card:hover .card-overlay { opacity: 1; }
.play-mini {
  width: 46px; height: 46px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #fff; box-shadow: 0 4px 16px rgba(229,9,20,.5);
}
.card-badge {
  position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 5px;
  background: rgba(13,17,23,.8); border: 1px solid var(--border);
  font-size: 11px; font-weight: 800; color: #ffd166;
}
.card-info { padding: 8px 2px 0; }
.card-info h3 { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-info p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* chaînes */
.live-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 5px; font-size: 10.5px; font-weight: 800;
  background: rgba(13,17,23,.85); color: #ff4d4d; border: 1px solid rgba(255,77,77,.4);
}
.channel-poster { aspect-ratio: 16/9; display: flex; align-items: flex-end; padding: 14px; }
.channel-name { font-weight: 800; font-size: 17px; z-index: 1; position: relative; }
.channel-logo {
  width: 44px; height: 44px; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
  background: linear-gradient(140deg, var(--c), #111);
}
.channel-poster img.channel-logo {
  position: absolute; top: 10px; left: 10px; width: 34px; height: 34px;
  background: rgba(13,17,23,.75); object-fit: contain; padding: 4px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.15); z-index: 2;
}
.fchannel { position: relative; }
.fchannel img.fchannel-logo {
  position: absolute; top: 10px; right: 10px; width: 38px; height: 38px;
  background: rgba(13,17,23,.75); object-fit: contain; padding: 4px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.15); z-index: 2;
}
.admin-thumb.square { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }

/* en cours */
.continue-poster { display: flex; align-items: center; justify-content: center; text-align: center; padding: 14px; font-weight: 700; font-size: 13px; }
.progress-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background: rgba(255,255,255,.15); }
.progress-bar div { height: 100%; background: var(--accent); }

/* ---------- Grille catalogue ---------- */
.catalog-page, .search-page, .iptv-page, .watchlist-page, .profile-page {
  max-width: 1320px; margin: 0 auto; padding: 34px 22px 50px;
}
.catalog-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 22px;
}
.catalog-head h1 { font-size: 30px; font-weight: 900; letter-spacing: -.5px; }
.catalog-head p { color: var(--muted); margin-top: 4px; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters select, .filters input[type=search] {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text);
  padding: 9px 13px; border-radius: 8px; outline: none;
}
.filters select:focus, .filters input:focus { border-color: var(--accent); }
.search-field.big { width: 320px; max-width: 100%; }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 20px 14px;
}
.active-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -8px 0 22px; color: var(--muted); font-size: 14px; }
.filter-chip {
  padding: 5px 12px; border-radius: 16px; background: var(--bg-3);
  border: 1px solid var(--border); font-size: 13px; color: var(--text);
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.big { padding: 9px 18px; font-size: 14px; }

.chip-cloud { display: flex; gap: 10px; flex-wrap: wrap; }

/* pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 34px; flex-wrap: wrap; }
.page-btn {
  padding: 9px 15px; border-radius: 8px; background: var(--bg-3);
  border: 1px solid var(--border); font-weight: 600; font-size: 14px;
}
.page-btn:hover { border-color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Catégories IPTV ---------- */
.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.cat-tab {
  padding: 9px 18px; border-radius: 24px; background: var(--bg-3);
  border: 1px solid var(--border); font-weight: 600; font-size: 14px; color: var(--muted);
}
.cat-tab:hover { color: var(--text); border-color: var(--muted); }
.cat-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.featured-channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 34px; }
.fchannel {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  aspect-ratio: 16/9; padding: 16px; border-radius: 12px; position: relative;
  background: linear-gradient(140deg, var(--bg-3), var(--c, #1f2430) 75%);
  border: 1px solid var(--border); transition: transform .18s;
}
.fchannel:hover { transform: translateY(-3px); border-color: var(--c); }
.fchannel strong { font-size: 18px; }
.fchannel small { color: var(--muted); }

.section-title { font-size: 21px; font-weight: 800; margin: 30px 0 14px; }
.section-title small { color: var(--muted); font-weight: 600; font-size: 15px; }

/* ---------- Détail ---------- */
.detail-page { position: relative; overflow: hidden; }
.detail-backdrop { position: absolute; inset: 0; opacity: .35; }
.detail-backdrop img { width: 100%; height: 100%; object-fit: cover; }
.detail-page::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,17,23,.55), var(--bg) 92%),
              radial-gradient(ellipse at 30% 10%, var(--dc, #5b21b6) 0%, transparent 50%);
}
.detail-layout {
  position: relative; z-index: 1; max-width: 1320px; margin: 0 auto;
  padding: 56px 22px 40px; display: flex; gap: 40px; align-items: flex-start;
}
.detail-poster {
  width: 280px; flex-shrink: 0; border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.detail-poster img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.detail-body { flex: 1; padding-top: 10px; }
.detail-breadcrumb { color: var(--muted); font-size: 13.5px; margin-bottom: 12px; }
.detail-breadcrumb a:hover { color: var(--accent); }
.detail-title { font-size: clamp(28px, 4vw, 46px); font-weight: 900; letter-spacing: -1px; }
.detail-ot { font-size: 18px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.detail-meta { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.meta-chip {
  padding: 6px 13px; border-radius: 8px; background: rgba(255,255,255,.06);
  border: 1px solid var(--border); font-size: 13.5px; font-weight: 600;
}
.rating-chip { color: #f5c518; }
.detail-genres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.genre-badge {
  padding: 5px 13px; border-radius: 18px; font-size: 13px; font-weight: 600;
  background: rgba(229,9,20,.12); border: 1px solid rgba(229,9,20,.4); color: #ff8d94;
}
.genre-badge:hover { background: var(--accent); color: #fff; }
.detail-desc { line-height: 1.7; color: #c9d3df; max-width: 760px; margin-bottom: 16px; }
.detail-person { color: var(--muted); font-size: 14.5px; margin-bottom: 6px; }
.detail-person strong { color: var(--text); }
.detail-actions { display: flex; gap: 12px; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.fav-btn.is-fav { border-color: #f5c518; color: #f5c518; }

/* épisodes */
.episodes-section, .similar-section { max-width: 1320px; margin: 0 auto; padding: 0 22px 40px; }
.season-accordion { display: flex; flex-direction: column; gap: 12px; }
.season-block { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.season-block summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 18px; cursor: pointer; list-style: none; font-weight: 700;
}
.season-block summary::-webkit-details-marker { display: none; }
.season-block summary::after { content: '▾'; color: var(--muted); transition: transform .2s; }
.season-block[open] summary::after { transform: rotate(180deg); }
.season-block summary:hover { background: var(--bg-3); }
.season-count { color: var(--muted); font-size: 13px; font-weight: 600; }
.episode-list { border-top: 1px solid var(--border); }
.episode-item {
  display: flex; gap: 16px; padding: 12px 18px; align-items: center;
  transition: background .15s; border-bottom: 1px solid rgba(38,48,61,.5);
}
.episode-item:last-child { border-bottom: none; }
.episode-item:hover { background: var(--bg-3); }
.episode-item.watched .ep-head strong { color: var(--green); }
.ep-thumb {
  width: 120px; aspect-ratio: 16/9; border-radius: 8px; position: relative; flex-shrink: 0;
  background: linear-gradient(140deg, var(--bg-3), var(--c, #222a36) 70%);
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--muted);
  overflow: hidden;
}
.ep-head { display: flex; justify-content: space-between; gap: 14px; }
.ep-duration { color: var(--muted); font-size: 13px; white-space: nowrap; }
.ep-info p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

/* ---------- Lecteur ---------- */
.watch-page { max-width: 1320px; margin: 0 auto; padding: 26px 22px 50px; }
.player-shell { background: #000; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.player-shell video { width: 100%; aspect-ratio: 16/9; display: block; background: #000; }

.watch-info { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 22px 4px 0; }
.watch-left { flex: 1; min-width: 280px; }
.watch-breadcrumb { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.watch-breadcrumb a:hover { color: var(--accent); }
.watch-left h1 { font-size: 26px; font-weight: 900; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.watch-sub { color: var(--muted); }
.watch-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.watch-desc { color: var(--muted); font-size: 13.5px; max-width: 420px; }
.watch-right { display: flex; flex-direction: column; gap: 12px; align-items: flex-end; }
.ep-nav { display: flex; gap: 10px; }
.ep-select {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text);
  padding: 9px 13px; border-radius: 8px; min-width: 280px; outline: none;
}
.ep-select:focus { border-color: var(--accent); }

/* ---------- Auth ---------- */
.auth-page { max-width: 460px; margin: 60px auto; padding: 0 22px; }
.auth-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px;
  padding: 40px 36px; box-shadow: var(--shadow);
}
.auth-logo { text-align: center; margin-bottom: 26px; }
.auth-logo h1 { font-size: 26px; margin-top: 12px; font-weight: 900; }
.auth-logo p { color: var(--muted); margin-top: 6px; font-size: 14.5px; }
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-form label { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.auth-form input {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 12px 14px; border-radius: 9px; outline: none; font-size: 15px;
}
.auth-form input:focus { border-color: var(--accent); }
.auth-alt { text-align: center; margin-top: 20px; color: var(--muted); font-size: 14px; }
.auth-alt a { color: var(--accent); font-weight: 700; }

/* ---------- Profil ---------- */
.profile-head { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.profile-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  background: linear-gradient(135deg, #e50914, #8b1a2b);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 900; color: #fff;
  box-shadow: 0 0 0 4px rgba(229,9,20,.25);
}
.profile-head h1 { font-size: 30px; font-weight: 900; }
.profile-sub { color: var(--muted); margin-top: 4px; }
.admin-tag {
  background: rgba(229,9,20,.15); color: #ff6b74; padding: 3px 10px;
  border-radius: 12px; font-size: 12px; font-weight: 700;
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 30px; }
.stat-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; display: flex; flex-direction: column; gap: 4px;
}
.stat-card strong { font-size: 28px; font-weight: 900; color: var(--accent); }
.stat-card span { color: var(--muted); font-size: 14px; }
.profile-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 22px;
}
.panel h2 { font-size: 17px; margin-bottom: 16px; }

/* ---------- États vides ---------- */
.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-state h2 { color: var(--text); margin-bottom: 8px; }
.empty-state p { margin-bottom: 20px; }
.empty-state .btn { margin: 6px; }
.empty-state.small { padding: 20px; }

/* ---------- Erreur 404 ---------- */
.error-page { text-align: center; padding: 110px 20px; }
.error-page h1 { font-size: 90px; font-weight: 900; color: var(--accent); }
.error-page p { color: var(--muted); margin-bottom: 22px; font-size: 17px; }

/* ---------- Footer ---------- */
.footer { background: var(--bg-2); border-top: 1px solid var(--border); margin-top: 30px; }
.footer-inner {
  max-width: 1320px; margin: 0 auto; padding: 40px 22px 24px;
  display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap;
}
.footer-tag { color: var(--muted); margin-top: 8px; font-size: 14px; }
.footer-links { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-links h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 12px; }
.footer-links a { display: block; color: var(--text); font-size: 14px; padding: 4px 0; }
.footer-links a:hover { color: var(--accent); }
.footer-legal { border-top: 1px solid var(--border); padding: 16px 22px; text-align: center; color: var(--muted); font-size: 13px; }

/* ============================================================
   ADMINISTRATION
   ============================================================ */
.admin-layout { display: flex; min-height: calc(100vh - 64px); }
.admin-sidebar {
  width: 240px; flex-shrink: 0; background: var(--bg-2);
  border-right: 1px solid var(--border); padding: 24px 14px;
}
.admin-sidebar h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 0 10px; margin-bottom: 14px; }
.admin-sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px;
}
.admin-sidebar nav a:hover { color: var(--text); background: var(--bg-3); }
.admin-sidebar nav a.active { color: #fff; background: rgba(229,9,20,.85); }

.admin-content { flex: 1; padding: 30px; max-width: 1400px; }
.admin-title { font-size: 24px; font-weight: 900; margin-bottom: 20px; }
.admin-title small { color: var(--muted); font-weight: 600; font-size: 15px; }
.admin-title.small { font-size: 17px; margin-top: 26px; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.admin-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-actions input[type=search], .admin-actions input[type=text] {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text);
  padding: 8px 12px; border-radius: 8px; outline: none;
}

.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat-tile {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; display: flex; flex-direction: column; gap: 4px;
}
.stat-tile strong { font-size: 30px; font-weight: 900; color: var(--accent); }
.stat-tile span { color: var(--muted); font-size: 13.5px; }
.stat-tile a { color: var(--accent); font-size: 13px; font-weight: 700; margin-top: 6px; }

.admin-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.admin-table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 10px 12px; border-bottom: 1px solid rgba(38,48,61,.6); font-size: 14px; vertical-align: middle; }
.admin-table tr:hover td { background: rgba(255,255,255,.02); }
.admin-table.wide { min-width: 900px; }
.admin-thumb { width: 40px; height: 60px; border-radius: 6px; object-fit: cover; }
.td-actions { display: flex; gap: 8px; align-items: center; }
.td-genres { max-width: 220px; color: var(--muted); font-size: 13px; }
.tag-featured {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 10px;
  background: rgba(245,197,24,.15); color: #f5c518; font-size: 11px; font-weight: 700;
}
.toggle-status { font-size: 13px; font-weight: 600; }
.toggle-status:hover { opacity: .8; }

.admin-form { max-width: 860px; display: flex; flex-direction: column; gap: 15px; }
.admin-form label { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.admin-form input:not([type=checkbox]):not([type=color]), .admin-form select, .admin-form textarea {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 11px 14px; border-radius: 9px; outline: none;
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { border-color: var(--accent); }
.admin-form input[type=color] { width: 90px; height: 44px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); padding: 4px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-row { display: flex; gap: 24px; flex-wrap: wrap; }
.switch { flex-direction: row !important; align-items: center; gap: 9px !important; cursor: pointer; }
.switch input { accent-color: var(--accent); width: 17px; height: 17px; }

.genre-picker { display: flex; gap: 9px; flex-wrap: wrap; }
.chip-check {
  display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 7px;
  padding: 7px 13px; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 20px; cursor: pointer; font-size: 13.5px !important;
}
.chip-check:has(input:checked) { border-color: var(--accent); color: var(--accent); }
.chip-check input { accent-color: var(--accent); }

.inline-form { display: flex; gap: 10px; margin: 20px 0; flex-wrap: wrap; }
.inline-form input {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text);
  padding: 9px 13px; border-radius: 8px; outline: none;
}
.season-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 16px; }
.season-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.season-card-head { display: flex; justify-content: space-between; margin-bottom: 12px; }
.season-card-head span { color: var(--muted); font-size: 13px; }
.season-card-actions { display: flex; justify-content: space-between; align-items: center; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .detail-layout { flex-direction: column; align-items: center; text-align: center; }
  .detail-meta, .detail-genres, .detail-actions { justify-content: center; }
  .detail-desc { margin: 0 auto 16px; }
  .detail-poster { width: 230px; }
}

@media (max-width: 760px) {
  .nav-inner { gap: 12px; padding: 0 14px; }
  .nav-links { position: fixed; bottom: 0; left: 0; right: 0; z-index: 95;
    background: rgba(13,17,23,.97); border-top: 1px solid var(--border);
    display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .nav-link { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 10px; }
  main { padding-bottom: 56px; }
  .search-box { width: 100%; max-width: 150px; }
  .search-box:focus-within { width: 100%; }
  .suggest { width: calc(100vw - 28px); left: 14px; right: auto; }
  .hero { min-height: 380px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .catalog-head { flex-direction: column; align-items: flex-start; }
  .profile-cols { grid-template-columns: 1fr; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 12px; }
  .admin-sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .admin-sidebar nav a { padding: 7px 10px; font-size: 13px; }
  .admin-content { padding: 18px 14px; overflow-x: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .episode-item { flex-direction: column; align-items: flex-start; }
  .ep-thumb { width: 100%; }
}

/* ============================================================
   STREAMPROX — Sources multiples, commentaires, EPG, historique, PWA
   ============================================================ */

/* ---------- Sources multiples ---------- */
.source-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 10px 0; padding: 10px 14px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.source-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.source-btn {
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-3); color: var(--muted); font-size: 13px; font-weight: 600;
  transition: all .15s ease;
}
.source-btn:hover { color: var(--text); border-color: var(--muted); }
.source-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.embed-wrap { position: relative; aspect-ratio: 16 / 9; background: #000; }
.embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- EPG en direct (page watch) ---------- */
.epg-now {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 10px 0; padding: 12px 14px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.epg-chip { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 8px; background: var(--bg-3); }
.epg-chip.now { border-left: 3px solid var(--accent); }
.epg-chip small { color: var(--muted); font-size: 12px; }

/* ---------- Page EPG ---------- */
.epg-page .page-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 22px;
}
.epg-page .page-head h1 { font-size: 28px; }
.epg-select-form { display: flex; align-items: center; gap: 10px; }
.epg-select-form label { color: var(--muted); font-size: 14px; }
.epg-select-form select {
  padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text);
}
.epg-day { display: flex; flex-direction: column; gap: 8px; }
.epg-row {
  display: grid; grid-template-columns: 190px 1fr auto; gap: 14px; align-items: center;
  padding: 12px 16px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); transition: border-color .15s;
}
.epg-row.now { border-color: var(--accent); }
.epg-row.done { opacity: .55; }
.epg-time { font-size: 13.5px; font-weight: 700; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.epg-prog strong { font-size: 15px; }
.epg-prog p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.epg-prog .genre-badge { margin-left: 8px; }

@media (max-width: 760px) {
  .epg-row { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- Commentaires ---------- */
.comments-section { margin-top: 36px; }
.comment-avg { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 10px; }
.comment-avg .stars { color: #f5c518; }
.comment-avg small { color: var(--muted); }
.comment-form { margin: 14px 0 20px; }
.comment-form-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: start; }
.comment-form select, .comment-form textarea {
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); width: 100%;
}
.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comment-item {
  display: flex; gap: 12px; padding: 14px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.comment-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), #6e2b2b); font-weight: 800;
}
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.comment-stars { color: #f5c518; font-size: 13px; letter-spacing: 1px; }
.comment-text { margin-top: 6px; font-size: 14.5px; line-height: 1.5; }
.comment-delete {
  background: none; border: none; color: var(--muted); font-size: 15px;
  margin-left: auto; transition: color .15s;
}
.comment-delete:hover { color: #f87171; }

@media (max-width: 760px) {
  .comment-form-row { grid-template-columns: 1fr; }
}

/* ---------- Historique & statistiques ---------- */
.history-page .page-head { margin-bottom: 22px; }
.history-page .page-head h1 { font-size: 28px; }
.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px; margin-bottom: 22px;
}
.stat-card {
  display: flex; flex-direction: column; gap: 4px; padding: 18px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
}
.stat-emoji { font-size: 22px; }
.stat-card strong { font-size: 22px; }
.stat-card small { color: var(--muted); }

.activity-bars {
  display: flex; align-items: flex-end; gap: 14px; padding: 16px 18px 10px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 28px; min-height: 150px;
}
.activity-col { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.activity-bar {
  width: 100%; max-width: 46px; height: calc(var(--h) * 1.2px); min-height: 4px;
  background: linear-gradient(180deg, var(--accent), #7a1018); border-radius: 6px 6px 0 0;
}
.activity-col small { color: var(--muted); font-size: 12px; }

.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-item {
  display: flex; gap: 14px; padding: 12px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.history-thumb { width: 74px; height: 104px; border-radius: 8px; overflow: hidden; flex-shrink: 0; position: relative; background: var(--bg-3); }
.history-thumb img { width: 100%; height: 100%; object-fit: cover; }
.history-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.history-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.history-head strong { font-size: 15px; }
.history-bar { height: 6px; background: var(--bg-3); border-radius: 4px; overflow: hidden; }
.history-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }
.history-fill.done { background: var(--green); }
.history-actions { display: flex; align-items: center; gap: 10px; }
.history-actions form { margin: 0; }

@media (max-width: 760px) {
  .history-item { flex-direction: column; }
  .history-thumb { width: 100%; height: 150px; }
}

/* ---------- Admin : imports TMDB / sources / EPG ---------- */
.tmdb-results { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.tmdb-card {
  display: flex; gap: 14px; padding: 12px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.tmdb-card img { width: 90px; height: 135px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.tmdb-noposter {
  width: 90px; height: 135px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3); font-size: 30px;
}
.tmdb-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tmdb-info p { color: var(--muted); font-size: 13.5px; }
.tmdb-info form { margin-top: 6px; }

.warning-panel { border: 1px solid #b45309; background: rgba(180, 83, 9, .12); }

.upload-preview { width: 120px; border-radius: 8px; margin: 8px 0; border: 1px solid var(--border); }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }

.row-now td { background: rgba(229, 9, 20, .08); }

.form-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .form-grid.three { grid-template-columns: 1fr; } }

.admin-table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 14px; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.admin-table th { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; }

/* ---------- Dashboard ---------- */
.activity-bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; margin: 14px 0 6px; }
.activity-bars .bar { flex: 1; height: 100%; display: flex; align-items: flex-end; background: rgba(255,255,255,.04); border-radius: 3px; }
.activity-bars .bar div { width: 100%; background: linear-gradient(180deg, var(--accent), rgba(229,9,20,.35)); border-radius: 3px; min-height: 2px; }
.mini-comment { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.mini-comment:last-child { border-bottom: 0; }
.mini-comment p { color: var(--muted); font-size: 13px; }
.admin-actions .btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.text-danger { color: #ff6b6b; }

/* ---------- PWA ---------- */
@media (display-mode: standalone) {
  body { padding-top: 0; }
}
