 *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    
    :root {
      --bg: #f8f7fc;
      --fg: #1a1625;
      --card: rgba(255, 255, 255, 0.7);
      --card-fg: #1a1625;
      --primary: #7c3aed;
      --primary-fg: #ffffff;
      --secondary: #e9e5f5;
      --secondary-fg: #4a4458;
      --muted: #9ca3af;
      --border: #e5e2ef;
      --input: #f3f1f9;
      --success: #22c55e;
      --warning: #eab308;
      --danger: #ef4444;
      --accent: #14b8a6;
      --chart-1: #22c55e;
      --chart-2: #8b5cf6;
      --chart-3: #f59e0b;
      --chart-4: #06b6d4;
      --radius: 1rem;
    }
    
    .dark {
      --bg: #0f0a1a;
      --fg: #f4f3f8;
      --card: rgba(30, 25, 45, 0.6);
      --card-fg: #f4f3f8;
      --primary: #a78bfa;
      --primary-fg: #0f0a1a;
      --secondary: #2d2640;
      --secondary-fg: #d4d0e0;
      --muted: #71717a;
      --border: #3d3654;
      --input: #2d2640;
      --success: #4ade80;
      --warning: #fbbf24;
      --danger: #f87171;
      --accent: #2dd4bf;
    }
    
    body {
      font-family: 'Inter', system-ui, sans-serif;
      background: var(--bg);
      color: var(--fg);
      min-height: 100vh;
      line-height: 1.6;
      transition: background 0.3s, color 0.3s;
    }
    
    .container { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem; }
    
    /* Background Decoration */
    .bg-decoration {
      position: fixed;
      inset: 0;
      overflow: hidden;
      pointer-events: none;
      z-index: 0;
    }
    .bg-decoration .blob {
      position: absolute;
      border-radius: 50%;
      filter: blur(80px);
      opacity: 0.15;
    }
    .bg-decoration .blob-1 { top: -10rem; right: -10rem; width: 20rem; height: 20rem; background: var(--primary); }
    .bg-decoration .blob-2 { top: 50%; left: -10rem; width: 24rem; height: 24rem; background: var(--accent); }
    .bg-decoration .blob-3 { bottom: -10rem; right: 33%; width: 18rem; height: 18rem; background: var(--success); }
    
    /* Header */
    header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 2rem;
      position: relative;
      z-index: 10;
    }
    .logo {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }
    .logo-icon {
      padding: 0.5rem;
      border-radius: 0.75rem;
      background: rgba(124, 58, 237, 0.1);
      color: var(--primary);
    }
    .logo h1 { font-size: 1.5rem; font-weight: 700; }
    .logo p { font-size: 0.875rem; color: var(--muted); }
    
    /* Theme Toggle */
    .theme-toggle {
      padding: 0.5rem;
      border-radius: 0.75rem;
      border: 1px solid var(--border);
      background: var(--card);
      cursor: pointer;
      transition: all 0.2s;
      backdrop-filter: blur(16px);
    }
    .theme-toggle:hover { background: var(--secondary); }
    .theme-toggle svg { width: 1.25rem; height: 1.25rem; color: var(--fg); }
    
    /* Cards */
    .card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      backdrop-filter: blur(16px);
      box-shadow: 0 4px 24px rgba(0,0,0,0.08);
      overflow: hidden;
    }
    .card-header {
      padding: 1.25rem 1.5rem;
      border-bottom: 1px solid var(--border);
    }
    .card-title {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 1rem;
      font-weight: 600;
    }
    .card-content { padding: 1.5rem; }
    
    /* Grid Layout */
    .main-grid {
      display: grid;
      gap: 1.5rem;
      position: relative;
      z-index: 10;
    }
    @media (min-width: 1024px) {
      .main-grid { grid-template-columns: 2fr 1fr; }
    }
    
    /* Form Elements */
    .form-group { margin-bottom: 1rem; }
    .form-row {
      display: grid;
      gap: 1rem;
    }
    @media (min-width: 640px) {
      .form-row { grid-template-columns: repeat(3, 1fr); }
    }
    label {
      display: block;
      font-size: 0.875rem;
      font-weight: 500;
      margin-bottom: 0.5rem;
      color: var(--card-fg);
    }
    input[type="number"] {
      width: 100%;
      padding: 0.75rem 1rem;
      border: 1px solid var(--border);
      border-radius: 0.5rem;
      background: var(--input);
      color: var(--fg);
      font-size: 1rem;
      transition: border-color 0.2s;
    }
    input[type="number"]:focus {
      outline: none;
      border-color: var(--primary);
    }
    input[type="number"]::placeholder { color: var(--muted); }
    
    /* Buttons */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      padding: 0.75rem 1.5rem;
      border-radius: 0.75rem;
      font-size: 0.875rem;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s;
      border: none;
    }
    .btn-primary {
      background: var(--primary);
      color: var(--primary-fg);
    }
    .btn-primary:hover { opacity: 0.9; transform: scale(1.02); }
    .btn-primary:active { transform: scale(0.98); }
    .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
    .btn-outline {
      background: transparent;
      border: 1px solid var(--border);
      color: var(--fg);
    }
    .btn-outline:hover { background: var(--secondary); }
    .btn-group { display: flex; gap: 0.75rem; margin-top: 1rem; }
    .btn-group .btn { flex: 1; }
    
    /* Advanced Options */
    .advanced-toggle {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.875rem;
      color: var(--primary);
      cursor: pointer;
      background: none;
      border: none;
      padding: 0;
      margin: 0.5rem 0;
    }
    .advanced-toggle:hover { opacity: 0.8; }
    .advanced-options {
      display: none;
      padding: 1rem;
      margin-top: 0.5rem;
      border-radius: 0.75rem;
      background: rgba(124, 58, 237, 0.05);
      border: 1px solid var(--border);
    }
    .advanced-options.show { display: block; }
    .advanced-row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
    .switch-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.75rem;
      background: var(--bg);
      border-radius: 0.5rem;
    }
    .switch {
      position: relative;
      width: 44px;
      height: 24px;
    }
    .switch input { opacity: 0; width: 0; height: 0; }
    .switch-slider {
      position: absolute;
      inset: 0;
      background: var(--border);
      border-radius: 24px;
      cursor: pointer;
      transition: 0.3s;
    }
    .switch-slider::before {
      content: '';
      position: absolute;
      width: 18px;
      height: 18px;
      left: 3px;
      bottom: 3px;
      background: white;
      border-radius: 50%;
      transition: 0.3s;
    }
    .switch input:checked + .switch-slider { background: var(--primary); }
    .switch input:checked + .switch-slider::before { transform: translateX(20px); }
    
    /* Results Section */
    .results { display: none; }
    .results.show { display: block; }
    .result-main {
      text-align: center;
      padding: 1.5rem 0;
    }
    .result-emoji { font-size: 2.5rem; margin-bottom: 0.5rem; }
    .result-score {
      font-size: 3rem;
      font-weight: 700;
      margin-bottom: 0.25rem;
    }
    .result-score.easy { color: var(--success); }
    .result-score.moderate { color: var(--warning); }
    .result-score.hard { color: var(--danger); }
    .result-score.impossible { color: var(--danger); }
    .result-label { color: var(--muted); }
    .result-message { margin-top: 0.75rem; font-weight: 500; }
    
    /* Result Card Colors */
    .result-card.easy { background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.3); }
    .result-card.moderate { background: rgba(234, 179, 8, 0.1); border-color: rgba(234, 179, 8, 0.3); }
    .result-card.hard { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }
    .result-card.impossible { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }
    
    /* Scenarios Grid */
    .scenarios {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0.75rem;
      margin: 1.5rem 0;
    }
    .scenario {
      text-align: center;
      padding: 0.75rem;
      border-radius: 0.75rem;
      background: rgba(255,255,255,0.5);
      border: 1px solid var(--border);
    }
    .dark .scenario { background: rgba(0,0,0,0.2); }
    .scenario-icon { margin-bottom: 0.25rem; }
    .scenario-label { font-size: 0.75rem; color: var(--muted); }
    .scenario-value { font-size: 1.125rem; font-weight: 600; }
    
    /* Formula Breakdown */
    .formula-box {
      padding: 1rem;
      border-radius: 0.75rem;
      background: var(--secondary);
      margin-bottom: 1.5rem;
    }
    .formula-label {
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--muted);
      margin-bottom: 0.5rem;
      font-weight: 500;
    }
    .formula-code {
      font-family: 'Courier New', monospace;
      font-size: 0.875rem;
      background: var(--bg);
      padding: 0.5rem 0.75rem;
      border-radius: 0.5rem;
      display: inline-block;
      color: var(--fg);
    }
    .step {
      display: flex;
      gap: 0.75rem;
      padding: 0.75rem;
      border-radius: 0.5rem;
      background: rgba(255,255,255,0.5);
      border: 1px solid var(--border);
      margin-bottom: 0.75rem;
    }
    .dark .step { background: rgba(0,0,0,0.2); }
    .step-number {
      width: 1.5rem;
      height: 1.5rem;
      border-radius: 50%;
      background: rgba(124, 58, 237, 0.1);
      color: var(--primary);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.75rem;
      font-weight: 700;
      flex-shrink: 0;
    }
    .step-content { flex: 1; }
    .step-title { font-size: 0.875rem; font-weight: 500; margin-bottom: 0.5rem; }
    .step-calc {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.875rem;
      color: var(--muted);
    }
    .step-value {
      font-family: monospace;
      padding: 0.125rem 0.5rem;
      border-radius: 0.25rem;
      font-size: 0.8rem;
    }
    .step-value.green { background: rgba(34, 197, 94, 0.1); color: var(--success); }
    .step-value.purple { background: rgba(139, 92, 246, 0.1); color: var(--chart-2); }
    .step-value.yellow { background: rgba(234, 179, 8, 0.1); color: var(--warning); }
    .step-value.teal { background: rgba(20, 184, 166, 0.1); color: var(--accent); }
    .step-value.blue { background: rgba(6, 182, 212, 0.1); color: var(--chart-4); }
    .step-result {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin-top: 0.5rem;
      font-family: monospace;
      color: var(--fg);
    }
    .formula-final {
      padding: 1rem;
      border-radius: 0.75rem;
      background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(20, 184, 166, 0.1));
      border: 1px solid rgba(124, 58, 237, 0.2);
      text-align: center;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.75rem;
      flex-wrap: wrap;
    }
    .formula-final-score {
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--primary);
    }
    
    /* What-If Slider */
    .slider-container { margin: 1.5rem 0; }
    .slider-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1rem;
      font-size: 0.875rem;
      color: var(--muted);
    }
    .slider-value { font-weight: 600; color: var(--fg); }
    input[type="range"] {
      width: 100%;
      height: 8px;
      border-radius: 4px;
      background: var(--border);
      appearance: none;
      cursor: pointer;
    }
    input[type="range"]::-webkit-slider-thumb {
      appearance: none;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: var(--primary);
      cursor: grab;
      box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
    }
    input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; }
    .slider-labels {
      display: flex;
      justify-content: space-between;
      font-size: 0.75rem;
      color: var(--muted);
      margin-top: 0.5rem;
    }
    .whatif-result {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 2rem;
      padding: 1.25rem;
      margin-top: 1.5rem;
      border-radius: 0.75rem;
      background: var(--secondary);
      border: 1px solid var(--border);
    }
    .whatif-item { text-align: center; }
    .whatif-label { font-size: 0.875rem; color: var(--muted); margin-bottom: 0.25rem; }
    .whatif-value { font-size: 2rem; font-weight: 700; }
    .whatif-divider { width: 1px; height: 3rem; background: var(--border); }
    
    /* Study Predictor */
    .motivation-box {
      padding: 1rem;
      border-radius: 0.75rem;
      background: var(--secondary);
      text-align: center;
      margin: 1rem 0;
    }
    .motivation-emoji { font-size: 2rem; margin-bottom: 0.25rem; }
    .motivation-text { font-size: 0.875rem; color: var(--muted); }
    .study-stats {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.75rem;
    }
    .study-stat {
      text-align: center;
      padding: 0.75rem;
      border-radius: 0.75rem;
      background: rgba(255,255,255,0.5);
      border: 1px solid var(--border);
    }
    .dark .study-stat { background: rgba(0,0,0,0.2); }
    .study-stat-label { font-size: 0.75rem; color: var(--muted); }
    .study-stat-value { font-size: 1.125rem; font-weight: 600; }
    .study-stat-value.can-reach { color: var(--success); }
    .study-message {
      font-size: 0.75rem;
      text-align: center;
      margin-top: 1rem;
      padding: 0.5rem;
      border-radius: 0.5rem;
    }
    .study-message.success { background: rgba(34, 197, 94, 0.1); color: var(--success); }
    .study-message.info { color: var(--muted); }
    
    /* History Panel */
    .history-list { max-height: 300px; overflow-y: auto; }
    .history-empty {
      text-align: center;
      padding: 2rem;
      color: var(--muted);
    }
    .history-item {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 0.75rem;
      border-radius: 0.5rem;
      background: rgba(255,255,255,0.5);
      border: 1px solid var(--border);
      margin-bottom: 0.5rem;
    }
    .dark .history-item { background: rgba(0,0,0,0.2); }
    .history-score {
      font-size: 1.25rem;
      font-weight: 700;
      min-width: 60px;
    }
    .history-details { flex: 1; }
    .history-details-text { font-size: 0.875rem; }
    .history-time { font-size: 0.75rem; color: var(--muted); }
    .history-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .clear-btn {
      font-size: 0.75rem;
      color: var(--danger);
      background: none;
      border: none;
      cursor: pointer;
    }
    .clear-btn:hover { text-decoration: underline; }
    
    /* Tips Card */
    .tips-card { }
    .tips-header {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin-bottom: 0.75rem;
      font-weight: 600;
    }
    .tips-list {
      list-style: none;
      font-size: 0.875rem;
      color: var(--muted);
    }
    .tips-list li { margin-bottom: 0.5rem; }
    
    /* Chart Container */
    .chart-container {
      height: 200px;
      margin: 1rem 0;
    }
    
    /* Footer */
    footer {
      margin-top: 3rem;
      text-align: center;
      font-size: 0.875rem;
      color: var(--muted);
      position: relative;
      z-index: 10;
    }
    
    /* Utility */
    .hidden { display: none !important; }
    .space-y > * + * {}
    
    /* Icons */
    .icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

























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

:root {
  --bg: #f8fafc;
  --fg: #0f172a;
  --card: rgba(255, 255, 255, 0.8);
  --card-fg: #0f172a;
  --primary: #7c3aed;
  --primary-fg: #ffffff;
  --secondary: #f1f5f9;
  --secondary-fg: #475569;
  --muted: #94a3b8;
  --border: #e2e8f0;
  --input: #f8fafc;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #f43f5e;
  --accent: #14b8a6;
  --chart-1: #10b981;
  --chart-2: #8b5cf6;
  --chart-3: #f59e0b;
  --chart-4: #06b6d4;
  --radius: 1rem;
}

.dark {
  --bg: #0f172a;
  --fg: #f1f5f9;
  --card: rgba(30, 41, 59, 0.8);
  --card-fg: #f1f5f9;
  --primary: #a78bfa;
  --primary-fg: #0f172a;
  --secondary: #1e293b;
  --secondary-fg: #cbd5e1;
  --muted: #64748b;
  --border: #334155;
  --input: #1e293b;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;
  --accent: #2dd4bf;
}

/* ===== Base Styles ===== */
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* ===== Background Decoration ===== */
.bg-decoration {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bg-decoration .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
}

.bg-decoration .blob-1 {
  top: -10rem;
  right: -10rem;
  width: 24rem;
  height: 24rem;
  background: var(--primary);
}

.bg-decoration .blob-2 {
  top: 50%;
  left: -10rem;
  width: 28rem;
  height: 28rem;
  background: var(--accent);
}

.bg-decoration .blob-3 {
  bottom: -10rem;
  right: 33%;
  width: 20rem;
  height: 20rem;
  background: var(--success);
}

/* ===== Header ===== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  position: relative;
  z-index: 10;
}

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

.logo-icon {
  padding: 0.625rem;
  border-radius: 0.875rem;
  background: rgba(124, 58, 237, 0.1);
  color: var(--primary);
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.logo p {
  font-size: 0.875rem;
  color: var(--muted);
}

/* ===== Theme Toggle ===== */
.theme-toggle {
  padding: 0.625rem;
  border-radius: 0.875rem;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(16px);
}

.theme-toggle:hover {
  background: var(--secondary);
  transform: scale(1.05);
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--fg);
}

/* ===== Cards ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.card-content {
  padding: 1.5rem;
}

/* ===== Grid Layout ===== */
.main-grid {
  display: grid;
  gap: 1.5rem;
  position: relative;
  z-index: 10;
}

@media (min-width: 1024px) {
  .main-grid {
    grid-template-columns: 2fr 1fr;
  }
}



/* ===== Form Elements ===== */
.form-group {
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .form-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--card-fg);
}

input[type="number"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  background: var(--input);
  color: var(--fg);
  font-size: 1rem;
  transition: all 0.2s ease;
}

input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

input[type="number"]::placeholder {
  color: var(--muted);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

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

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border);
  color: var(--fg);
}

.dark .btn-outline {
  background: rgba(255, 255, 255, 0.05);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.8);
}

.dark .btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ===== Advanced Options ===== */
.advanced-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--primary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin: 0.5rem 0;
  font-weight: 500;
}

.advanced-toggle:hover {
  opacity: 0.8;
}

.advanced-options {
  display: none;
  padding: 1rem;
  margin-top: 0.5rem;
  border-radius: 0.75rem;
  background: rgba(124, 58, 237, 0.05);
  border: 1px solid var(--border);
}

.advanced-options.show {
  display: block;
}

.advanced-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 0.5rem;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: 0.3s ease;
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s ease;
}

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

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

/* ===== Results Section ===== */
.results {
  display: none;
}

.results.show {
  display: block;
}

/* Result Card with Gradient */
.result-card {
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  backdrop-filter: blur(16px);
  border: none;
}

.result-card.easy {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.result-card.moderate {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
}

.result-card.hard,
.result-card.impossible {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.15) 0%, rgba(244, 63, 94, 0.05) 100%);
}

.result-main {
  margin-bottom: 1.5rem;
}

.result-emoji {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.result-score {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  margin-bottom: 0.25rem;
}

.result-score.easy {
  color: var(--success);
}
.result-score.moderate {
  color: var(--warning);
}
.result-score.hard,
.result-score.impossible {
  color: var(--danger);
}

.result-label {
  color: var(--muted);
  font-size: 1.125rem;
}

.result-message {
  margin-top: 1rem;
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--fg);
}

/* ===== Scenario Mini Cards ===== */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.scenario-mini-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
  border: 1px solid transparent;
  transition: transform 0.2s ease;
}

.dark .scenario-mini-card {
  background: rgba(255, 255, 255, 0.05);
}

.scenario-mini-card:hover {
  transform: translateY(-2px);
}

.scenario-minimum {
  border-color: rgba(244, 63, 94, 0.3);
}

.scenario-target {
  border-color: rgba(245, 158, 11, 0.3);
}

.scenario-relaxed {
  border-color: rgba(16, 185, 129, 0.3);
}

.scenario-mini-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
}

.scenario-minimum .scenario-mini-icon {
  background: rgba(244, 63, 94, 0.1);
  color: var(--danger);
}

.scenario-target .scenario-mini-icon {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.scenario-relaxed .scenario-mini-icon {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.scenario-mini-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.scenario-mini-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
}

/* ===== Chart Container ===== */
.chart-container-horizontal {
  height: 220px;
  margin: 1rem 0;
}

.chart-caption {
  font-size: 0.75rem;
  text-align: center;
  color: var(--muted);
  margin-top: 0.75rem;
}

/* ===== Formula Breakdown ===== */
.formula-header {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(20, 184, 166, 0.05));
}

.formula-box {
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--secondary);
  margin-bottom: 1.5rem;
}

.formula-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.formula-code-wrapper {
  text-align: center;
}

.formula-code {
  font-family: "Courier New", monospace;
  font-size: 0.875rem;
  background: var(--bg);
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  display: inline-block;
  color: var(--fg);
}

.step {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.dark .step {
  background: rgba(0, 0, 0, 0.2);
}

.step-number {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.step-calc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.step-value {
  font-family: monospace;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.step-value.green {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.step-value.purple {
  background: rgba(139, 92, 246, 0.1);
  color: var(--chart-2);
}

.step-value.yellow {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.step-value.teal {
  background: rgba(20, 184, 166, 0.1);
  color: var(--accent);
}

.step-value.blue {
  background: rgba(6, 182, 212, 0.1);
  color: var(--chart-4);
}

.step-result {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-family: monospace;
  color: var(--fg);
}

.result-highlight {
  color: var(--primary);
  font-weight: 700;
}

.formula-final {
  padding: 1rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(20, 184, 166, 0.1));
  border: 1px solid rgba(124, 58, 237, 0.2);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.formula-final-label {
  color: var(--muted);
  font-size: 0.875rem;
}

.formula-final-score {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.adjustments-info {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.adjustments-title {
  font-size: 0.75rem;
  color: var(--success);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.adjustments-list {
  font-size: 0.75rem;
  color: var(--muted);
  padding-left: 1rem;
  margin: 0;
}

/* ===== Sliders ===== */
.slider-container {
  margin: 1.5rem 0;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.slider-value {
  font-weight: 700;
  color: var(--fg);
}

input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: grab;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
  transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(0.95);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: grab;
  border: none;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.whatif-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1.25rem;
  margin-top: 1.5rem;
  border-radius: 0.75rem;
  background: var(--secondary);
  border: 1px solid var(--border);
}

.whatif-item {
  text-align: center;
}

.whatif-label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.whatif-value {
  font-size: 2rem;
  font-weight: 800;
}

.whatif-divider {
  width: 1px;
  height: 3rem;
  background: var(--border);
}

.slider-hint {
  font-size: 0.75rem;
  text-align: center;
  color: var(--muted);
  margin-top: 1rem;
}

/* ===== Study Predictor ===== */
.motivation-box {
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--secondary);
  text-align: center;
  margin: 1rem 0;
}

.motivation-emoji {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.motivation-text {
  font-size: 0.875rem;
  color: var(--muted);
}

.study-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.study-stat {
  text-align: center;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border);
}

.dark .study-stat {
  background: rgba(0, 0, 0, 0.2);
}

.study-stat-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.study-stat-value {
  font-size: 1.125rem;
  font-weight: 700;
}

.study-stat-value.can-reach {
  color: var(--success);
}

.study-message {
  font-size: 0.75rem;
  text-align: center;
  margin-top: 1rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
}

.study-message.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.study-message.info {
  color: var(--muted);
}

/* ===== History Panel ===== */
.history-list {
  max-height: 300px;
  overflow-y: auto;
}

.history-empty {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

.history-empty svg {
  margin: 0 auto 0.5rem;
  display: block;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.dark .history-item {
  background: rgba(0, 0, 0, 0.2);
}

.history-score {
  font-size: 1.25rem;
  font-weight: 700;
  min-width: 60px;
}

.history-details {
  flex: 1;
}

.history-details-text {
  font-size: 0.875rem;
}

.history-time {
  font-size: 0.75rem;
  color: var(--muted);
}

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

.clear-btn {
  font-size: 0.75rem;
  color: var(--danger);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
}

.clear-btn:hover {
  text-decoration: underline;
}

/* ===== Tips Card ===== */
.tips-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.tips-list {
  list-style: none;
  font-size: 0.875rem;
  color: var(--muted);
}

.tips-list li {
  margin-bottom: 0.5rem;
  padding-left: 1rem;
  position: relative;
}

.tips-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary);
}

/* ===== Footer ===== */
footer {
  margin-top: 3rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
  position: relative;
  z-index: 10;
}

/* ===== Utility Classes ===== */
.hidden {
  display: none !important;
}
