/* ========================================================
   MODERN TUTOR PLATFORM STYLESHEET
   Variables, Reset & Theming for History and Mathematics
   ======================================================== */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #94a3b8;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  /* Primary branding (Home) */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-subtle: #eef2ff;
  --primary-contrast: #ffffff;
  
  /* Status colors */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* THEME: HISTORY (Теплый, античный, терракотово-янтарный) */
body[data-theme="history"] {
  --bg-main: #faf7f2;
  --bg-card: #ffffff;
  --bg-subtle: #f5eee4;
  --border-color: #e8dccb;
  --border-focus: #c25e2e;
  --text-main: #2b1f17;
  --text-muted: #735d4d;
  --text-light: #a89484;
  
  --primary: #b45309;       /* Deep warm amber / terracotta */
  --primary-hover: #92400e;
  --primary-subtle: #fef3c7;
  --primary-contrast: #ffffff;
  --theme-hero-gradient: linear-gradient(135deg, #78350f 0%, #b45309 50%, #d97706 100%);
  --theme-card-accent: #fef3c7;
}

/* THEME: MATHEMATICS (Глубокий сине-индиго, лазурный, точный) */
body[data-theme="math"] {
  --bg-main: #f0f7ff;
  --bg-card: #ffffff;
  --bg-subtle: #e0f2fe;
  --border-color: #bae6fd;
  --border-focus: #0284c7;
  --text-main: #0c2340;
  --text-muted: #475569;
  --text-light: #94a3b8;
  
  --primary: #0284c7;       /* Precision sky / royal blue */
  --primary-hover: #0369a1;
  --primary-subtle: #e0f2fe;
  --primary-contrast: #ffffff;
  --theme-hero-gradient: linear-gradient(135deg, #0f172a 0%, #0369a1 50%, #0284c7 100%);
  --theme-card-accent: #e0f2fe;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header & Navigation Bar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.brand-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Role Badges & Auth Buttons */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
}

.role-badge.student {
  display: none !important;
}

.role-badge.teacher {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  box-shadow: var(--shadow-sm);
}

/* Discreet Stealth Login Button (Не бросается в глаза ученикам) */
.btn-stealth {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  opacity: 0.55;
  text-decoration: none;
}

.btn-stealth:hover {
  opacity: 1;
  color: var(--text-main);
  background-color: var(--bg-subtle);
  border-color: var(--border-color);
}

.btn-stealth svg {
  display: block;
}

/* Checkbox Style for "Remember Me" */
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

.remember-group {
  margin: 0.75rem 0 1.25rem 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-contrast);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-outline:hover {
  background-color: var(--bg-subtle);
  border-color: var(--border-focus);
}

.btn-danger {
  background-color: var(--danger-bg);
  color: var(--danger);
  border-color: #fecaca;
}

.btn-danger:hover {
  background-color: #fee2e2;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

/* Layout Container */
.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

/* ========================================================
   HOME PAGE (ГЛАВНАЯ СТРАНИЦА)
   ======================================================== */
.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
  max-width: 860px;
  margin: 0 auto;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--primary-subtle);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

.hero-title span.gradient-text {
  background: linear-gradient(135deg, #4f46e5 0%, #b45309 50%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 3rem;
}

/* Subjects Grid */
.subjects-section-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-main);
}

.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.subject-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-md);
  border: 2px solid transparent;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  text-decoration: none;
}

.subject-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  transition: var(--transition);
}

.subject-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}

/* History Card Specific */
.subject-card.history {
  border-color: #fed7aa;
}
.subject-card.history::before {
  background: linear-gradient(90deg, #b45309, #f59e0b);
}
.subject-card.history:hover {
  border-color: #f97316;
}
.subject-card.history .subject-icon-box {
  background: #ffedd5;
  color: #9a3412;
}

/* Math Card Specific */
.subject-card.math {
  border-color: #bae6fd;
}
.subject-card.math::before {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
}
.subject-card.math:hover {
  border-color: #0284c7;
}
.subject-card.math .subject-icon-box {
  background: #e0f2fe;
  color: #0369a1;
}

.subject-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.subject-icon-box {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.subject-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.subject-desc {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  flex-grow: 1;
}

.subject-features {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-main);
}

.subject-feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.subject-btn {
  width: 100%;
  font-size: 1.05rem;
  padding: 0.85rem;
}

/* ========================================================
   SUBJECT PAGE (ИСТОРИЯ / МАТЕМАТИКА)
   ======================================================== */
.subject-banner {
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  color: #ffffff;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

body[data-theme="history"] .subject-banner {
  background: var(--theme-hero-gradient);
}

body[data-theme="math"] .subject-banner {
  background: var(--theme-hero-gradient);
}

.banner-content {
  position: relative;
  z-index: 2;
  max-width: 750px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  transition: var(--transition);
}

.back-link:hover {
  color: #ffffff;
  transform: translateX(-3px);
}

.subject-page-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.subject-page-desc {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Subject Tabs */
.tabs-wrapper {
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.tabs-nav {
  display: flex;
  gap: 0.5rem;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.5rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  bottom: -2px;
}

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

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-badge {
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.tab-btn.active .tab-badge {
  background-color: var(--primary-subtle);
  color: var(--primary);
}

.tab-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

/* Material & Test Cards Grid */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  background-color: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 2px dashed var(--border-color);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

/* Material Card */
.material-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.material-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-focus);
}

.material-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.file-ext-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background-color: var(--primary-subtle);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.material-date {
  font-size: 0.8rem;
  color: var(--text-light);
}

.material-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.material-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.material-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.material-size {
  font-size: 0.8rem;
  color: var(--text-light);
}

.material-buttons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Test Card */
.test-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.test-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.test-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--primary-subtle);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.test-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.test-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.test-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ========================================================
   TEST TAKING VIEW & RESULT VIEW
   ======================================================== */
.test-runner {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  padding: 2.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.test-runner-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.test-runner-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.question-block {
  background-color: var(--bg-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

.question-number {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.question-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}

.option-label:hover {
  border-color: var(--primary);
  background-color: var(--primary-subtle);
}

.option-label input[type="radio"] {
  accent-color: var(--primary);
  width: 1.15rem;
  height: 1.15rem;
  cursor: pointer;
}

/* Test Results Screen */
.results-summary-card {
  text-align: center;
  padding: 2.5rem;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  border: 1px solid var(--border-color);
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: var(--shadow-lg);
}

.score-number {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.score-percent {
  font-size: 0.9rem;
  opacity: 0.9;
}

.result-verdict {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

/* Result Question Details (Explanations!) */
.result-question-card {
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  border: 2px solid var(--border-color);
  background-color: var(--bg-card);
}

.result-question-card.correct {
  border-color: var(--success);
  background-color: #f0fdf4;
}

.result-question-card.incorrect {
  border-color: var(--danger);
  background-color: #fef2f2;
}

.result-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.result-status-badge.correct {
  background-color: #dcfce7;
  color: #15803d;
}

.result-status-badge.incorrect {
  background-color: #fee2e2;
  color: #b91c1c;
}

.explanation-box {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background-color: #ffffff;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}

.explanation-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ========================================================
   MODAL WINDOWS (LOGIN, UPLOAD, TEST BUILDER)
   ======================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-xl);
  max-width: 580px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  animation: modalPop 0.25s ease-out;
}

.modal-card.wide {
  max-width: 820px;
}

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

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--text-main);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  color: var(--text-main);
  transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

.form-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Test Builder Specific Forms */
.builder-question-item {
  background-color: var(--bg-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
  position: relative;
}

.builder-question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

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

.builder-option-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.builder-radio-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  white-space: nowrap;
  color: var(--text-muted);
}

/* Admin Only visibility helper */
.admin-only {
  display: none !important;
}

body.is-admin .admin-only {
  display: inline-flex !important;
}

body.is-admin div.admin-only,
body.is-admin button.admin-only {
  display: flex !important;
}

/* Footer */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background-color: #ffffff;
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.2rem;
  }
  .subject-page-title {
    font-size: 2rem;
  }
  .tabs-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
  .tabs-nav {
    overflow-x: auto;
  }
  .tab-btn {
    padding: 0.75rem 1rem;
  }
  .modal-card {
    max-height: 95vh;
  }
}
