/* ==========================================================================
   Master Design System - Multi-Country Grade & EOC Calculator
   High-Performance Vanilla CSS3 with Light/Dark Themes & Glassmorphism
   ========================================================================== */

:root {
  /* Core Brand & Gradients */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-900: #1e3a8a;

  --gradient-brand: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #7c3aed 100%);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.15) 0%, transparent 70%);

  /* Status Accents */
  --accent-emerald: #10b981;
  --accent-emerald-bg: rgba(16, 185, 129, 0.12);
  --accent-emerald-text: #065f46;
  --accent-blue: #3b82f6;
  --accent-blue-bg: rgba(59, 130, 246, 0.12);
  --accent-blue-text: #1e40af;
  --accent-amber: #f59e0b;
  --accent-amber-bg: rgba(245, 158, 11, 0.12);
  --accent-amber-text: #92400e;
  --accent-orange: #f97316;
  --accent-orange-bg: rgba(249, 115, 22, 0.12);
  --accent-orange-text: #9a3412;
  --accent-rose: #ef4444;
  --accent-rose-bg: rgba(239, 68, 68, 0.12);
  --accent-rose-text: #991b1b;

  /* Light Mode Tokens (Default) */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #cbd5e1;
  --border-focus: #2563eb;
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-faint: #475569;
  --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.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 25px rgba(37, 99, 235, 0.18);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --transition-fast: 150ms ease;
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Tokens */
[data-theme="dark"] {
  --bg-page: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1e293b;
  --bg-subtle: #1e293b;
  --border-color: #334155;
  --border-focus: #60a5fa;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-faint: #94a3b8;
  --accent-emerald-text: #6ee7b7;
  --accent-blue-text: #93c5fd;
  --accent-amber-text: #fcd34d;
  --accent-orange-text: #fdba74;
  --accent-rose-text: #fca5a5;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.25);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.22) 0%, transparent 70%);
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--bg-page);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: var(--gradient-glow);
  background-repeat: no-repeat;
  background-attachment: fixed;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

button, input, select {
  font-family: inherit;
  font-size: inherit;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

[data-theme="dark"] .site-header {
  background: rgba(17, 24, 39, 0.85);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: var(--gradient-brand);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  background: var(--primary-100);
  color: var(--primary-700);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

[data-theme="dark"] .brand-badge {
  background: rgba(37, 99, 235, 0.25);
  color: var(--primary-200);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-600);
}

[data-theme="dark"] .nav-link:hover, [data-theme="dark"] .nav-link.active {
  color: var(--primary-400);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Country Selector Dropdown */
.country-select-wrapper {
  position: relative;
}

.country-select {
  appearance: none;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}

.country-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.country-select-arrow {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.theme-toggle-btn:hover {
  color: var(--text-main);
}

/* ==========================================================================
   Mobile Hamburger Button & Mobile Drawer
   ========================================================================== */
.mobile-menu-btn {
  display: none;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  padding: 0;
  margin: 0;
  line-height: 0;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--primary-400);
}

.mobile-menu-btn svg {
  display: block;
  flex-shrink: 0;
  margin: auto;
}

.mobile-menu-btn .close-icon {
  display: none;
}

.mobile-menu-btn.active .hamburger-icon {
  display: none;
}

.mobile-menu-btn.active .close-icon {
  display: block;
}

/* Mobile Drawer Backdrop */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.mobile-nav-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Mobile Drawer Container */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
  overflow-y: auto;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.2);
}

.mobile-nav-drawer.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

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

.mobile-drawer-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.mobile-close-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mobile-close-btn:hover {
  color: var(--text-main);
  border-color: var(--border-focus);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background: var(--primary-50);
  color: var(--primary-600);
}

[data-theme="dark"] .mobile-nav-link:hover,
[data-theme="dark"] .mobile-nav-link.active {
  background: rgba(37, 99, 235, 0.2);
  color: var(--primary-300);
}

.mobile-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-600);
  flex-shrink: 0;
}

[data-theme="dark"] .mobile-nav-icon {
  color: var(--primary-400);
}

.mobile-nav-divider {
  height: 1px;
  background: var(--border-color);
  margin: 1.25rem 0;
}

.mobile-nav-section {
  display: flex;
  flex-direction: column;
}

.mobile-nav-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: block;
}

.mobile-country-wrapper {
  position: relative;
  width: 100%;
}

.mobile-country-select {
  width: 100%;
  padding: 0.65rem 2rem 0.65rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
}

.mobile-drawer-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
}

.mobile-footer-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.mobile-footer-link:hover {
  color: var(--primary-600);
}

.mobile-footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Hero & Top Banner
   ========================================================================== */
.hero-section {
  text-align: center;
  padding: 2.5rem 1.25rem 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--primary-700);
  margin-bottom: 1.25rem;
}

[data-theme="dark"] .hero-tag {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--primary-200);
}

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

.hero-title span {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Preset Pills */
.preset-pills-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

/* Flag Icons */
.flag-icon {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.flag-icon-lg {
  width: 32px;
  height: 22px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: inline-block;
}

.state-code-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 24px;
  background: var(--primary-100);
  color: var(--primary-700);
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  border: 1px solid var(--primary-200);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .state-code-badge {
  background: rgba(37, 99, 235, 0.25);
  color: var(--primary-200);
  border-color: rgba(37, 99, 235, 0.4);
}

.preset-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.preset-pill:hover, .preset-pill.active {
  border-color: var(--primary-500);
  background: var(--primary-50);
  color: var(--primary-700);
}

[data-theme="dark"] .preset-pill:hover, [data-theme="dark"] .preset-pill.active {
  background: rgba(37, 99, 235, 0.2);
  color: #ffffff;
}

/* ==========================================================================
   Main Calculator Grid Layout
   ========================================================================== */
.main-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem 4rem;
  width: 100%;
}

.calculator-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 2.5rem;
}

/* Tabs switcher */
.calc-tabs {
  display: flex;
  background: var(--bg-subtle);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  gap: 0.25rem;
}

.calc-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.calc-tab-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Calculator Grid */
.calc-layout-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
}

@media (max-width: 860px) {
  .calc-layout-grid {
    grid-template-columns: 1fr;
  }
}

/* Form Inputs */
.calc-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.label-hint {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.calc-input {
  width: 100%;
  padding: 0.85rem 3.5rem 0.85rem 1rem;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1.25rem;
  font-weight: 700;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.calc-input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-surface);
}

.input-unit {
  position: absolute;
  right: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

.quick-weight-chips {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.chip-btn {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chip-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-500);
  color: var(--primary-700);
}

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

[data-theme="dark"] .chip-btn:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: var(--primary-500);
  color: var(--primary-300);
}

/* ==========================================================================
   Results Display Panel
   ========================================================================== */
.results-panel {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
}

.result-target-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
}

.result-big-number {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--primary-600);
  margin: 0.5rem 0;
  transition: color var(--transition-normal);
}

[data-theme="dark"] .result-big-number {
  color: var(--primary-400);
}

.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
  margin: 0.5rem auto 1rem;
}

.badge-emerald {
  background: #dcfce7;
  color: #14532d;
  border: 1px solid #86efac;
}

.badge-blue {
  background: #dbeafe;
  color: #1e3a8a;
  border: 1px solid #93c5fd;
}

.badge-amber {
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #fcd34d;
}

.badge-orange {
  background: #ffedd5;
  color: #7c2d12;
  border: 1px solid #fdba74;
}

.badge-rose {
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #fca5a5;
}

[data-theme="dark"] .badge-emerald {
  background: #064e3b;
  color: #a7f3d0;
  border: 1px solid #059669;
}

[data-theme="dark"] .badge-blue {
  background: #1e3a8a;
  color: #bfdbfe;
  border: 1px solid #2563eb;
}

[data-theme="dark"] .badge-amber {
  background: #78350f;
  color: #fde68a;
  border: 1px solid #d97706;
}

[data-theme="dark"] .badge-orange {
  background: #7c2d12;
  color: #fed7aa;
  border: 1px solid #ea580c;
}

[data-theme="dark"] .badge-rose {
  background: #7f1d1d;
  color: #fecdd3;
  border: 1px solid #e11d48;
}

.result-summary-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.add-to-semester-btn {
  background: var(--gradient-brand);
  border: none;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.925rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.add-to-semester-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

/* ==========================================================================
   Interactive "What-If" Slider
   ========================================================================== */
.what-if-box {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.what-if-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.what-if-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.what-if-score-pill {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--primary-600);
}

[data-theme="dark"] .what-if-score-pill {
  color: var(--primary-400);
}

.slider-wrapper {
  position: relative;
  margin: 1.25rem 0 0.5rem;
}

.custom-range-slider {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--border-color);
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.custom-range-slider::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-600);
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
  cursor: grab;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.custom-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.custom-range-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-600);
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
  cursor: grab;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.775rem;
  color: var(--text-muted);
  font-weight: 500;
}

.what-if-outcome-text {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-subtle);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  text-align: center;
}

/* ==========================================================================
   Secondary Scenarios ("Have Another Question?")
   ========================================================================== */
.secondary-section {
  margin-bottom: 2.5rem;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.scenario-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.scenario-card:hover {
  border-color: var(--primary-400);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.scenario-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scenario-card-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Scenario Modal / Drawer */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  animation: modalEnter 200ms ease;
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

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

/* ==========================================================================
   Multi-Course Semester Planner (LocalStorage)
   ========================================================================== */
.semester-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.5rem;
}

.semester-table-wrapper {
  overflow-x: auto;
  margin: 1.25rem 0;
}

.semester-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.semester-table th,
.semester-table td.action-header {
  padding: 0.75rem 1rem;
  background: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
  font-size: 0.9rem;
}

.semester-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.empty-state-box {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.table-action-btn {
  background: transparent;
  border: none;
  color: var(--accent-rose);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  transition: transform var(--transition-fast);
}

.table-action-btn:hover {
  transform: scale(1.2);
}

.semester-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-secondary {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--border-color);
}

/* ==========================================================================
   International Hub Grid
   ========================================================================== */
.international-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 3rem;
}

.hub-country-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.hub-country-card:hover {
  border-color: var(--primary-500);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.hub-country-flag {
  font-size: 1.75rem;
}

.hub-country-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.hub-country-scale {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hub-country-link {
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-600);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ==========================================================================
   SEO Content, Math Formula & FAQ Section
   ========================================================================== */
.content-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  margin-bottom: 2rem;
  line-height: 1.7;
  color: var(--text-main);
}

.content-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.content-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  color: var(--text-main);
}

.content-card p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.formula-display-box {
  background: var(--bg-subtle);
  border-left: 4px solid var(--primary-600);
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-700);
  margin: 1.25rem 0;
  text-align: center;
  overflow-x: auto;
  word-break: break-word;
}

[data-theme="dark"] .formula-display-box {
  color: var(--primary-200);
}

.faq-item {
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.faq-answer {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.25rem 2rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-links-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-group-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.footer-link {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--primary-600);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.825rem;
  color: var(--text-faint);
}

/* ==========================================================================
   Responsive Breakpoints & System Adaptability
   ========================================================================== */

/* Tablet & Mobile Header Transition (<= 991px) */
@media (max-width: 991px) {
  .header-nav {
    display: none !important;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .header-inner {
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }
}

/* Medium Tablets & Phablets (<= 860px) */
@media (max-width: 860px) {
  .calc-layout-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .scenarios-grid {
    grid-template-columns: 1fr;
  }

  .international-hub-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

/* Mobile Devices (<= 640px) */
@media (max-width: 640px) {
  html {
    font-size: 15px;
  }

  .hero-section {
    padding: 1.75rem 0.875rem 1rem;
  }

  .hero-title {
    font-size: clamp(1.75rem, 6.5vw, 2.25rem);
  }

  .hero-subtitle {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .hero-tag {
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .main-container {
    padding: 0.75rem 0.875rem 3rem;
  }

  .calculator-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.75rem;
  }

  .calc-tabs {
    padding: 0.25rem;
    margin-bottom: 1.25rem;
  }

  .calc-tab-btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.35rem;
  }

  .calc-input {
    font-size: 1.15rem;
    padding: 0.75rem 3rem 0.75rem 0.85rem;
  }

  .results-panel {
    padding: 1.25rem 1rem;
  }

  .result-big-number {
    font-size: 3rem;
  }

  .what-if-box {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
  }

  .semester-section {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }

  .section-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .semester-table th,
  .semester-table td {
    padding: 0.65rem 0.5rem;
    font-size: 0.825rem;
  }

  .content-card {
    padding: 1.5rem 1.15rem !important;
  }

  .site-footer {
    padding: 2.5rem 1rem 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .modal-content {
    padding: 1.25rem 1rem;
  }
}

/* Small Screens / iPhone SE / 360px Devices (<= 420px) */
@media (max-width: 420px) {
  .brand-logo {
    font-size: 1.05rem;
    gap: 0.5rem;
  }

  .brand-icon {
    width: 30px;
    height: 30px;
  }

  .brand-icon svg {
    width: 17px;
    height: 17px;
  }

  .theme-toggle-btn {
    width: 34px;
    height: 34px;
  }

  .mobile-menu-btn {
    width: 34px;
    height: 34px;
  }

  .mobile-menu-btn svg {
    width: 18px;
    height: 18px;
  }

  .quick-weight-chips {
    gap: 0.3rem;
  }

  .chip-btn {
    padding: 0.2rem 0.45rem;
    font-size: 0.725rem;
  }

  .result-big-number {
    font-size: 2.5rem;
  }

  .semester-footer-actions {
    flex-direction: column;
    width: 100%;
  }

  .semester-footer-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .preset-pill {
    padding: 0.3rem 0.6rem;
    font-size: 0.775rem;
  }
}

/* ==========================================================================
   Print Stylesheet
   ========================================================================== */
@media print {
  .site-header, .hero-section, .calc-tabs, .secondary-section, .international-hub-grid, .content-card, .site-footer, .header-controls, .btn-secondary, .table-action-btn {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .main-container {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .calculator-card, .semester-section {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
}
