/* Admin / Proctor UI CSS */

body.admin-body {
  min-height: 100vh;
  background-color: #070d1e;
  color: #f1f5f9;
}

/* PIN Auth Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none !important;
}

.pin-card {
  width: 100%;
  max-width: 440px;
  padding: 40px 32px;
  text-align: center;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.15);
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.pin-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.pin-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
}

.pin-subtitle {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.pin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pin-input {
  background: rgba(2, 6, 23, 0.8);
  border: 2px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 2.4rem;
  letter-spacing: 0.5em;
  text-align: center;
  padding: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pin-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.pin-error {
  color: #ef4444;
  font-weight: 600;
  font-size: 0.9rem;
}

.pin-hint {
  margin-top: 20px;
  font-size: 0.85rem;
  color: #64748b;
}

/* Admin Container */
.admin-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 16px 24px 30px;
  gap: 16px;
}

/* Navbar */
.admin-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  gap: 20px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 2rem;
  color: var(--accent-gold);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #ffffff;
}

.live-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 600;
}

.nav-event-info {
  flex: 1;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-input {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #38bdf8;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  padding: 3px 8px;
  outline: none;
}
.header-input:focus {
  border-color: #38bdf8;
  background: rgba(15, 23, 42, 0.6);
}

.header-subtitle-input {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 0.85rem;
  padding: 2px 8px;
  outline: none;
}
.header-subtitle-input:focus {
  border-color: #cbd5e1;
  background: rgba(15, 23, 42, 0.6);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Grid Layout */
.admin-grid {
  display: grid;
  grid-template-columns: 380px 1fr 420px;
  gap: 16px;
  align-items: start;
}

.admin-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Section Cards */
.section-card {
  padding: 20px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.header-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sec-icon {
  font-size: 1.4rem;
}

.card-header h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

/* Status Pills */
.status-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
}
.status-pill.stopped { background: rgba(100, 116, 139, 0.2); color: #94a3b8; border: 1px solid #64748b; }
.status-pill.running { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid #10b981; animation: pulseGlow 1.5s infinite; }
.status-pill.paused { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid #f59e0b; }
.status-pill.showing { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid #38bdf8; }
.status-pill.not-showing { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Teams Dashboard */
.teams-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-team-card {
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s;
}

.admin-team-card.color-cyan { border-left: 5px solid var(--team-a); }
.admin-team-card.color-gold { border-left: 5px solid var(--team-b); }
.admin-team-card.color-magenta { border-left: 5px solid var(--team-c); }

.team-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.team-name-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  padding: 2px 6px;
  flex: 1;
}

.team-name-input:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.team-name-input:focus {
  background: rgba(15, 23, 42, 0.8);
  border-color: #38bdf8;
  outline: none;
}

.team-current-score {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  padding: 0 4px;
}

/* Quick Action Score Buttons */
.quick-scores-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.score-btn {
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 6px;
  border: 1px solid transparent;
}

.score-btn.btn-plus {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}
.score-btn.btn-plus:hover {
  background: #10b981;
  color: #ffffff;
}

.score-btn.btn-minus {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}
.score-btn.btn-minus:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Manual Score Input Row */
.manual-score-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-field-sm {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #ffffff;
  font-family: var(--font-mono);
  padding: 5px 8px;
  font-size: 0.9rem;
  outline: none;
  width: 90px;
}

.input-field-sm:focus {
  border-color: #38bdf8;
}

/* Soundboard */
.soundboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.sound-btn {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  color: #ffffff;
  transition: all 0.2s ease;
}

.sound-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.btn-sound-correct:hover { border-color: #10b981; background: rgba(16, 185, 129, 0.2); }
.btn-sound-wrong:hover { border-color: #ef4444; background: rgba(239, 68, 68, 0.2); }
.btn-sound-timeout:hover { border-color: #f59e0b; background: rgba(245, 158, 11, 0.2); }
.btn-sound-bell:hover { border-color: #38bdf8; background: rgba(56, 189, 248, 0.2); }

.sound-icon { font-size: 1.8rem; }
.sound-label { font-weight: 700; font-size: 0.95rem; }
.sound-sub { font-size: 0.75rem; color: #94a3b8; }

/* Timer Card Admin */
.admin-timer-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 14px 20px;
}

.timer-main-digit {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.timer-main-digit #adminTimerValue {
  font-family: var(--font-mono);
  font-size: 3.8rem;
  font-weight: 800;
  line-height: 1;
  color: #38bdf8;
}

.digit-unit {
  font-size: 0.85rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.1em;
}

.timer-preset-btns {
  display: flex;
  gap: 6px;
}

.preset-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.preset-btn.active, .preset-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

.timer-action-bar {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 10px;
}

.custom-timer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #94a3b8;
}

/* Active Question & Private Answer Key */
.active-q-card {
  position: relative;
}

.placeholder-box {
  background: rgba(2, 6, 23, 0.4);
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 30px 20px;
  text-align: center;
  color: #94a3b8;
}

.placeholder-box p {
  font-size: 1.1rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.active-q-data {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.q-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: var(--radius-full);
}

.badge-pill.gold { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-pill.blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-pill.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-pill.green { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }

.q-text-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.q-text-box label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 6px;
}

.active-question-text {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  color: #ffffff;
}

/* Private Answer Box - Highly Prominent for Proctor */
.private-answer-box {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 2px solid #10b981;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.2);
}

.private-answer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.lock-icon {
  font-size: 1.1rem;
}

.private-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #34d399;
}

.private-answer-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.4;
}

.active-q-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* Question Bank Tabs */
.round-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(2, 6, 23, 0.5);
  padding: 4px;
  border-radius: var(--radius-md);
}

.round-tab-btn {
  background: transparent;
  color: #94a3b8;
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.round-tab-btn.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.tab-count {
  background: rgba(255, 255, 255, 0.12);
  padding: 1px 7px;
  border-radius: 12px;
  font-size: 0.75rem;
}

.questions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 4px;
}

.bank-q-card {
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s;
}

.bank-q-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(15, 23, 42, 0.7);
}

.bank-q-card.is-active {
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
  background: rgba(14, 165, 233, 0.12);
}

.bank-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bank-q-text {
  font-size: 0.95rem;
  color: #f1f5f9;
  line-height: 1.35;
}

.bank-q-answer-preview {
  font-size: 0.85rem;
  color: #34d399;
  font-style: italic;
  background: rgba(16, 185, 129, 0.08);
  padding: 4px 8px;
  border-radius: 4px;
}

.bank-q-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* Buttons System */
.btn {
  font-family: var(--font-main);
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-lg {
  padding: 12px 20px;
  font-size: 1rem;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
}

.btn-primary-sm {
  background: #0284c7;
  color: #ffffff;
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: 6px;
}
.btn-primary-sm:hover { background: #0369a1; }

.btn-danger-sm {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}
.btn-danger-sm:hover {
  background: #ef4444;
  color: #ffffff;
}

.btn-block { width: 100%; }

.btn-primary { background: #0284c7; color: #ffffff; }
.btn-primary:hover { background: #0ea5e9; }

.btn-secondary { background: rgba(51, 65, 85, 0.8); color: #f1f5f9; }
.btn-secondary:hover { background: rgba(71, 85, 105, 1); }

.btn-success { background: #059669; color: #ffffff; }
.btn-success:hover { background: #10b981; }

.btn-warning { background: #d97706; color: #ffffff; }
.btn-warning:hover { background: #f59e0b; }

.btn-gold { background: #fbbf24; color: #050814; }
.btn-gold:hover { background: #f59e0b; }

.btn-outline {
  background: transparent;
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}
.btn-outline:hover {
  background: rgba(56, 189, 248, 0.15);
}

.btn-ghost {
  background: transparent;
  color: #94a3b8;
}
.btn-ghost:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* Modal Form */
.modal-card {
  width: 100%;
  max-width: 600px;
  padding: 24px 28px;
  background: rgba(15, 23, 42, 0.98);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: #ffffff;
}

.close-btn {
  background: transparent;
  color: #94a3b8;
  font-size: 1.8rem;
  line-height: 1;
}
.close-btn:hover { color: #ffffff; }

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.flex-1 { flex: 1; }
.w-80 { width: 100px; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #94a3b8;
}

.input-field {
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: #ffffff;
  padding: 10px 14px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
}

.input-field:focus {
  border-color: #38bdf8;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

/* Responsive Tablet */
@media (max-width: 1200px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}
