/* ==========================================================================
   Easy Grade Calculator — Hand-Crafted Modern Design System (Humanized Edition)
   Clean, refined, professional EdTech UI with subtle typography & elevation
   ========================================================================== */

:root {
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', 'Inter', system-ui, sans-serif;

  /* Humanized Refined Light Palette - Crisp & Professional */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-box: #f1f5f9;
  --bg-input: #ffffff;
  --border-card: #e2e8f0;
  --border-glow: #cbd5e1;
  --border-focus: #2563eb;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-soft: #eff6ff;

  /* Grade Colors - Authentic Clean Palette */
  --grade-a: #059669;
  --grade-a-bg: #ecfdf5;
  --grade-b: #0284c7;
  --grade-b-bg: #f0f9ff;
  --grade-c: #d97706;
  --grade-c-bg: #fffbeb;
  --grade-d: #ea580c;
  --grade-d-bg: #fff7ed;
  --grade-f: #dc2626;
  --grade-f-bg: #fef2f2;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.05), 0 6px 16px -4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 30px -5px rgba(15, 23, 42, 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
}

/* Dark Theme Overrides - Clean Slate Style */
[data-theme="dark"] {
  --bg-page: #0f172a;
  --bg-card: #1e293b;
  --bg-box: #0f172a;
  --bg-input: #0f172a;
  --border-card: #334155;
  --border-glow: #475569;
  --border-focus: #3b82f6;

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;

  --accent-primary: #3b82f6;
  --accent-primary-hover: #60a5fa;
  --accent-soft: rgba(59, 130, 246, 0.14);

  --grade-a: #34d399;
  --grade-a-bg: rgba(16, 185, 129, 0.15);
  --grade-b: #38bdf8;
  --grade-b-bg: rgba(56, 189, 248, 0.15);
  --grade-c: #fbbf24;
  --grade-c-bg: rgba(251, 191, 36, 0.15);
  --grade-d: #fb923c;
  --grade-d-bg: rgba(251, 146, 60, 0.15);
  --grade-f: #f87171;
  --grade-f-bg: rgba(248, 113, 113, 0.15);

  --shadow-card: 0 4px 16px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.6);
}

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

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Remove AI floating glow artifacts */
.ambient-glow {
  display: none !important;
}

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

/* Navbar - Clean Glass Header */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-card);
  padding: 0.65rem 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: opacity 0.15s ease;
}

.logo:hover {
  opacity: 0.9;
}

.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.logo-text {
  display: flex;
  align-items: center;
}

.logo-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.nav-tabs {
  display: flex;
  background: var(--bg-box);
  padding: 3px;
  border-radius: var(--radius-md);
  gap: 2px;
  border: 1px solid var(--border-card);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.85rem;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-tab:hover {
  color: var(--text-main);
}

.nav-tab.active {
  background: var(--bg-card);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-card);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  color: var(--text-main);
  border-color: var(--border-focus);
  background: var(--bg-box);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* Language Selector Dropdown */
.lang-switcher {
  position: relative;
  display: inline-block;
}

.lang-btn {
  height: 34px;
  padding: 0 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 155px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 0.35rem 0;
  list-style: none;
  z-index: 1000;
  display: none;
}

.lang-switcher:hover .lang-dropdown,
.lang-switcher:focus-within .lang-dropdown,
.lang-dropdown.show {
  display: block;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.lang-option:hover {
  background: var(--bg-box);
  color: var(--text-main);
}

.lang-option.active {
  color: var(--accent-primary);
  font-weight: 700;
  background: rgba(37, 99, 235, 0.08);
}

/* Single-Row Responsive Navigation for Desktop, DevTools & Mobile */
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.logo {
  flex-shrink: 0;
}

.nav-tabs {
  display: flex;
  align-items: center;
  background: var(--bg-box);
  padding: 3px;
  border-radius: var(--radius-md);
  gap: 3px;
  border: 1px solid var(--border-card);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-actions {
  flex-shrink: 0;
}

.mobile-tool-bar {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 0.55rem 0.85rem;
  margin-bottom: 1rem;
  align-items: center;
  gap: 0.65rem;
  box-shadow: var(--shadow-sm);
}

.mobile-tool-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.mobile-tool-select {
  flex: 1;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.65rem;
  outline: none;
}

@media (max-width: 640px) {
  .logo-title {
    display: none;
  }
  .mobile-tool-bar {
    display: flex;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.85rem;
  }
  
  .card {
    padding: 1.15rem;
  }

  .logo-title {
    font-size: 1.1rem;
  }

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

  .btn-icon {
    width: 32px;
    height: 32px;
  }
}

.main-content {
  flex: 1;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.18s ease-out forwards;
}

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

/* Card Styling - Authentic Clean Design */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.hero-card {
  border-left: 4px solid var(--accent-primary);
}

.card-header {
  margin-bottom: 1.15rem;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.015em;
}

.card-title-md {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 850px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.25rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.max-w-4xl { max-width: 860px; }
.mx-auto { margin-left: auto; margin-right: auto; }

.ez-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 1.15rem;
  align-items: end;
}

@media (max-width: 850px) {
  .ez-inputs-grid {
    grid-template-columns: 1fr;
  }
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

.label-with-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.text-link-btn {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.stepper-box {
  display: flex;
  align-items: center;
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 40px;
}

.stepper-box:focus-within {
  border-color: var(--border-focus);
}

.stepper-btn {
  width: 40px;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.stepper-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.stepper-input {
  flex: 1;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  outline: none;
}

.form-control {
  width: 100%;
  height: 40px;
  padding: 0 0.8rem;
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 14px;
  padding-right: 2.3rem;
  cursor: pointer;
}

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

.input-with-suffix input {
  padding-right: 2rem;
}

.input-suffix {
  position: absolute;
  right: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.82rem;
}

.quick-presets {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.preset-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
}

.btn-preset, .btn-preset-goal {
  padding: 2px 7px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  background: var(--bg-box);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-preset:hover, .btn-preset-goal:hover {
  background: var(--accent-soft);
  color: var(--accent-primary);
  border-color: var(--border-focus);
}

.options-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input { display: none; }

.toggle-slider {
  width: 32px;
  height: 17px;
  background: #cbd5e1;
  border-radius: 20px;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(15px);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.48rem 0.95rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
}

.btn-secondary {
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  color: var(--text-main);
}

.btn-secondary:hover {
  border-color: var(--text-muted);
  background: var(--bg-card);
}

.btn-accent {
  background: var(--accent-soft);
  color: var(--accent-primary);
  border: 1px solid var(--border-card);
}

.btn-accent:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.score-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-top: 1.15rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.grade-badge-xl {
  min-width: 50px;
  width: auto;
  max-width: max-content;
  height: 48px;
  padding: 0 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.grade-badge-xl.a, .badge-grade.a, .grade-badge-md.a { background: var(--grade-a-bg); color: var(--grade-a); border: 1px solid var(--grade-a); }
.grade-badge-xl.b, .badge-grade.b, .grade-badge-md.b { background: var(--grade-b-bg); color: var(--grade-b); border: 1px solid var(--grade-b); }
.grade-badge-xl.c, .badge-grade.c, .grade-badge-md.c { background: var(--grade-c-bg); color: var(--grade-c); border: 1px solid var(--grade-c); }
.grade-badge-xl.d, .badge-grade.d, .grade-badge-md.d { background: var(--grade-d-bg); color: var(--grade-d); border: 1px solid var(--grade-d); }
.grade-badge-xl.f, .badge-grade.f, .grade-badge-md.f { background: var(--grade-f-bg); color: var(--grade-f); border: 1px solid var(--grade-f); }

.grade-badge-md {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.score-main {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}

.score-fraction {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-pill {
  padding: 3px 9px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill.pass {
  background: var(--grade-a-bg);
  color: var(--grade-a);
  border: 1px solid var(--grade-a);
}

.status-pill.fail {
  background: var(--grade-f-bg);
  color: var(--grade-f);
  border: 1px solid var(--grade-f);
}

.chart-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-count {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--bg-box);
  color: var(--text-muted);
  border: 1px solid var(--border-card);
}

.chart-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0 0.5rem;
  height: 32px;
}

.search-box input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  outline: none;
  width: 130px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  max-height: 420px;
  overflow-y: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  margin-top: 0.65rem;
}

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

.data-table th {
  position: sticky;
  top: 0;
  background: var(--bg-box);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border-card);
  z-index: 10;
}

.data-table td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border-card);
  color: var(--text-main);
}

.data-table tbody tr.active-row {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent-primary);
}

.badge-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 5px;
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
}

.input-table td {
  padding: 0.35rem;
}

.btn-remove-row {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.1rem;
}

.btn-remove-row:hover {
  color: var(--grade-f);
}

.course-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-top: 1rem;
}

.summary-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.metric-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
}

.metric-value.highlight {
  color: var(--accent-primary);
}

.final-solver-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.65rem;
}

.solver-result-card {
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  text-align: center;
}

.solver-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.solver-big-score {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-primary);
  margin: 0.15rem 0;
}

.solver-status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 12px;
  background: var(--grade-a-bg);
  color: var(--grade-a);
  border: 1px solid var(--grade-a);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.solver-status-badge.hard {
  background: var(--grade-c-bg);
  color: var(--grade-c);
  border-color: var(--grade-c);
}

.solver-status-badge.impossible {
  background: var(--grade-f-bg);
  color: var(--grade-f);
  border-color: var(--grade-f);
}

.solver-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.sim-slider-box {
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
}

.sim-slider {
  width: 100%;
  height: 5px;
  border-radius: 4px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.sim-output {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
}

.gpa-summary-banner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.gpa-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gpa-value {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.gpa-value.highlight {
  color: var(--accent-primary);
}

.gpa-type {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.15rem;
}

.gpa-divider {
  width: 1px;
  height: 36px;
  background: var(--border-card);
}

.header-btn-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.category-breakdown-wrapper {
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
}

.breakdown-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.breakdown-status {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.category-breakdown-bar {
  display: flex;
  height: 12px;
  width: 100%;
  background: var(--bg-card);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 0.45rem;
  border: 1px solid var(--border-card);
}

.breakdown-segment {
  height: 100%;
  transition: width 0.3s ease;
  position: relative;
}

.target-gauge-box {
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
}

.gauge-label-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.gauge-bar-bg {
  height: 8px;
  width: 100%;
  background: var(--bg-card);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border-card);
}

.gauge-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.35s ease, background-color 0.35s ease;
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
  font-weight: 500;
}

.saved-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 280px;
  overflow-y: auto;
}

.saved-course-card {
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.saved-course-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.saved-course-details {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.toast {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  background: var(--text-main);
  color: var(--bg-card);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.84rem;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transition: all 0.2s ease;
}

.toast.hidden {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

/* Infographic Image Container Styling */
.seo-hero-image-container {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  display: flex;
  justify-content: center;
  align-items: center;
}

.seo-hero-image-container img,
.infographic-img {
  width: 100%;
  height: auto;
  max-height: 550px;
  display: block;
  object-fit: contain;
  border-radius: var(--radius-lg);
}

/* FAQ Container & Cards Styling */
.faq-container {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-card);
}

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

.faq-card {
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}

.faq-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-primary);
  opacity: 0.6;
  transition: opacity 0.18s ease;
}

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

.faq-card:hover::before {
  opacity: 1;
}

.faq-question {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.45rem;
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.faq-answer {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border-card);
  background: var(--bg-card);
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.4fr;
  gap: 2.5rem;
  padding: 3rem 0 2.5rem;
  align-items: flex-start;
}

/* Column 1: Brand */
.footer-col-brand {}

.footer-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  margin-bottom: 1rem;
}

.footer-brand-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.footer-brand-name small {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  opacity: 0.75;
}

.footer-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin: 0;
  max-width: 280px;
}

/* Columns 2-4 */
.footer-col-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.9rem;
  letter-spacing: 0.01em;
}

.footer-col-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-col-links a {
  font-size: 0.85rem;
  color: var(--accent-primary);
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.15s;
  word-break: break-all;
}

.footer-col-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Bottom Bar */
.footer-bottom {
  border-top: 1px solid var(--border-card);
  padding: 0.95rem 0;
}

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

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-bottom-right {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 900px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .footer-col-brand {
    grid-column: span 2;
  }
  .footer-desc {
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .footer-top {
    grid-template-columns: 1fr;
    padding: 2rem 0 1.5rem;
  }
  .footer-col-brand {
    grid-column: span 1;
  }
  .footer-bottom-inner {
    justify-content: center;
    text-align: center;
  }
}


.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 92%;
  max-width: 640px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Flag Preset Cards UI */
.preset-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-top: 0.65rem;
  margin-bottom: 1.25rem;
}

.preset-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
}

.preset-card:hover {
  border-color: var(--border-focus);
  background: var(--bg-card);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.preset-card.active {
  border-color: var(--accent-primary);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-primary);
}

.preset-flag-badge {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.preset-info {
  flex: 1;
  min-width: 0;
}

.preset-name {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-check-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.preset-card.active .preset-check-icon {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

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

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
}

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

.modal-close {
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  color: var(--text-muted);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-focus);
}

.modal-body {
  padding: 1.25rem;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cutoff-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: var(--bg-box);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  margin-bottom: 0.3rem;
  transition: border-color 0.15s ease;
}

.modal-footer {
  padding: 0.75rem 1.15rem;
  border-top: 1px solid var(--border-card);
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  background: var(--bg-box);
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
  }
  .navbar, .ambient-glow, .quick-presets, .chart-header-actions, .nav-actions, .footer, .seo-section, .btn, .stepper-btn, .modal-overlay {
    display: none !important;
  }
  .main-content {
    padding: 0 !important;
    margin: 0 !important;
  }
  .card {
    background: #fff !important;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    break-inside: avoid;
  }
  .tab-pane {
    display: block !important;
  }
  .tab-pane:not(.active) {
    display: none !important;
  }
  .data-table {
    width: 100% !important;
    border-collapse: collapse !important;
  }
  .data-table th, .data-table td {
    border: 1px solid #ddd !important;
    padding: 8px !important;
    color: #000 !important;
  }
  .score-banner, .gpa-summary-banner, .course-summary-card {
    border: 2px solid #000 !important;
    background: #f8fafc !important;
    color: #000 !important;
  }
}
