/* ScoreHQ – Main Stylesheet */
/* Design: Deep navy/slate with electric gold accents. Bold, stage-lit feel. */

:root {
  --primary:    #1a1f3a;   /* deep navy */
  --secondary:  #2d3561;   /* mid navy */
  --accent:     #f5c518;   /* electric gold */
  --accent2:    #e8a500;   /* gold hover */
  --bg:         #0f1225;   /* near-black bg */
  --surface:    #1e2444;   /* card surface */
  --surface2:   #252b52;   /* elevated surface */
  --border:     #2e3566;   /* border */
  --text:       #e8eaf6;   /* primary text */
  --muted:      #8891b8;   /* muted text */
  --success:    #2ecc71;
  --danger:     #e74c3c;
  --warning:    #f39c12;
  --info:       #3498db;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 4px 20px rgba(0,0,0,.4);
  --font-head:  'Playfair Display', Georgia, serif;
  --font-body:  'Inter', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', monospace;
}

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

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

/* ── Typography ── */
h1,h2,h3,h4,h5 { font-family: var(--font-head); color: var(--text); font-weight: 700; }
h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 4vw, 1.9rem); }
h3 { font-size: 1.3rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent2); }

/* ── Navbar ── */
.navbar-scorehq {
  background: var(--primary);
  border-bottom: 2px solid var(--accent);
  padding: .75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,.5);
}
.navbar-brand {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent) !important;
  letter-spacing: -0.5px;
}
.navbar-brand span { color: var(--text); }
.nav-link { color: var(--muted) !important; font-size: .9rem; font-weight: 500; }
.nav-link:hover, .nav-link.active { color: var(--accent) !important; }
.navbar-toggler { border-color: var(--border); }
.navbar-toggler-icon { filter: invert(1); }

/* ── Page wrapper ── */
.page-wrap {
  min-height: calc(100vh - 60px);
  padding: 1.5rem 0 3rem;
}

/* ── Cards ── */
.card-hq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-hq .card-header {
  background: var(--secondary);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
}
.card-hq .card-body { padding: 1.25rem; }
.card-hq .card-footer {
  background: var(--secondary);
  border-top: 1px solid var(--border);
  padding: .75rem 1.25rem;
}

/* ── Buttons ── */
.btn-gold {
  background: var(--accent);
  color: var(--primary) !important;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  padding: .6rem 1.4rem;
  font-size: .95rem;
  transition: background .2s, transform .1s;
}
.btn-gold:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-gold:active { transform: translateY(0); }
.btn-outline-gold {
  border: 2px solid var(--accent);
  color: var(--accent) !important;
  background: transparent;
  border-radius: var(--radius);
  padding: .55rem 1.3rem;
  font-weight: 600;
  transition: all .2s;
}
.btn-outline-gold:hover { background: var(--accent); color: var(--primary) !important; }
.btn-navy {
  background: var(--secondary);
  color: var(--text) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem 1.2rem;
  font-weight: 500;
  transition: background .2s;
}
.btn-navy:hover { background: var(--surface2); }
.btn-danger-hq {
  background: var(--danger);
  color: #fff !important;
  border: none;
  border-radius: var(--radius);
  padding: .55rem 1rem;
  font-weight: 600;
  transition: opacity .2s;
}
.btn-danger-hq:hover { opacity: .85; }

/* ── Forms ── */
.form-control-hq, .form-select-hq {
  background: var(--primary) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: var(--radius) !important;
  padding: .65rem .9rem;
  font-size: .95rem;
  transition: border-color .2s;
}
.form-control-hq:focus, .form-select-hq:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(245,197,24,.15) !important;
  outline: none;
}
.form-control-hq::placeholder { color: var(--muted); }
.form-label-hq {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: .35rem;
  display: block;
}
.form-section {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.form-section-title {
  color: var(--accent);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

/* ── Tables ── */
.table-hq {
  color: var(--text);
  border-color: var(--border);
  font-size: .9rem;
}
.table-hq thead th {
  background: var(--secondary);
  color: var(--accent);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-color: var(--border);
  padding: .75rem .9rem;
  white-space: nowrap;
}
.table-hq tbody tr {
  border-color: var(--border);
  transition: background .15s;
}
.table-hq tbody tr:hover { background: var(--surface2); }
.table-hq tbody td {
  vertical-align: middle;
  padding: .75rem .9rem;
  border-color: var(--border);
}
.table-responsive { border-radius: var(--radius-lg); overflow: hidden; }

/* ── Badges ── */
.badge-hq {
  padding: .35rem .7rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge-active   { background: rgba(46,204,113,.15); color: var(--success); border: 1px solid rgba(46,204,113,.3); }
.badge-inactive { background: rgba(231,76,60,.15); color: var(--danger); border: 1px solid rgba(231,76,60,.3); }
.badge-draft    { background: rgba(139,148,184,.15); color: var(--muted); border: 1px solid var(--border); }
.badge-gold     { background: rgba(245,197,24,.15); color: var(--accent); border: 1px solid rgba(245,197,24,.3); }

/* ── Avatar / Photo ── */
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.avatar-md { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); }
.avatar-lg { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); }

/* ── Stats cards ── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  background: rgba(245,197,24,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

/* ── Progress ring ── */
.progress-hq {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-hq .bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px;
  transition: width .5s ease;
}

/* ── Score selector (Judge scoring) ── */
.score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  margin-bottom: 1rem;
  transition: border-color .2s;
}
.score-card:focus-within { border-color: var(--accent); }
.score-label {
  font-weight: 600;
  color: var(--text);
  margin-bottom: .6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.score-max { font-size: .78rem; color: var(--muted); }
.score-btns { display: flex; flex-wrap: wrap; gap: .4rem; }
.score-btn {
  width: 40px; height: 40px;
  border: 2px solid var(--border);
  background: var(--primary);
  color: var(--muted);
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  display: flex; align-items: center; justify-content: center;
}
.score-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.score-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--primary);
  transform: scale(1.1);
}

/* ── Contestant hero (judge scoring) ── */
.contestant-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.contestant-hero .num-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--primary);
  font-weight: 900;
  font-size: 1.1rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  line-height: 44px;
  margin-bottom: .75rem;
}
.round-indicator {
  background: var(--secondary);
  border-radius: 30px;
  padding: .4rem 1.2rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .5px;
  display: inline-block;
  margin-bottom: 1rem;
}

/* ── Results table ── */
.results-sticky-col {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 2;
}
.rank-1 { color: #f5c518; }
.rank-2 { color: #c0c0c0; }
.rank-3 { color: #cd7f32; }
.rank-num { font-weight: 800; font-size: 1.1rem; }
.total-score-cell {
  font-weight: 800;
  font-size: 1rem;
  color: var(--accent);
}

/* ── Live dot ── */
.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(1.3); }
}

/* ── Sidebar nav (organiser) ── */
.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.sidebar-header {
  background: var(--secondary);
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-title { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem 1.25rem;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  transition: all .15s;
}
.sidebar-nav a:last-child { border-bottom: none; }
.sidebar-nav a:hover { background: var(--surface2); color: var(--text); }
.sidebar-nav a.active { background: rgba(245,197,24,.1); color: var(--accent); border-left: 3px solid var(--accent); }
.sidebar-nav a .icon { font-size: 1rem; width: 20px; text-align: center; }

/* ── Auth pages ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
  padding: 2rem;
}
.auth-logo {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  text-align: center;
  margin-bottom: .25rem;
}
.auth-sub { text-align: center; color: var(--muted); font-size: .88rem; margin-bottom: 1.75rem; }

/* ── Alerts ── */
.alert-hq {
  border-radius: var(--radius);
  border: none;
  padding: .85rem 1.1rem;
  font-size: .9rem;
}
.alert-success { background: rgba(46,204,113,.15); color: var(--success); border-left: 3px solid var(--success); }
.alert-danger   { background: rgba(231,76,60,.15); color: #f18f84; border-left: 3px solid var(--danger); }
.alert-warning  { background: rgba(243,156,18,.15); color: var(--warning); border-left: 3px solid var(--warning); }
.alert-info     { background: rgba(52,152,219,.15); color: #7ec8e3; border-left: 3px solid var(--info); }

/* ── Home page ── */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, #0d1432 100%);
  border-bottom: 2px solid var(--accent);
  padding: 4rem 1rem 3rem;
  text-align: center;
}
.hero-title {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 900;
  color: var(--text);
  margin-bottom: .5rem;
}
.hero-title em { color: var(--accent); font-style: normal; }
.hero-sub { color: var(--muted); font-size: 1.1rem; margin-bottom: 2rem; }
.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform .2s, border-color .2s;
  overflow: hidden;
}
.event-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.event-card-banner { height: 140px; object-fit: cover; width: 100%; background: var(--secondary); }
.event-card-body { padding: 1.1rem; }
.event-card-category {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--accent);
  margin-bottom: .3rem;
}

/* ── Done state ── */
.scoring-done {
  text-align: center;
  padding: 3rem 1rem;
}
.scoring-done .trophy { font-size: 4rem; margin-bottom: 1rem; }

/* ── Responsive tweaks ── */
@media (max-width: 576px) {
  .page-wrap { padding: 1rem 0 2rem; }
  .auth-card { padding: 1.5rem; }
  .score-btn { width: 36px; height: 36px; font-size: .82rem; }
  .stat-card { flex-direction: column; text-align: center; gap: .75rem; }
  .contestant-hero { padding: 1rem; }
  .table-hq thead th { font-size: .68rem; padding: .6rem .6rem; }
  .table-hq tbody td { padding: .6rem .6rem; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Utility ── */
.text-accent { color: var(--accent) !important; }
.text-muted-hq { color: var(--muted) !important; }
.border-hq { border-color: var(--border) !important; }
.bg-surface { background: var(--surface) !important; }
.bg-surface2 { background: var(--surface2) !important; }
.gap-xs { gap: .4rem; }
