/* ============================================================
   BB Dashcam – Haupt-CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

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

:root {
  --bg:        #090d14;
  --surface:   #0f1520;
  --surface2:  #141d2a;
  --border:    #1c2a3a;
  --border2:   #243040;
  --text:      #e8edf2;
  --muted:     #5a6a7a;
  --muted2:    #3a4a5a;
  --accent:    #4a8fd4;
  --accent2:   #e03333;
  --gold:      #f0c020;
  --green:     #2ecc71;
  --orange:    #f39c12;
  --red:       #e03333;
  --font-head: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --max:       1140px;
  --r:         8px;
  --r-lg:      14px;
}

html { scroll-behavior: smooth; }

body {
  background:  var(--bg);
  color:       var(--text);
  font-family: var(--font-body);
  font-size:   15px;
  line-height: 1.65;
  min-height:  100vh;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

img { max-width: 100%; height: auto; }
a   { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--text); }

/* ── TYPOGRAPHY ─────────────────────────────────────────── */
h1,h2,h3,h4 { font-family: var(--font-head); letter-spacing: .04em; color: #fff; line-height: 1; }
h1 { font-size: clamp(2.8rem, 6vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: .5rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.2rem; }
p  { color: var(--muted); line-height: 1.7; }

/* ── LAYOUT ──────────────────────────────────────────────── */
.container { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.section    { padding: 80px 1.5rem; }
.section-sm { padding: 48px 1.5rem; }
.section-label {
  font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .5rem;
  display: flex; align-items: center; gap: .5rem;
}
.section-label::before { content: ''; width: 20px; height: 1px; background: var(--accent); }

/* ── NAV ─────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 62px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  background: rgba(9,13,20,.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: var(--font-head); font-size: 1.6rem;
  letter-spacing: .12em; color: #fff; text-decoration: none;
  display: flex; align-items: center; gap: .4rem;
}
.rec-dot {
  width: 7px; height: 7px; background: var(--accent2);
  border-radius: 50%; animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.15} }

.nav-links { display: flex; gap: 1.8rem; list-style: none; }
.nav-links a {
  color: var(--muted); font-size: .82rem; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase; transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-user {
  font-size: .82rem; color: var(--muted);
  display: flex; align-items: center; gap: .5rem;
}
.nav-user strong { color: var(--text); }

.nav-social { display: flex; gap: .8rem; }
.nav-social a { color: var(--muted); display: flex; align-items: center; transition: color .2s; }
.nav-social a:hover { color: var(--accent); }
.nav-social svg { width: 17px; height: 17px; fill: currentColor; }

/* Mobile Nav Toggle */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--muted); }
.nav-toggle svg { width: 22px; height: 22px; fill: currentColor; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.5rem; border-radius: var(--r);
  font-family: var(--font-body); font-weight: 500; font-size: .875rem;
  cursor: pointer; border: none; transition: all .2s; text-decoration: none;
  white-space: nowrap;
}
.btn-primary   { background: var(--accent2); color: #fff; }
.btn-primary:hover { background: #c82020; color: #fff; transform: translateY(-1px); }
.btn-accent    { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #3a7fc4; color: #fff; }
.btn-outline   { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost     { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border2); }
.btn-danger    { background: rgba(224,51,51,.15); color: var(--accent2); border: 1px solid rgba(224,51,51,.3); }
.btn-danger:hover { background: var(--accent2); color: #fff; }
.btn-success   { background: rgba(46,204,113,.15); color: var(--green); border: 1px solid rgba(46,204,113,.3); }
.btn-success:hover { background: var(--green); color: #000; }
.btn-sm        { padding: .4rem 1rem; font-size: .78rem; }
.btn-lg        { padding: .9rem 2rem; font-size: 1rem; }
.btn-block     { width: 100%; justify-content: center; }

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem; transition: border-color .2s;
}
.card:hover { border-color: var(--border2); }
.card-hover:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,.3); }

/* ── FORMS ───────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.form-label {
  font-size: .75rem; color: var(--muted);
  letter-spacing: .08em; text-transform: uppercase; font-weight: 500;
}
.form-control {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r); color: var(--text);
  font-family: var(--font-body); font-size: .9rem;
  padding: .7rem 1rem; transition: border-color .2s; outline: none; width: 100%;
}
.form-control:focus { border-color: var(--accent); background: var(--surface); }
.form-control::placeholder { color: var(--muted2); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control option { background: var(--surface2); }
.form-hint { font-size: .75rem; color: var(--muted2); margin-top: .2rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── TABLES ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--surface2); padding: .75rem 1rem;
  font-size: .7rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); text-align: left; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: .8rem 1rem; border-bottom: 1px solid var(--border2); font-size: .85rem; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.02); }

/* ── BADGES ──────────────────────────────────────────────── */
.status-badge {
  display: inline-block; font-size: .65rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  padding: .2rem .6rem; border-radius: 999px;
}
.badge-pending   { background: rgba(243,156,18,.12); color: var(--orange); border: 1px solid rgba(243,156,18,.25); }
.badge-ok        { background: rgba(46,204,113,.12);  color: var(--green);  border: 1px solid rgba(46,204,113,.25); }
.badge-reject    { background: rgba(224,51,51,.12);   color: var(--accent2);border: 1px solid rgba(224,51,51,.25); }
.badge-published { background: rgba(74,143,212,.12);  color: var(--accent); border: 1px solid rgba(74,143,212,.25); }

.role-badge {
  display: inline-block; font-size: .65rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  padding: .2rem .6rem; border-radius: 999px;
}
.role-viewer    { background: rgba(90,106,122,.12); color: var(--muted); border: 1px solid rgba(90,106,122,.25); }
.role-submitter { background: rgba(74,143,212,.12); color: var(--accent); border: 1px solid rgba(74,143,212,.25); }
.role-mod       { background: rgba(243,156,18,.12); color: var(--orange); border: 1px solid rgba(243,156,18,.25); }
.role-admin     { background: rgba(224,51,51,.12);  color: var(--accent2);border: 1px solid rgba(224,51,51,.25); }

/* ── ALERTS / FLASH ──────────────────────────────────────── */
.flash {
  padding: .9rem 1.25rem; border-radius: var(--r);
  font-size: .875rem; margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: .6rem;
}
.flash-success { background: rgba(46,204,113,.1);  color: var(--green);  border: 1px solid rgba(46,204,113,.25); }
.flash-error   { background: rgba(224,51,51,.1);   color: var(--accent2);border: 1px solid rgba(224,51,51,.25); }
.flash-warning { background: rgba(243,156,18,.1);  color: var(--orange); border: 1px solid rgba(243,156,18,.25); }
.flash-info    { background: rgba(74,143,212,.1);  color: var(--accent); border: 1px solid rgba(74,143,212,.25); }

/* ── PAGINATION ──────────────────────────────────────────── */
.pagination { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: 1.5rem; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-size: .8rem; transition: all .2s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── VIDEO CARDS ─────────────────────────────────────────── */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.video-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; transition: all .25s;
}
.video-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,.4); }
.video-embed { position: relative; padding-top: 56.25%; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.video-thumb {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2); cursor: pointer;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-thumb-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.4); transition: background .2s;
}
.video-thumb:hover .video-thumb-overlay { background: rgba(0,0,0,.2); }
.play-btn {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent2); display: flex; align-items: center; justify-content: center;
}
.play-btn svg { width: 22px; height: 22px; fill: #fff; margin-left: 3px; }
.video-meta { padding: 1rem 1.25rem; }
.video-meta h3 { font-size: .95rem; font-weight: 500; color: var(--text); margin-bottom: .3rem; font-family: var(--font-body); }
.video-meta-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .4rem; }
.video-tag {
  font-size: .65rem; letter-spacing: .06em; text-transform: uppercase;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); padding: .2rem .6rem; border-radius: 999px;
}

/* ── AUTH PAGES ──────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 80px 1.5rem 2rem;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(74,143,212,.06) 0%, transparent 60%);
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 2.5rem; width: 100%; max-width: 420px;
}
.auth-logo {
  font-family: var(--font-head); font-size: 1.8rem; letter-spacing: .12em;
  color: #fff; text-align: center; margin-bottom: .3rem;
}
.auth-logo span { color: var(--accent); }
.auth-sub { text-align: center; color: var(--muted); font-size: .82rem; margin-bottom: 2rem; }
.auth-divider {
  text-align: center; color: var(--muted2); font-size: .75rem;
  position: relative; margin: 1.2rem 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; position: absolute; top: 50%; width: 40%;
  height: 1px; background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }
.auth-footer { text-align: center; font-size: .82rem; color: var(--muted); margin-top: 1.5rem; }
.auth-footer a { color: var(--accent); }

/* ── PANEL LAYOUT ────────────────────────────────────────── */
.panel-wrap { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; padding-top: 62px; }
.panel-sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: .3rem;
  position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto;
}
.sidebar-label {
  font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted2); padding: .8rem .6rem .3rem;
}
.sidebar-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .8rem; border-radius: var(--r);
  color: var(--muted); font-size: .85rem; font-weight: 500;
  text-decoration: none; transition: all .2s;
}
.sidebar-link:hover { background: var(--surface2); color: var(--text); }
.sidebar-link.active { background: rgba(74,143,212,.1); color: var(--accent); border-left: 2px solid var(--accent); }
.sidebar-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; flex-shrink: 0; }
.sidebar-badge {
  margin-left: auto; background: var(--accent2); color: #fff;
  font-size: .6rem; font-weight: 700; padding: .1rem .4rem; border-radius: 999px;
}
.panel-main { padding: 2rem 2rem; overflow-x: auto; }
.panel-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem; }
.panel-title { font-family: var(--font-head); font-size: 2rem; letter-spacing: .05em; color: #fff; }

/* ── STAT CARDS ──────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.25rem;
}
.stat-card-num { font-family: var(--font-head); font-size: 2.4rem; color: #fff; line-height: 1; }
.stat-card-label { font-size: .72rem; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin-top: .3rem; }
.stat-card-icon { font-size: 1.5rem; margin-bottom: .5rem; }

/* ── FOOTER ──────────────────────────────────────────────── */
.site-footer {
  background: var(--bg); border-top: 1px solid var(--border);
  padding: 1.5rem; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: .75rem;
}
.footer-logo { font-family: var(--font-head); font-size: 1.2rem; letter-spacing: .1em; color: var(--muted); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: .78rem; color: var(--muted); transition: color .2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: .75rem; color: var(--muted2); }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 100px 1.5rem 80px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px; opacity: .18;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 100%);
}
.hero-tag {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(74,143,212,.08); border: 1px solid rgba(74,143,212,.2);
  color: var(--accent); font-size: .72rem; letter-spacing: .15em; text-transform: uppercase;
  padding: .35rem .9rem; border-radius: 999px; margin-bottom: 1.5rem;
}
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; margin-top: 2rem; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .panel-wrap { grid-template-columns: 1fr; }
  .panel-sidebar { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-toggle { display: block; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 60px 1rem; }
  h1 { font-size: 3rem; }
}
