/* --------------------------------------------------
   DOCTORDOM.PT - CLINICAL QUIZ & ADMIN PORTAL STYLES
   Website: doctordom.pt
-------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg-body: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-accent-light: #E0F2FE;

  --navy-dark: #0A192F;
  --navy-medium: #1E293B;
  --navy-light: #334155;

  --brand-green: #52C41A;
  --brand-blue: #00A8E8;
  --brand-blue-hover: #0086BA;
  --brand-amber: #D97706;
  --brand-red: #EF4444;

  --text-main: #0A192F;
  --text-muted: #475569;
  --text-subtle: #64748B;

  --border-light: #E2E8F0;
  --border-accent: #BAE6FD;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(10, 25, 47, 0.08);
  --shadow-md: 0 10px 25px -5px rgba(10, 25, 47, 0.08);
  --shadow-lg: 0 20px 45px -10px rgba(0, 168, 232, 0.14);
}

[data-theme="dark"] {
  --bg-body: #0A0F1D;
  --bg-surface: #111A2E;
  --bg-subtle: #17223B;
  --bg-accent-light: rgba(0, 168, 232, 0.15);

  --navy-dark: #F8FAFC;
  --navy-medium: #E2E8F0;
  --navy-light: #94A3B8;

  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --text-subtle: #64748B;

  --border-light: #1E293B;
  --border-accent: #0284C7;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 45px -10px rgba(0, 0, 0, 0.65);
}

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

.btn-nav-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 1.25rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  line-height: 1;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-nav-outline {
  background: var(--bg-surface);
  color: var(--navy-dark);
  border: 1.5px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.btn-nav-outline:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.btn-nav-primary {
  background: var(--brand-blue);
  color: #FFFFFF;
  border: 1.5px solid var(--brand-blue);
  box-shadow: 0 4px 12px rgba(0, 168, 232, 0.25);
}

.btn-nav-primary:hover {
  background: var(--brand-blue-hover);
  border-color: var(--brand-blue-hover);
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Quiz Card Container */
.quiz-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.5rem;
}

.quiz-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.quiz-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  background: var(--bg-accent-light);
  color: var(--brand-blue);
  font-family: monospace;
  font-size: 1.15rem;
  font-weight: 800;
  border: 1px solid var(--border-accent);
}

.quiz-progress-outer {
  width: 100%;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.quiz-progress-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-green), var(--brand-blue));
  width: 0%;
  transition: width 0.3s ease;
}

.question-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.option-btn {
  background: var(--bg-body);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.option-btn:hover {
  border-color: var(--brand-blue);
  background: var(--bg-surface);
  transform: translateX(4px);
}

.option-letter {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--brand-blue);
  flex-shrink: 0;
}

.option-btn.selected-correct {
  background: rgba(82, 196, 26, 0.12);
  border-color: var(--brand-green);
  color: #15803D;
}

.option-btn.selected-correct .option-letter {
  background: var(--brand-green);
  color: #FFFFFF;
  border-color: var(--brand-green);
}

.option-btn.selected-wrong {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--brand-red);
  color: #B91C1C;
}

.option-btn.selected-wrong .option-letter {
  background: var(--brand-red);
  color: #FFFFFF;
  border-color: var(--brand-red);
}

/* Explanation Box */
.explanation-box {
  background: var(--bg-subtle);
  border-left: 4px solid var(--brand-blue);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 1.75rem;
  display: none;
}

.explanation-box.visible {
  display: block;
}

.explanation-header {
  font-weight: 800;
  color: var(--brand-blue);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.explanation-text {
  color: var(--navy-medium);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Leaderboard Table */
.leaderboard-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th {
  text-align: left;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-subtle);
  border-bottom: 2px solid var(--border-light);
}

.leaderboard-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy-dark);
}

.leaderboard-table th:last-child,
.leaderboard-table td:last-child {
  white-space: nowrap;
  min-width: 120px;
}

.rank-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.rank-1 { background: #FEF08A; color: #854D0E; }
.rank-2 { background: #E2E8F0; color: #475569; }
.rank-3 { background: #FFEDD5; color: #9A3412; }

/* Admin Dashboard Table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th, .admin-table td {
  padding: 1.1rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-light);
}

.badge-cat {
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 800;
}

.badge-pulmonary { background: rgba(0, 168, 232, 0.15); color: var(--brand-blue); }
.badge-cardiac { background: rgba(82, 196, 26, 0.15); color: var(--brand-green); }

/* --------------------------------------------------
   MOBILE & TABLET RESPONSIVE STYLES
-------------------------------------------------- */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .quiz-card, .leaderboard-card {
    padding: 1.5rem 1.15rem;
    border-radius: var(--radius-lg);
  }

  .quiz-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .quiz-timer-badge {
    padding: 0.4rem 0.85rem;
    font-size: 1rem;
    align-self: flex-start;
  }

  .question-title {
    font-size: 1.15rem;
    line-height: 1.4;
    margin-bottom: 1.25rem;
  }

  .option-btn {
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
    min-height: 48px;
    gap: 0.75rem;
  }

  .option-letter {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }

  .explanation-box {
    padding: 1rem;
    margin-bottom: 1.25rem;
  }

  .explanation-text {
    font-size: 0.88rem;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
  }

  .leaderboard-table th, .leaderboard-table td {
    padding: 0.75rem 0.6rem;
    font-size: 0.85rem;
  }

  .admin-table th, .admin-table td {
    padding: 0.85rem 0.65rem;
    font-size: 0.82rem;
  }

  .quiz-summary-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .modal-dialog-content {
    padding: 1.5rem !important;
    max-width: 95% !important;
    max-height: 90vh;
    overflow-y: auto;
  }

  .weekly-tracker-bar {
    gap: 0.35rem !important;
  }

  .day-chip {
    padding: 0.4rem 0.15rem !important;
    min-height: 58px !important;
  }

  .day-chip-name {
    font-size: 0.62rem !important;
  }

  .day-chip-num {
    font-size: 0.82rem !important;
  }

  .day-chip-icon {
    width: 20px !important;
    height: 20px !important;
  }
}

@media (max-width: 480px) {
  .quiz-card {
    padding: 1.25rem 1rem;
  }

  .question-title {
    font-size: 1.05rem;
  }

  .admin-table th:nth-child(4),
  .admin-table td:nth-child(4) {
    display: none;
  }
}

/* --------------------------------------------------
   QUESTION OF THE DAY & WEEKLY TRACKER
-------------------------------------------------- */
.qotd-hub-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 1.35rem 1.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.qotd-hub-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #00A8E8, #3B82F6, #F59E0B);
}

.qotd-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}

.qotd-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 168, 232, 0.08);
  color: var(--brand-blue);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  margin-bottom: 0.35rem;
  border: 1px solid rgba(0, 168, 232, 0.18);
}

.qotd-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy-dark);
  margin-bottom: 0.15rem;
}

.qotd-subtitle {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.qotd-streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(239, 68, 68, 0.05) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.08);
}

.qotd-streak-info {
  display: flex;
  flex-direction: column;
}

.qotd-streak-count {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  color: #D97706;
  font-family: var(--font-heading);
}

.qotd-streak-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #B45309;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Weekly Tracker Bar - Compact & Clean */
.weekly-tracker-container {
  background: #F8FAFC;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.15rem;
  border: 1px solid var(--border-light);
}

.weekly-tracker-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.weekly-tracker-title {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--navy-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.weekly-tracker-range {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-subtle);
}

.weekly-tracker-bar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.45rem;
}

.day-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.45rem 0.2rem;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  user-select: none;
}

.day-chip-name {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
  margin-bottom: 0.08rem;
}

.day-chip-num {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--navy-dark);
  margin-bottom: 0.25rem;
}

.day-chip-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

/* Day Chip States */
.day-chip.status-correct {
  border-color: rgba(22, 163, 74, 0.35);
  background: linear-gradient(180deg, #FFFFFF 0%, rgba(22, 163, 74, 0.05) 100%);
}
.day-chip.status-correct .day-chip-icon {
  background: rgba(22, 163, 74, 0.12);
  color: #16A34A;
}

.day-chip.status-incorrect {
  border-color: rgba(220, 38, 38, 0.35);
  background: linear-gradient(180deg, #FFFFFF 0%, rgba(220, 38, 38, 0.05) 100%);
}
.day-chip.status-incorrect .day-chip-icon {
  background: rgba(220, 38, 38, 0.12);
  color: #DC2626;
}

.day-chip.status-missed {
  border-color: #E2E8F0;
  border-style: dashed;
  background: #F8FAFC;
  opacity: 0.8;
}
.day-chip.status-missed .day-chip-icon {
  background: #F1F5F9;
  color: #64748B;
}

/* Today Active State */
.day-chip.status-today,
.day-chip.status-today_unanswered,
.day-chip.is-today:not(.status-correct):not(.status-incorrect) {
  border-color: #00A8E8;
  border-width: 1.5px;
  background: var(--bg-surface);
  box-shadow: 0 0 0 1px #00A8E8, 0 3px 8px rgba(0, 168, 232, 0.14);
}

.day-chip.status-today .day-chip-name,
.day-chip.status-today_unanswered .day-chip-name,
.day-chip.is-today:not(.status-correct):not(.status-incorrect) .day-chip-name {
  color: #00A8E8;
  font-weight: 800;
}

.day-chip.status-today .day-chip-num,
.day-chip.status-today_unanswered .day-chip-num,
.day-chip.is-today:not(.status-correct):not(.status-incorrect) .day-chip-num {
  color: var(--navy-dark);
  font-weight: 800;
}

.day-chip.status-today .day-chip-icon,
.day-chip.status-today_unanswered .day-chip-icon,
.day-chip.is-today:not(.status-correct):not(.status-incorrect) .day-chip-icon {
  background: #00A8E8 !important;
  color: #FFFFFF !important;
}

.day-chip.status-today .day-chip-icon svg,
.day-chip.status-today_unanswered .day-chip-icon svg,
.day-chip.is-today:not(.status-correct):not(.status-incorrect) .day-chip-icon svg {
  fill: #FFFFFF !important;
  stroke: #FFFFFF !important;
}

.day-chip.status-future {
  border-color: #E2E8F0;
  background: var(--bg-surface);
  opacity: 0.65;
}
.day-chip.status-future .day-chip-icon {
  background: transparent;
  color: #94A3B8;
}

/* Pulsing ring animation for active today chip */
.pulse-indicator {
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 168, 232, 0.45);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(0, 168, 232, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 168, 232, 0);
  }
}

/* QOTD Action Box - Sleek & Compact */
.qotd-action-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  flex-wrap: wrap;
}

.qotd-action-desc {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.qotd-action-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--navy-dark);
}

.qotd-action-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* --------------------------------------------------
   SUB-CATEGORY BADGE
-------------------------------------------------- */
.badge-subcat {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--navy-dark);
  border: 1px solid var(--border-light);
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

/* --------------------------------------------------
   2-SECOND READING WINDOW & DELAYED OPTIONS ANIMATION
-------------------------------------------------- */
.answers-reading-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: var(--bg-accent-light);
  border: 1.5px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.25rem;
  color: var(--brand-blue);
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
  animation: pulseNotice 1.5s ease-in-out infinite;
}

.reading-countdown-digit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: #FFFFFF;
  font-size: 0.82rem;
  font-weight: 800;
  margin: 0 0.15rem;
}

@keyframes pulseNotice {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.82; transform: scale(0.99); }
}

@keyframes fadeInUpOption {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.option-btn-animate {
  animation: fadeInUpOption 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --------------------------------------------------
   LEADERBOARD TABS & PERSONAL LEADERBOARD
-------------------------------------------------- */
.leaderboard-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-subtle);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  margin-bottom: 1.5rem;
  width: fit-content;
  max-width: 100%;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--brand-blue);
}

.tab-btn.active {
  background: var(--bg-surface);
  color: var(--navy-dark);
  box-shadow: var(--shadow-sm);
}

.personal-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.personal-stat-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  text-align: center;
}

.personal-stat-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--brand-blue);
  line-height: 1.1;
  font-family: var(--font-heading);
}

.personal-stat-lbl {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* --------------------------------------------------
   DARK MODE OVERRIDES (QUIZ & ADMIN)
-------------------------------------------------- */
[data-theme="dark"] .quiz-card,
[data-theme="dark"] .leaderboard-card,
[data-theme="dark"] .qotd-action-box {
  background: var(--bg-surface);
  border-color: var(--border-light);
}

[data-theme="dark"] .option-btn {
  background: var(--bg-subtle);
  border-color: var(--border-light);
  color: var(--text-main);
}

[data-theme="dark"] .option-btn:hover {
  background: #1E2D4A;
  border-color: var(--brand-blue);
  color: #FFFFFF;
}

[data-theme="dark"] .option-letter {
  background: var(--bg-surface);
  border-color: var(--border-light);
  color: var(--brand-blue);
}

[data-theme="dark"] .option-btn.selected-correct {
  background: rgba(34, 197, 94, 0.16) !important;
  border-color: #22C55E !important;
  color: #4ADE80 !important;
}

[data-theme="dark"] .option-btn.selected-wrong {
  background: rgba(239, 68, 68, 0.16) !important;
  border-color: #EF4444 !important;
  color: #F87171 !important;
}

[data-theme="dark"] .explanation-box {
  background: rgba(0, 168, 232, 0.1);
  border-color: rgba(0, 168, 232, 0.25);
}

[data-theme="dark"] .explanation-title {
  color: var(--brand-blue);
}

[data-theme="dark"] .explanation-text {
  color: var(--navy-medium);
}

[data-theme="dark"] .leaderboard-table th,
[data-theme="dark"] .admin-table th {
  background: var(--bg-subtle);
  color: var(--navy-dark);
  border-bottom-color: var(--border-light);
}

[data-theme="dark"] .leaderboard-table td,
[data-theme="dark"] .admin-table td {
  border-bottom-color: var(--border-light);
}

[data-theme="dark"] .leaderboard-table tbody tr:hover,
[data-theme="dark"] .admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .tab-btn.active {
  background: var(--bg-subtle);
  color: var(--brand-blue);
  border: 1px solid var(--border-light);
}

[data-theme="dark"] .badge-subcat {
  background: var(--bg-subtle);
  border-color: var(--border-light);
  color: var(--navy-dark);
}

[data-theme="dark"] .weekly-tracker-container {
  background: var(--bg-surface);
  border-color: var(--border-light);
}

[data-theme="dark"] .day-chip {
  background: var(--bg-surface) !important;
  border-color: var(--border-light) !important;
}

[data-theme="dark"] .day-chip-name {
  color: var(--text-subtle) !important;
}

[data-theme="dark"] .day-chip-num {
  color: var(--text-main) !important;
}

/* Today Active in Dark Mode */
[data-theme="dark"] .day-chip.status-today,
[data-theme="dark"] .day-chip.status-today_unanswered,
[data-theme="dark"] .day-chip.is-today:not(.status-correct):not(.status-incorrect) {
  background: rgba(0, 168, 232, 0.16) !important;
  border-color: #00A8E8 !important;
  box-shadow: 0 0 0 1.5px #00A8E8, 0 0 16px rgba(0, 168, 232, 0.3) !important;
}

[data-theme="dark"] .day-chip.status-today .day-chip-name,
[data-theme="dark"] .day-chip.status-today_unanswered .day-chip-name,
[data-theme="dark"] .day-chip.is-today:not(.status-correct):not(.status-incorrect) .day-chip-name {
  color: #38BDF8 !important;
}

[data-theme="dark"] .day-chip.status-today .day-chip-num,
[data-theme="dark"] .day-chip.status-today_unanswered .day-chip-num,
[data-theme="dark"] .day-chip.is-today:not(.status-correct):not(.status-incorrect) .day-chip-num {
  color: #FFFFFF !important;
}

[data-theme="dark"] .day-chip.status-correct {
  background: rgba(22, 163, 74, 0.15) !important;
  border-color: rgba(22, 163, 74, 0.4) !important;
}

[data-theme="dark"] .day-chip.status-incorrect {
  background: rgba(220, 38, 38, 0.15) !important;
  border-color: rgba(220, 38, 38, 0.4) !important;
}

[data-theme="dark"] .day-chip.status-missed,
[data-theme="dark"] .day-chip.status-future {
  background: var(--bg-subtle) !important;
  border-color: var(--border-light) !important;
  opacity: 0.75;
}




/* --------------------------------------------------
   PRACTICE MODE OPTIONS (TIMER / QUESTION COUNT)
-------------------------------------------------- */
.practice-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.25rem;
}

.practice-options-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
}

.practice-options-note {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.practice-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy-dark);
  cursor: pointer;
  user-select: none;
}

.practice-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.practice-switch-track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 9999px;
  background: var(--border-light);
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.practice-switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.practice-switch input:checked + .practice-switch-track {
  background: var(--brand-blue);
}

.practice-switch input:checked + .practice-switch-track::after {
  transform: translateX(16px);
}

.practice-switch input:focus-visible + .practice-switch-track {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .practice-options {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Let the leaderboard tabs share the row instead of pushing the page wider */
  .leaderboard-tabs {
    width: 100%;
  }

  .tab-btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    text-align: center;
    white-space: normal;
    padding: 0.55rem 0.6rem;
    font-size: 0.82rem;
  }
}
