/* ============================================================
   ChilliChips Play — Main Stylesheet
   Dark OTT theme with red accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ── Variables ───────────────────────────────────────────── */
:root {
  --bg-primary:   #0a0a0a;
  --bg-secondary: #141414;
  --bg-card:      #1a1a1a;
  --bg-hover:     #222222;
  --red:          #e50000;
  --red-hover:    #ff1a1a;
  --red-dark:     #b30000;
  --text:         #e5e5e5;
  --text-muted:   #999;
  --text-dim:     #666;
  --border:       #2a2a2a;
  --border-red:   rgba(229,0,0,0.3);
  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'Outfit', sans-serif;
  --radius:       8px;
  --shadow:       0 4px 24px rgba(0,0,0,0.6);
  --shadow-red:   0 4px 24px rgba(229,0,0,0.2);
  --transition:   0.2s ease;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--red); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--red-hover); }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: var(--font-body); }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--red-dark); border-radius: 3px; }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: linear-gradient(180deg, rgba(10,10,10,0.98) 0%, rgba(10,10,10,0.85) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 5%;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.navbar-brand {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 1px;
  color: #fff;
}
.navbar-brand span { color: var(--red); }
.navbar-links { display: flex; align-items: center; gap: 24px; }
.navbar-links a {
  color: var(--text-muted); font-size: 0.9rem; font-weight: 500;
  transition: color var(--transition);
}
.navbar-links a:hover, .navbar-links a.active { color: #fff; }
.navbar-auth { display: flex; gap: 12px; align-items: center; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  border: none; transition: all var(--transition); text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-hover); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-red); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--text-muted); color: #fff; }
.btn-ghost { background: rgba(255,255,255,0.08); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,0.15); color: #fff; }
.btn-danger { background: #8b0000; color: #fff; }
.btn-danger:hover { background: #c00; }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  position: relative;
  height: 56vw;
  max-height: 600px;
  min-height: 320px;
  display: flex; align-items: flex-end;
  padding: 4% 5% 40px;
  overflow: hidden;
  background-size: cover;
  background-position: center top;
}
.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a0000 50%, #0a0a0a 100%);
  z-index: 0;
}
.hero-bg::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 60% 40%, rgba(229,0,0,0.15) 0%, transparent 70%);
}
.hero-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0.1) 100%);
  z-index: 1;
}
.hero-content { position: relative; z-index: 2; max-width: 600px; }
.hero-badge {
  display: inline-block;
  background: var(--red); color: #fff;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 4px 12px; border-radius: 4px;
  margin-bottom: 12px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 4rem);
  line-height: 1.1; letter-spacing: 1px;
  color: #fff; margin-bottom: 10px;
}
.hero-desc {
  color: var(--text-muted); font-size: 0.95rem; max-width: 480px;
  margin-bottom: 20px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Section Headers ─────────────────────────────────────── */
.section { padding: 32px 5%; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem; letter-spacing: 0.5px; color: #fff;
}
.section-title span { color: var(--red); }

/* ── Video Grid ──────────────────────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.video-card {
  position: relative; border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  background: var(--bg-card);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  aspect-ratio: 16/9;
}
.video-card:hover { transform: scale(1.03); box-shadow: 0 8px 32px rgba(229,0,0,0.25); }
.video-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: opacity var(--transition);
}
.video-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, transparent 60%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px;
  opacity: 0; transition: opacity var(--transition);
}
.video-card:hover .video-card-overlay { opacity: 1; }
.video-card-title { font-size: 0.875rem; font-weight: 600; color: #fff; }
.video-card-cat {
  font-size: 0.72rem; color: var(--red); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 4px;
}
.video-card-lock {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.7); border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
}

/* ── Thumbnail placeholder ───────────────────────────────── */
.thumb-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #1a0000 0%, #2a0000 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--red-dark);
}

/* ── Auth Forms ──────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(ellipse at center, #1a0000 0%, #0a0a0a 70%);
}
.auth-box {
  width: 100%; max-width: 440px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 40px;
  box-shadow: var(--shadow);
}
.auth-logo {
  text-align: center;
  font-family: var(--font-display);
  font-size: 2rem; color: #fff; margin-bottom: 8px;
}
.auth-logo span { color: var(--red); }
.auth-subtitle {
  text-align: center; color: var(--text-muted);
  font-size: 0.9rem; margin-bottom: 32px;
}
.auth-title {
  font-size: 1.5rem; font-weight: 700; color: #fff;
  margin-bottom: 24px; text-align: center;
}

/* ── Form Elements ───────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 0.85rem; font-weight: 500;
  color: var(--text-muted); margin-bottom: 8px;
}
.form-control {
  width: 100%; padding: 12px 16px;
  background: var(--bg-card); color: #fff;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.95rem; transition: border-color var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--red); }
.form-control::placeholder { color: var(--text-dim); }
.form-control.error { border-color: #ff4444; }
.form-error { color: #ff6666; font-size: 0.8rem; margin-top: 4px; }
.form-hint { color: var(--text-dim); font-size: 0.8rem; margin-top: 4px; }
select.form-control { appearance: none; cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ── OTP Input ───────────────────────────────────────────── */
.otp-inputs { display: flex; gap: 10px; justify-content: center; margin: 24px 0; }
.otp-input {
  width: 52px; height: 60px; text-align: center;
  font-size: 1.5rem; font-weight: 700;
  background: var(--bg-card); color: #fff;
  border: 2px solid var(--border); border-radius: var(--radius);
  outline: none; transition: border-color var(--transition);
}
.otp-input:focus { border-color: var(--red); }

/* ── Subscription Banner ─────────────────────────────────── */
.sub-banner {
  background: linear-gradient(135deg, #1a0000 0%, #0a0000 100%);
  border: 1px solid var(--border-red);
  border-radius: 16px; padding: 32px;
  text-align: center; margin: 24px 5%;
}
.sub-banner-price {
  font-family: var(--font-display);
  font-size: 3rem; color: var(--red); line-height: 1;
}
.sub-banner-period { color: var(--text-muted); font-size: 1rem; margin-bottom: 20px; }
.sub-features {
  list-style: none; margin-bottom: 24px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px;
}
.sub-features li { color: var(--text-muted); font-size: 0.875rem; }
.sub-features li::before { content: '✓ '; color: var(--red); }

/* ── Flash Messages ──────────────────────────────────────── */
.flash {
  padding: 14px 20px; border-radius: var(--radius);
  margin-bottom: 20px; font-size: 0.9rem; font-weight: 500;
}
.flash-success { background: rgba(0,200,80,0.12); border: 1px solid rgba(0,200,80,0.3); color: #4ade80; }
.flash-error   { background: rgba(229,0,0,0.12);  border: 1px solid rgba(229,0,0,0.3);  color: #ff6666; }

/* ── Video Player ────────────────────────────────────────── */
.watch-page { padding: 24px 5% 40px; }
.video-player-wrap {
  position: relative; width: 100%;
  padding-top: 56.25%;
  background: #000; border-radius: var(--radius); overflow: hidden;
  margin-bottom: 20px; border: 1px solid var(--border);
}
.video-player-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: none;
}
.video-meta { margin-bottom: 24px; }
.video-meta-title {
  font-family: var(--font-display);
  font-size: 1.8rem; color: #fff; letter-spacing: 0.5px; margin-bottom: 8px;
}
.video-meta-info {
  display: flex; gap: 16px; color: var(--text-muted);
  font-size: 0.85rem; align-items: center; flex-wrap: wrap; margin-bottom: 12px;
}
.video-meta-cat {
  background: var(--red); color: #fff;
  padding: 2px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: 600;
}
.video-meta-desc { color: var(--text-muted); line-height: 1.8; }
.related-title {
  font-family: var(--font-display);
  font-size: 1.3rem; color: #fff; margin-bottom: 14px;
}

/* ── Admin Panel ─────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 0; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
}
.admin-sidebar-logo {
  padding: 24px 20px;
  font-family: var(--font-display);
  font-size: 1.4rem; color: #fff;
  border-bottom: 1px solid var(--border);
}
.admin-sidebar-logo span { color: var(--red); }
.admin-nav { padding: 16px 0; flex: 1; }
.admin-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; color: var(--text-muted);
  font-size: 0.9rem; font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.admin-nav a:hover, .admin-nav a.active {
  color: #fff; background: rgba(229,0,0,0.08);
  border-left-color: var(--red);
}
.admin-nav a .icon { font-size: 1.1rem; width: 20px; text-align: center; }
.admin-main { flex: 1; padding: 32px; overflow-x: auto; }
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 32px;
}
.admin-page-title {
  font-family: var(--font-display);
  font-size: 2rem; color: #fff; letter-spacing: 0.5px;
}

/* ── Stats Cards ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 24px; position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  right: 0; height: 3px; background: var(--red);
}
.stat-label { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.stat-value { font-family: var(--font-display); font-size: 2.2rem; color: #fff; line-height: 1; }
.stat-icon { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 2.5rem; opacity: 0.08; }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--bg-secondary); color: var(--text-muted);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px;
  padding: 14px 16px; text-align: left; font-weight: 600;
}
td { padding: 14px 16px; color: var(--text); font-size: 0.9rem; border-top: 1px solid var(--border); }
tr:hover td { background: var(--bg-hover); }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.5px;
}
.badge-green  { background: rgba(0,200,80,0.15); color: #4ade80; }
.badge-red    { background: rgba(229,0,0,0.15);  color: #ff6666; }
.badge-yellow { background: rgba(255,200,0,0.15); color: #fbbf24; }
.badge-gray   { background: rgba(150,150,150,0.15); color: #aaa; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; margin-top: 20px; justify-content: center; }
.page-btn {
  padding: 8px 14px; border-radius: 6px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.85rem; cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover, .page-btn.active {
  background: var(--red); border-color: var(--red); color: #fff;
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  z-index: 2000; display: none;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px;
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-title { font-size: 1.2rem; font-weight: 700; color: #fff; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; line-height: 1; }
.modal-close:hover { color: #fff; }

/* ── Footer ──────────────────────────────────────────────── */
footer {
  background: var(--bg-secondary); border-top: 1px solid var(--border);
  padding: 40px 5% 24px;
  margin-top: 60px;
}
.footer-top {
  display: flex; gap: 40px; flex-wrap: wrap;
  padding-bottom: 32px; border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.footer-brand { flex: 0 0 220px; }
.footer-brand-name {
  font-family: var(--font-display); font-size: 1.6rem; color: #fff; margin-bottom: 10px;
}
.footer-brand-name span { color: var(--red); }
.footer-brand p { color: var(--text-dim); font-size: 0.85rem; line-height: 1.7; }
.footer-links h4 { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.footer-links a { display: block; color: var(--text-dim); font-size: 0.85rem; margin-bottom: 8px; transition: color var(--transition); }
.footer-links a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-bottom p { color: var(--text-dim); font-size: 0.8rem; }

/* ── About Page ──────────────────────────────────────────── */
.page-hero {
  text-align: center; padding: 60px 5% 40px;
  background: linear-gradient(180deg, rgba(229,0,0,0.05) 0%, transparent 100%);
}
.page-hero h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.5rem); color: #fff; margin-bottom: 16px; }
.page-hero p { color: var(--text-muted); max-width: 600px; margin: 0 auto; line-height: 1.8; }
.content-section { padding: 40px 5%; max-width: 900px; margin: 0 auto; }
.content-section h2 { font-family: var(--font-display); font-size: 1.8rem; color: #fff; margin-bottom: 16px; }
.content-section p { color: var(--text-muted); line-height: 1.8; margin-bottom: 16px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 32px; }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px;
}
.feature-icon { font-size: 2rem; margin-bottom: 12px; }
.feature-card h3 { color: #fff; font-size: 1rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: 0.875rem; margin: 0; }

/* ── Profile Page ────────────────────────────────────────── */
.profile-page { padding: 40px 5%; max-width: 700px; margin: 0 auto; }
.profile-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; margin-bottom: 24px;
}
.profile-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--red); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.8rem; color: #fff; flex-shrink: 0;
}
.profile-name { font-size: 1.3rem; font-weight: 700; color: #fff; }
.profile-email { color: var(--text-muted); font-size: 0.9rem; }
.sub-status-card {
  background: var(--bg-secondary); border-radius: 10px; padding: 20px;
  border: 1px solid var(--border-red);
}
.sub-active { color: #4ade80; font-weight: 600; }
.sub-inactive { color: #ff6666; font-weight: 600; }

/* ── Loader ──────────────────────────────────────────────── */
.spinner {
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%; width: 24px; height: 24px;
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utilities ───────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-red    { color: var(--red); }
.mt-8  { margin-top:  8px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom:  8px; } .mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0 4%; }
  .navbar-links { display: none; }
  .navbar-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--bg-secondary); border-bottom: 1px solid var(--border);
    padding: 20px 5%; z-index: 999;
  }
  .mobile-menu-btn { display: block; background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; }

  /* ── Mobile Hero ── */
  .hero {
    height: 56vw;
    min-height: 260px;
    max-height: 380px;
    padding: 4% 4% 24px;
  }
  .hero-title { font-size: clamp(1.4rem, 6vw, 2.2rem); margin-bottom: 8px; }
  .hero-desc { display: none; }
  .hero-actions .btn { padding: 10px 18px; font-size: 0.85rem; }
  .btn-lg { padding: 10px 20px; font-size: 0.875rem; }

  /* ── Mobile Grid ── */
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .section { padding: 20px 4%; }
  .section-title { font-size: 1.1rem; }

  /* ── Mobile Sub Banner ── */
  .sub-banner { padding: 24px 16px; margin: 16px 4%; }
  .sub-banner-price { font-size: 2.2rem; }

  /* ── Mobile Auth ── */
  .auth-box { padding: 28px 20px; }

  /* ── Mobile Admin ── */
  .admin-sidebar { display: none; }
  .admin-layout { flex-direction: column; }
  .admin-main { padding: 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── Mobile Footer ── */
  .footer-top { flex-direction: column; gap: 24px; }
}
@media (min-width: 769px) {
  .mobile-menu-btn { display: none; }
}