/* === Oscars 2026 Ballot — Shared Styles === */

:root {
  --bg: #0d0d1a;
  --surface: #151528;
  --surface-border: #252545;
  --gold: #d4af37;
  --gold-light: #f5e6a3;
  --gold-dim: #8a7420;
  --text: #f0f0f0;
  --text-dim: #8888aa;
  --red: #e74c3c;
  --green: #2ecc71;
  --white: #ffffff;
  --radius: 10px;
}

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

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* --- Header --- */
.header {
  text-align: center;
  padding: 24px 16px 16px;
  background: linear-gradient(180deg, #1a1a30 0%, var(--bg) 100%);
  border-bottom: 2px solid var(--gold-dim);
}
.header h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
}
.header .subtitle {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 4px;
}
.user-badge {
  display: inline-block;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--gold-dim);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.85rem;
  color: var(--gold-light);
}

/* --- Tabs --- */
.tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--surface-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.tab {
  flex: 1;
  max-width: 200px;
  text-align: center;
  padding: 12px 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  user-select: none;
}
.tab:hover { color: var(--gold-light); }
.tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* --- Container --- */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}
.container.wide { max-width: 900px; }

/* --- Registration --- */
.register-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 16px;
}
.register-card {
  background: var(--surface);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  max-width: 400px;
  width: 100%;
}
.register-card h2 {
  font-family: Georgia, serif;
  color: var(--gold);
  font-size: 1.4rem;
  margin-bottom: 8px;
}
.register-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.register-card input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  font-size: 1.1rem;
  border: 2px solid var(--surface-border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}
.register-card input[type="text"]:focus {
  border-color: var(--gold);
}
.register-card .error {
  color: var(--red);
  font-size: 0.85rem;
  margin-top: 8px;
  min-height: 20px;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), #c5a028);
  color: #1a1a2e;
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.3);
}
.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.5);
  transform: translateY(-1px);
}
.btn-gold:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-red {
  background: var(--red);
  color: white;
  font-size: 0.8rem;
  padding: 6px 12px;
}
.btn-red:hover { background: #c0392b; }
.btn-small {
  padding: 6px 14px;
  font-size: 0.8rem;
}

/* --- Progress Bar --- */
.progress-wrap {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 4px;
  transition: width 0.3s ease;
}
.progress-text {
  font-size: 0.85rem;
  color: var(--gold-light);
  white-space: nowrap;
  font-weight: 600;
}

/* --- Category Cards --- */
.category-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-left: 4px solid var(--gold-dim);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.category-card.filled {
  border-left-color: var(--gold);
}
.category-card.has-winner {
  border-left-color: var(--green);
}
.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}
.category-name {
  font-family: Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.category-status {
  font-size: 0.8rem;
  color: var(--text-dim);
}
.category-status.filled { color: var(--gold); }
.category-body {
  padding: 0 16px 14px;
}

/* --- Radio Nominees --- */
.nominee-option {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  margin: 4px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.nominee-option:hover { background: rgba(212, 175, 55, 0.08); }
.nominee-option.selected { background: rgba(212, 175, 55, 0.15); }
.nominee-option.winner-pick {
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid rgba(46, 204, 113, 0.3);
}
.nominee-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-dim);
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  transition: all 0.15s;
}
.nominee-option input[type="radio"]:checked {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: inset 0 0 0 3px var(--surface);
}
.nominee-label {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.3;
}
.nominee-label .film { color: var(--text); }
.nominee-label .person {
  color: var(--text-dim);
  font-size: 0.85rem;
}
.nominee-label .song-name {
  color: var(--gold-light);
  font-style: italic;
}
.save-indicator {
  font-size: 0.75rem;
  color: var(--green);
  opacity: 0;
  transition: opacity 0.3s;
  margin-left: 8px;
}
.save-indicator.show { opacity: 1; }

/* --- Dashboard --- */
.dash-category {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  padding: 16px;
}
.dash-category h3 {
  font-family: Georgia, serif;
  font-size: 0.95rem;
  color: var(--gold);
  margin-bottom: 12px;
}
.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}
.bar-label {
  width: 140px;
  font-size: 0.8rem;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.bar-track {
  flex: 1;
  height: 22px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 4px;
  transition: width 0.4s ease;
  min-width: 2px;
}
.bar-fill.is-winner {
  background: linear-gradient(90deg, #1d8348, var(--green));
}
.bar-count {
  width: 28px;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: left;
}

/* --- Leaderboard --- */
.leaderboard {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.leaderboard h3 {
  font-family: Georgia, serif;
  color: var(--gold);
  margin-bottom: 12px;
  font-size: 1.1rem;
}
.leaderboard-teaser {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
}
.lb-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
}
.lb-row:nth-child(1) { background: rgba(212, 175, 55, 0.12); }
.lb-row:nth-child(2) { background: rgba(192, 192, 192, 0.08); }
.lb-row:nth-child(3) { background: rgba(205, 127, 50, 0.08); }
.lb-rank {
  width: 32px;
  font-size: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}
.lb-name {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
}
.lb-score {
  font-size: 0.85rem;
  color: var(--gold-light);
  font-weight: 600;
}

/* --- Admin --- */
.admin-section {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.admin-section h2 {
  font-family: Georgia, serif;
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--surface-border);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.admin-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
  padding: 8px;
  border-bottom: 1px solid var(--surface-border);
}
.admin-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(37, 37, 69, 0.5);
}
.admin-table tr.deleted td {
  opacity: 0.4;
  text-decoration: line-through;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-deleted { background: var(--red); color: white; }
.badge-open { background: var(--green); color: white; }
.badge-closed { background: var(--red); color: white; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 0.9rem; }
.toggle {
  position: relative;
  width: 48px;
  height: 26px;
  cursor: pointer;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg);
  border-radius: 13px;
  border: 2px solid var(--surface-border);
  transition: all 0.2s;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--text-dim);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: all 0.2s;
}
.toggle input:checked + .toggle-slider {
  background: var(--gold-dim);
  border-color: var(--gold);
}
.toggle input:checked + .toggle-slider::after {
  transform: translateX(22px);
  background: var(--gold);
}

.winner-select {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.winner-select select {
  flex: 1;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
}
.winner-set { color: var(--green); font-size: 0.85rem; }

/* --- Removed Screen --- */
.removed-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: 16px;
}
.removed-screen h2 { color: var(--red); margin-bottom: 8px; }
.removed-screen p { color: var(--text-dim); }

/* --- Closed Screen --- */
.closed-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: 16px;
}
.closed-screen h2 {
  color: var(--gold);
  font-family: Georgia, serif;
  margin-bottom: 8px;
}
.closed-screen p { color: var(--text-dim); }

/* --- Responsive --- */
@media (max-width: 480px) {
  .bar-label { width: 100px; font-size: 0.75rem; }
  .category-header { padding: 12px; }
  .container { padding: 10px; }
}

/* --- Admin login --- */
.admin-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 16px;
}
.admin-login .register-card input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  font-size: 1.1rem;
  border: 2px solid var(--surface-border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  text-align: center;
  outline: none;
}
.admin-login .register-card input[type="password"]:focus {
  border-color: var(--gold);
}

/* hide sections */
.hidden { display: none !important; }
