/* ============================================================
   main.css – VOD Premium Platform
   Mobile-first, CSS custom properties, red/black theme
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette */
  --bg:          #0F0F0F;
  --bg-card:     #1A1A1A;
  --bg-input:    #222222;
  --accent:      #E50914;
  --accent-dark: #B20610;
  --text:        #F0F0F0;
  --text-muted:  #888888;
  --border:      #2E2E2E;
  --success:     #2ECC71;
  --warning:     #F39C12;
  --error:       #E74C3C;

  /* Spacing */
  --gap:   1rem;
  --gap-sm: .5rem;
  --radius: 6px;
  --radius-lg: 12px;

  /* Typography */
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Consolas', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Utility ─────────────────────────────────────────────── */
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gap); }
.mt-1 { margin-top: var(--gap-sm); }
.mt-2 { margin-top: var(--gap); }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: var(--gap-sm); }
.mb-2 { margin-bottom: var(--gap); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap { gap: var(--gap); }
.w-full { width: 100%; }
.hidden { display: none !important; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-premium { background: var(--accent); color: #fff; }
.badge-pending  { background: var(--warning); color: #000; }
.badge-approved { background: var(--success); color: #000; }
.badge-rejected { background: var(--error); color: #fff; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: var(--gap);
  font-size: .9rem;
}
.alert-success { background: rgba(46,204,113,.15); border: 1px solid var(--success); color: var(--success); }
.alert-error   { background: rgba(231,76,60,.15);  border: 1px solid var(--error);   color: var(--error);   }
.alert-info    { background: rgba(229,9,20,.1);    border: 1px solid var(--accent);  color: var(--accent);  }

/* ── Header / Navbar ─────────────────────────────────────── */
.navbar {
  background: #050505;
  border-bottom: 2px solid var(--accent);
  padding: .6rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}
.navbar-logo {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -1px;
}
.navbar-logo span { color: var(--accent); }
.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  list-style: none;
  flex-wrap: wrap;
}
.navbar-nav a {
  color: var(--text-muted);
  font-size: .875rem;
  padding: .3rem .6rem;
  border-radius: var(--radius);
  transition: color .2s, background .2s;
}
.navbar-nav a:hover,
.navbar-nav a.active { color: var(--text); background: var(--bg-card); text-decoration: none; }
.btn-nav-upload {
  background: var(--accent);
  color: #fff !important;
  padding: .35rem .9rem !important;
  border-radius: var(--radius) !important;
}
.btn-nav-upload:hover { background: var(--accent-dark) !important; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.2rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .2s, opacity .2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline  { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger   { background: var(--error); color: #fff; }
.btn-danger:hover { opacity: .85; }
.btn-success  { background: var(--success); color: #000; }
.btn-sm       { padding: .35rem .8rem; font-size: .8rem; }
.btn-block    { width: 100%; justify-content: center; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; margin-bottom: .3rem; font-size: .875rem; color: var(--text-muted); }
.form-control {
  width: 100%;
  padding: .65rem .9rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color .2s;
}
.form-control:focus { border-color: var(--accent); }
textarea.form-control { min-height: 100px; resize: vertical; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .25rem; }
.form-check { display: flex; align-items: flex-start; gap: .5rem; cursor: pointer; }
.form-check input[type="checkbox"] { margin-top: .2rem; accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-body { padding: 1.25rem; }
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }

/* ── Video Grid / Carousel ───────────────────────────────── */
.section-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.2em;
  background: var(--accent);
  border-radius: 2px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--gap);
}

.video-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform .2s, border-color .2s;
  cursor: pointer;
  display: block;
  color: inherit;
}
.video-card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }

.video-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
}
.video-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.video-card:hover .video-thumb-wrap img { transform: scale(1.04); }
.video-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
}
.video-card:hover .video-thumb-overlay { opacity: 1; }
.play-icon {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.play-icon svg { fill: #fff; margin-left: 3px; }

.video-duration {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(0,0,0,.8);
  color: #fff;
  font-size: .72rem;
  padding: 1px 5px;
  border-radius: 3px;
}
.video-premium-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--accent);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.video-card-body {
  padding: .75rem;
}
.video-card-title {
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: .3rem;
  display: -webkit-box;
  /* stylelint-disable-next-line property-no-vendor-prefix */
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.video-card-meta {
  font-size: .75rem;
  color: var(--text-muted);
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

/* Carousel scroll */
.carousel-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-card);
  padding-bottom: .5rem;
}
.carousel-wrap::-webkit-scrollbar { height: 4px; }
.carousel-wrap::-webkit-scrollbar-track { background: var(--bg-card); }
.carousel-wrap::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }
.carousel-inner {
  display: flex;
  gap: var(--gap);
  width: max-content;
}
.carousel-inner .video-card { width: 220px; flex-shrink: 0; }

/* ── Video Player ────────────────────────────────────────── */
.player-section { background: #000; }
.player-wrapper {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
}
.player-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Comments ────────────────────────────────────────────── */
.comments-section { padding: 1.5rem 0; }
.comment-list { list-style: none; }
.comment-item {
  padding: .9rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: .75rem;
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  color: #fff;
}
.comment-author { font-weight: 700; font-size: .85rem; }
.comment-text   { font-size: .9rem; margin: .2rem 0; white-space: pre-line; }
.comment-date   { font-size: .75rem; color: var(--text-muted); }
.comment-reply-btn { font-size: .75rem; color: var(--accent); cursor: pointer; background: none; border: none; padding: 0; margin-left: .5rem; }
.comment-replies { margin-left: 2.5rem; }

/* ── Profile ─────────────────────────────────────────────── */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 0 1rem;
  flex-wrap: wrap;
}
.profile-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--gap);
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
}
.stat-value { font-size: 1.8rem; font-weight: 900; color: var(--accent); }
.stat-label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead tr { background: var(--bg-card); }
th { padding: .75rem 1rem; text-align: left; color: var(--text-muted); font-weight: 600; border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ── Upload form ─────────────────────────────────────────── */
.upload-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s;
}
.upload-dropzone:hover,
.upload-dropzone.dragover { border-color: var(--accent); }
.upload-dropzone svg { opacity: .4; margin: 0 auto .5rem; }
.progress-bar-wrap {
  background: var(--bg-card);
  border-radius: 20px;
  overflow: hidden;
  height: 8px;
  margin-top: .5rem;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 20px;
  width: 0;
  transition: width .3s;
}

/* ── Age gate ────────────────────────────────────────────── */
.age-gate-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 1rem;
}
.age-gate-box {
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
}
.age-gate-box h1 { font-size: 2rem; color: var(--accent); }
.age-gate-box p { color: var(--text-muted); font-size: .9rem; margin: .75rem 0; }

/* ── Auth pages ──────────────────────────────────────────── */
.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  width: 100%;
  max-width: 420px;
}
.auth-box h2 { margin-bottom: 1.5rem; font-size: 1.4rem; }

/* ── Legal pages ─────────────────────────────────────────── */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem var(--gap);
  line-height: 1.8;
}
.legal-content h1 { font-size: 1.8rem; margin-bottom: 1rem; color: var(--accent); }
.legal-content h2 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; color: var(--text); }
.legal-content p, .legal-content li { font-size: .9rem; color: var(--text-muted); }
.legal-content ul { padding-left: 1.5rem; margin: .5rem 0; }

/* ── Footer ──────────────────────────────────────────────── */
footer {
  background: #050505;
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  text-align: center;
}
.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a { color: var(--text-muted); font-size: .8rem; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { color: var(--text-muted); font-size: .75rem; }

/* ── Admin ───────────────────────────────────────────────── */
.admin-badge {
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: .4rem;
}

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1.5rem;
}
.pagination a, .pagination span {
  padding: .4rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .85rem;
  color: var(--text-muted);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Responsive tweaks ───────────────────────────────────── */
@media (max-width: 768px) {
  .navbar-logo { font-size: 1.1rem; }
  .navbar-nav { gap: .25rem; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .profile-header { gap: 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-box { padding: 1.5rem 1rem; }
}
@media (max-width: 480px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .section-title { font-size: 1rem; }
}
