/* ==========================================================================
   ReloadTV — dark cinematic OTT theme
   ========================================================================== */
:root {
  --bg: #080808;
  --bg-2: #111111;
  --card: #181818;
  --card-2: #202020;
  --border: #262626;
  --text: #f5f5f5;
  --text-muted: #a1a1a1;
  --text-dim: #6f6f6f;
  --accent: #e50914;
  --accent-hover: #ff1f2b;
  --accent-dim: rgba(229, 9, 20, 0.15);
  --gold: #f5c518;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  --header-h: 64px;
  --maxw: 1360px;
  --ease: 0.2s ease;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: 0;
}
body.has-bottom-nav { padding-bottom: 64px; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 .5rem; font-weight: 700; line-height: 1.2; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.4rem; border-radius: var(--radius); border: none;
  font-weight: 600; font-size: .95rem; transition: background var(--ease), transform var(--ease), opacity var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-light { background: #fff; color: #111; }
.btn-light:hover { background: #e6e6e6; }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; backdrop-filter: blur(4px); }
.btn-ghost:hover { background: rgba(255,255,255,.22); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--text-muted); }
.btn-block { width: 100%; }
.btn-lg { padding: .85rem 1.8rem; font-size: 1.05rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---- Badges ---- */
.badge {
  display: inline-block; padding: .2rem .55rem; border-radius: 5px;
  font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.badge-free { background: #1f6f43; color: #d6ffe6; }
.badge-premium { background: var(--accent); color: #fff; }
.badge-quality { background: rgba(0,0,0,.7); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.badge-rating { background: rgba(0,0,0,.6); color: var(--gold); font-weight: 700; }

/* ==========================================================================
   Header / navigation
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  display: flex; align-items: center;
  background: linear-gradient(to bottom, rgba(8,8,8,.96), rgba(8,8,8,.7));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.site-header .container { display: flex; align-items: center; gap: 1.5rem; width: 100%; }
.logo { font-size: 1.5rem; font-weight: 900; letter-spacing: -.02em; color: #fff; display: flex; align-items: center; }
.logo b { color: var(--accent); }
.nav-links { display: flex; gap: 1.4rem; align-items: center; margin-left: 1rem; }
.nav-links a { color: var(--text-muted); font-size: .95rem; font-weight: 500; transition: color var(--ease); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: .8rem; }
.icon-btn {
  background: transparent; border: none; color: var(--text-muted);
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background var(--ease), color var(--ease);
}
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
}
.hamburger { display: none; }

/* Header search overlay */
.header-search { position: relative; }
.header-search-form { display: flex; align-items: center; }
.header-search-form input {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  padding: .5rem .9rem; border-radius: 20px; width: 0; opacity: 0; transition: width var(--ease), opacity var(--ease);
  pointer-events: none;
}
.header-search.open input { width: 200px; opacity: 1; pointer-events: auto; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .4rem; display: none; z-index: 120;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
  padding: .6rem .8rem; border-radius: 7px; color: var(--text-muted); background: none; border: none; font-size: .9rem;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--card-2); color: #fff; }
.dropdown-menu hr { border: none; border-top: 1px solid var(--border); margin: .3rem 0; }

/* Mobile menu drawer */
.mobile-menu {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.6);
  display: none;
}
.mobile-menu.open { display: block; }
.mobile-menu-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(78vw, 320px);
  background: var(--bg-2); border-left: 1px solid var(--border); padding: 1.5rem;
  display: flex; flex-direction: column; gap: .4rem;
}
.mobile-menu-panel a {
  padding: .9rem .4rem; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 500;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; height: clamp(420px, 70vh, 680px); overflow: hidden; }
.hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; z-index: 1;
  background-size: cover; background-position: center top;
}
.hero-slide.active { opacity: 1; z-index: 2; }
.hero-slide::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg) 4%, rgba(8,8,8,.5) 45%, rgba(8,8,8,.15) 100%),
    linear-gradient(to right, rgba(8,8,8,.9) 0%, rgba(8,8,8,.35) 55%, transparent 100%);
}
.hero-content {
  position: absolute; z-index: 3; bottom: clamp(48px, 12vh, 120px);
  max-width: 640px; padding: 0 clamp(16px, 4vw, 48px);
}
.hero-title { font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 900; letter-spacing: -.02em; text-shadow: 0 2px 20px rgba(0,0,0,.6); }
.hero-meta { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; color: var(--text-muted); font-size: .9rem; margin-bottom: .8rem; }
.hero-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-dim); }
.hero-desc { color: #d5d5d5; font-size: 1.02rem; margin-bottom: 1.4rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-dots { position: absolute; z-index: 4; bottom: 20px; right: clamp(16px, 4vw, 48px); display: flex; gap: .5rem; }
.hero-dots button { width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255,255,255,.4); padding: 0; }
.hero-dots button.active { background: var(--accent); width: 22px; border-radius: 5px; }

/* ==========================================================================
   Content rows & cards
   ========================================================================== */
.section { padding: 1.6rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .9rem; }
.section-head h2 { font-size: 1.25rem; margin: 0; }
.section-head a { color: var(--text-muted); font-size: .85rem; }
.section-head a:hover { color: var(--accent); }

.row-scroll {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(140px, 20vw, 200px);
  gap: 12px; overflow-x: auto; scroll-behavior: smooth; padding-bottom: .5rem;
  scrollbar-width: none;
}
.row-scroll::-webkit-scrollbar { display: none; }

.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px)  { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(6, 1fr); } }

/* Card */
.card { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--card); transition: transform var(--ease), box-shadow var(--ease); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-poster { position: relative; aspect-ratio: 2/3; background: var(--card-2); overflow: hidden; }
.card-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.card:hover .card-poster img { transform: scale(1.06); }
.card-badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; z-index: 2; }
.card-badges-right { position: absolute; top: 8px; right: 8px; z-index: 2; }
.card-body { padding: .55rem .6rem .7rem; }
.card-title { font-size: .9rem; font-weight: 600; margin: 0 0 .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: .75rem; color: var(--text-dim); display: flex; gap: .5rem; }

/* Hover overlay (desktop) */
.card-hover {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column;
  justify-content: flex-end; padding: .7rem; opacity: 0; transition: opacity var(--ease);
  background: linear-gradient(to top, rgba(0,0,0,.9), rgba(0,0,0,.2) 60%, transparent);
}
.card:hover .card-hover { opacity: 1; }
.card-hover .hover-actions { display: flex; gap: .5rem; margin-top: .5rem; }
.card-hover .hover-actions button, .card-hover .hover-actions a {
  width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.4); color: #fff;
}
.card-hover .hover-actions .play { background: #fff; color: #111; border-color: #fff; }
@media (hover: none) { .card-hover { display: none; } }

/* Progress bar on continue-watching cards */
.card-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background: rgba(255,255,255,.2); z-index: 3; }
.card-progress > span { display: block; height: 100%; background: var(--accent); }
.card.landscape .card-poster { aspect-ratio: 16/9; }

/* ==========================================================================
   Detail pages
   ========================================================================== */
.detail-hero { position: relative; }
.detail-backdrop { position: relative; height: clamp(340px, 60vh, 560px); background-size: cover; background-position: center; }
.detail-backdrop::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg), rgba(8,8,8,.4) 60%, rgba(8,8,8,.5)); }
.detail-body { position: relative; z-index: 2; margin-top: -180px; }
.detail-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; }
.detail-poster { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 2/3; background: var(--card); }
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-info h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); }
.detail-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; color: var(--text-muted); margin-bottom: 1rem; font-size: .92rem; }
.detail-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.2rem 0; }
.detail-desc { color: #d0d0d0; max-width: 720px; margin-bottom: 1rem; }
.detail-facts { color: var(--text-muted); font-size: .9rem; }
.detail-facts b { color: var(--text); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0; }
.chip { background: var(--card); border: 1px solid var(--border); padding: .3rem .8rem; border-radius: 20px; font-size: .82rem; color: var(--text-muted); }
.chip:hover { color: #fff; border-color: var(--text-muted); }
@media (max-width: 720px) {
  .detail-body { margin-top: -120px; }
  .detail-layout { grid-template-columns: 120px 1fr; gap: 1rem; }
}

/* Seasons / episodes */
.season-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; }
.season-tabs button { background: var(--card); border: 1px solid var(--border); color: var(--text-muted); padding: .5rem 1rem; border-radius: 8px; }
.season-tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.episode { display: flex; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--border); align-items: center; }
.episode-thumb { position: relative; width: 160px; flex-shrink: 0; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: var(--card-2); }
.episode-thumb img { width: 100%; height: 100%; object-fit: cover; }
.episode-num { font-size: 1.3rem; font-weight: 800; color: var(--text-dim); width: 32px; text-align: center; flex-shrink: 0; }
.episode-info { flex: 1; min-width: 0; }
.episode-info h4 { margin: 0 0 .2rem; font-size: 1rem; }
.episode-info p { margin: 0; color: var(--text-muted); font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.episode-play { flex-shrink: 0; }
@media (max-width: 640px) {
  .episode-thumb { width: 120px; }
  .episode-num { display: none; }
}

/* ==========================================================================
   Watch / player
   ========================================================================== */
.player-page { background: #000; min-height: 100vh; }
.player-wrap { max-width: 1200px; margin: 0 auto; padding: 1rem clamp(12px, 3vw, 24px); }
.player-shell { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; }
.player-shell video { width: 100%; height: 100%; background: #000; }
.player-back { display: inline-flex; align-items: center; gap: .5rem; color: var(--text-muted); margin: 1rem 0; }
.player-back:hover { color: #fff; }
.player-title { margin-top: 1rem; }
.player-message {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2rem; gap: 1rem; background: var(--bg-2);
}

/* ==========================================================================
   Forms / auth
   ========================================================================== */
.auth-wrap { max-width: 420px; margin: 3rem auto; padding: 2rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.auth-wrap h1 { text-align: center; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; color: var(--text-muted); margin-bottom: .35rem; }
.form-control {
  width: 100%; padding: .75rem .9rem; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: .95rem; transition: border-color var(--ease);
}
.form-control:focus { outline: none; border-color: var(--accent); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1a1' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2rem; }
.form-hint { font-size: .8rem; color: var(--text-dim); margin-top: .3rem; }
.auth-alt { text-align: center; margin-top: 1.2rem; color: var(--text-muted); font-size: .9rem; }
.auth-alt a { color: var(--accent); }

/* Alerts */
.alert { padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.alert-error { background: rgba(229,9,20,.12); border: 1px solid rgba(229,9,20,.4); color: #ffb3b8; }
.alert-success { background: rgba(31,111,67,.15); border: 1px solid rgba(31,111,67,.5); color: #b6ffcf; }
.alert-info { background: rgba(255,255,255,.06); border: 1px solid var(--border); color: var(--text-muted); }

/* ==========================================================================
   Filters bar
   ========================================================================== */
.page-head { padding: 1.5rem 0 .5rem; }
.page-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; align-items: center; }
.filters .form-control { width: auto; min-width: 120px; padding: .5rem .8rem; }
.filters .search-input { flex: 1; min-width: 160px; }

/* ==========================================================================
   Subscription / plans
   ========================================================================== */
.plans { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 2rem 0; }
.plan {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.8rem 1.5rem; display: flex; flex-direction: column; position: relative;
}
.plan.popular { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; padding: .2rem .8rem; border-radius: 20px; font-size: .72rem; font-weight: 700; }
.plan h3 { font-size: 1.2rem; }
.plan-price { font-size: 2.2rem; font-weight: 900; margin: .5rem 0; }
.plan-price small { font-size: .9rem; font-weight: 500; color: var(--text-muted); }
.plan ul { list-style: none; padding: 0; margin: 1rem 0; color: var(--text-muted); font-size: .9rem; }
.plan ul li { padding: .35rem 0; display: flex; gap: .5rem; align-items: center; }
.plan .btn { margin-top: auto; }

/* ==========================================================================
   Profile
   ========================================================================== */
.profile-grid { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; margin: 2rem 0; }
.profile-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 800; margin-bottom: 1rem; }
@media (max-width: 800px) { .profile-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Empty / error states
   ========================================================================== */
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--text-muted); }
.empty-state svg { color: var(--text-dim); margin-bottom: 1rem; }
.empty-state h3 { color: var(--text); }

/* Skeleton loaders */
.skeleton { background: linear-gradient(90deg, var(--card) 25%, var(--card-2) 50%, var(--card) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); }
.skeleton-card { aspect-ratio: 2/3; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--border); margin-top: 3rem; padding: 2.5rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-grid h4 { font-size: .95rem; margin-bottom: .8rem; }
.footer-grid a { display: block; color: var(--text-muted); font-size: .88rem; padding: .25rem 0; }
.footer-grid a:hover { color: #fff; }
.footer-social { display: flex; gap: .8rem; margin-top: .8rem; }
.footer-social a { width: 38px; height: 38px; border-radius: 50%; background: var(--card); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.footer-social a:hover { background: var(--accent); color: #fff; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.2rem; text-align: center; color: var(--text-dim); font-size: .82rem; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; } }

/* ==========================================================================
   Bottom navigation (mobile)
   ========================================================================== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90; height: 64px;
  background: rgba(17,17,17,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--border);
  display: none; grid-template-columns: repeat(5, 1fr);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-dim); font-size: .68rem; }
.bottom-nav a.active { color: var(--accent); }

/* Legal / static content */
.prose { max-width: 800px; margin: 2rem auto; }
.prose h1 { font-size: 2rem; margin-bottom: 1rem; }
.prose h2 { font-size: 1.3rem; margin-top: 2rem; }
.prose p, .prose li { color: #cfcfcf; }
.prose a { color: var(--accent); }

/* Utilities */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; } .items-center { align-items: center; } .gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.hidden { display: none !important; }

/* ==========================================================================
   Responsive header
   ========================================================================== */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hamburger { display: inline-flex; }
  .bottom-nav { display: grid; }
  .header-search.open input { width: 150px; }
}

/* Pagination */
.pagination { display: flex; gap: .4rem; justify-content: center; margin: 2rem 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: .5rem .9rem; border-radius: 8px; background: var(--card); border: 1px solid var(--border); color: var(--text-muted); font-size: .9rem;
}
.pagination a:hover { border-color: var(--text-muted); color: #fff; }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* Poster card hover: no dark overlay */
.card:hover .card-hover { opacity: 0; }
