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

:root {
  /* Colors */
  --bg-primary: #f6f8fd;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --primary: #5c59ec;
  --primary-light: #eef2ff;
  --primary-hover: #4a47d3;
  --text-main: #1e1b4b;
  --text-muted: #5c5a87;
  --accent-purple: #c084fc;
  --accent-blue: #38bdf8;
  
  --success: #10b981;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;
  --error: #ef4444;
  --error-light: #fef2f2;
  --error-border: #fca5a5;
  --warning: #f59e0b;
  
  /* Layouts & Borders */
  --border-glass: rgba(92, 89, 236, 0.08);
  --border-glass-focused: rgba(92, 89, 236, 0.25);
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 10px 30px rgba(92, 89, 236, 0.06);
  --shadow-lg: 0 20px 40px rgba(92, 89, 236, 0.12);
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Base resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: radial-gradient(circle at 10% 20%, rgba(238, 242, 255, 1) 0%, rgba(246, 248, 253, 1) 90%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(92, 89, 236, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(92, 89, 236, 0.4);
}

/* Header & Navbar */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 248, 253, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.logo-icon {
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: 0 4px 15px rgba(92, 89, 236, 0.3);
  font-family: var(--font-heading);
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

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

/* Buttons */
.btn {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white;
  box-shadow: 0 4px 15px rgba(92, 89, 236, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(92, 89, 236, 0.35);
}

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

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 1.5px solid var(--border-glass-focused);
}

.btn-secondary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.btn-icon {
  background: white;
  border: 1px solid var(--border-glass);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.btn-icon:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}

/* App Main Container */
main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  width: 100%;
}

.screen.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* HOME SCREEN */
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: 99px;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  animation: pulseBadge 3s infinite;
}

@keyframes pulseBadge {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.home-container h1 {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.home-container h1 span {
  background: linear-gradient(135deg, var(--primary) 30%, var(--accent-purple) 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.15rem;
  margin-bottom: 3rem;
  max-width: 600px;
}

/* Prompt Box */
.prompt-container {
  width: 100%;
  background: var(--bg-card);
  border: 2px solid var(--border-glass);
  border-radius: 24px;
  padding: 0.75rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  backdrop-filter: blur(10px);
}

.prompt-container:focus-within {
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(92, 89, 236, 0.15);
  transform: translateY(-2px);
}

.prompt-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.prompt-input-row svg {
  color: var(--primary);
  margin-left: 1rem;
  flex-shrink: 0;
}

.prompt-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-body);
  font-size: 1.15rem;
  color: var(--text-main);
  padding: 0.75rem 0.5rem;
}

.prompt-input::placeholder {
  color: rgba(92, 90, 135, 0.5);
}

.prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-glass);
}

/* Suggestion Chips */
.suggestions-container {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.suggestions-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.suggestion-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: 650px;
}

.chip {
  background: white;
  border: 1px solid var(--border-glass);
  padding: 0.6rem 1.1rem;
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.chip:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  transform: scale(1.04);
}

/* ANSWER SCREEN */
.answer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.answer-title-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.subject-badge {
  background: linear-gradient(135deg, rgba(92, 89, 236, 0.1), rgba(192, 132, 252, 0.1));
  color: var(--primary);
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(92, 89, 236, 0.15);
}

/* Toggle custom styling */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 99px;
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-sm);
}

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

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

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

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

/* Card grids for Answers */
.answer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-glass);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-glass-focused);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.card-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-muted);
  white-space: pre-line;
}

/* Key Points Card styling */
.points-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.points-list li {
  position: relative;
  padding-left: 2rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.points-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  background: var(--primary-light);
  border-radius: 50%;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

/* Interactive Option Selection */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.option-btn {
  background: white;
  border: 1.5px solid var(--border-glass);
  padding: 1rem 1.25rem;
  border-radius: 12px;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.option-btn:hover:not(.disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateX(4px);
}

.option-badge {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.option-btn:hover:not(.disabled) .option-badge {
  background: var(--primary);
  color: white;
}

/* Option states after selection */
.option-btn.correct {
  background: var(--success-light) !important;
  border-color: var(--success) !important;
  color: var(--success) !important;
}
.option-btn.correct .option-badge {
  background: var(--success) !important;
  color: white !important;
}

.option-btn.wrong {
  background: var(--error-light) !important;
  border-color: var(--error) !important;
  color: var(--error) !important;
  animation: shake 0.4s ease;
}
.option-btn.wrong .option-badge {
  background: var(--error) !important;
  color: white !important;
}

.option-btn.disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.explanation-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.5;
  animation: fadeIn 0.4s ease;
}

/* QUIZ SCREEN */
.quiz-progress-container {
  margin-bottom: 2rem;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.progress-text {
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.progress-track {
  flex: 1;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple));
  width: 0%;
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-cards-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.quiz-card {
  display: none;
}

.quiz-card.active {
  display: block;
  animation: slideInUp 0.4s ease;
}

/* Quiz Final Feedback */
.feedback-card {
  text-align: center;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.feedback-score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  border: 4px solid var(--primary);
  box-shadow: 0 0 20px rgba(92, 89, 236, 0.15);
}

.score-num {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.score-total {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.feedback-status {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.feedback-status.excellent {
  color: var(--success);
}

.feedback-status.average {
  color: var(--warning);
}

.feedback-status.poor {
  color: var(--error);
}

.feedback-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 450px;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.feedback-actions {
  display: flex;
  gap: 1rem;
}

/* MODALS & DRAWERS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(30, 27, 75, 0.4);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-content {
  background: white;
  border-radius: 24px;
  padding: 2.5rem;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  transform: translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

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

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-body p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.input-field {
  width: 100%;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-glass);
  padding: 0.9rem 1.25rem;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition-smooth);
  margin-bottom: 1.5rem;
}

.input-field:focus {
  border-color: var(--primary);
  background: white;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* HISTORY DRAWER */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(30, 27, 75, 0.2);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: none;
}

.drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  max-width: 100%;
  height: 100vh;
  background: white;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.05);
  z-index: 950;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.drawer.active {
  right: 0;
}

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

.drawer-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drawer-empty-state {
  text-align: center;
  color: var(--text-muted);
  margin-top: 4rem;
  font-size: 0.95rem;
}

.history-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.history-item:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.history-item-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: var(--text-main);
}

.history-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-item-subject {
  font-weight: 700;
  color: var(--primary);
}

.drawer-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-glass);
}

/* THINKING LOADER OVERLAY */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(246, 248, 253, 0.9);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.tutor-mascot {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 2rem;
}

.mascot-brain {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  animation: pulseMascot 2s infinite ease-in-out;
  z-index: 2;
}

.orbit-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px dashed rgba(92, 89, 236, 0.2);
  border-radius: 50%;
  animation: rotateOrbit 8s linear infinite;
}

.orbit-node {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 10px var(--primary);
}

.loader-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  text-align: center;
}

.loader-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
  animation: pulseText 1.5s infinite;
}

/* Animations */
@keyframes rotateOrbit {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulseMascot {
  0%, 100% { transform: translate(-50%, -50%) scale(1); filter: drop-shadow(0 0 5px rgba(92, 89, 236, 0)); }
  50% { transform: translate(-50%, -50%) scale(1.15); filter: drop-shadow(0 0 20px rgba(92, 89, 236, 0.4)); }
}

@keyframes pulseText {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

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

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

/* RESPONSIVE LAYOUT */
@media (max-width: 900px) {
  .answer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .navbar {
    padding: 1rem;
  }
  .logo-text {
    font-size: 1.25rem;
  }
  main {
    padding: 1rem;
  }
  .home-container h1 {
    font-size: 2.25rem;
  }
  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }
  .prompt-container {
    padding: 0.5rem;
  }
  .prompt-input {
    font-size: 1rem;
  }
  .prompt-actions {
    flex-wrap: wrap;
    justify-content: stretch;
  }
  .prompt-actions button {
    flex: 1;
    justify-content: center;
  }
  .chip {
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
  }
  .answer-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .toggle-container {
    width: 100%;
    justify-content: space-between;
  }
  .feedback-actions {
    flex-direction: column;
    width: 100%;
  }
  .feedback-actions button {
    width: 100%;
    justify-content: center;
  }
  
  /* Stick input at bottom on mobile */
  .mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.05);
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-glass);
    z-index: 80;
    display: block;
  }
}

/* ==========================================
   STATS DASHBOARD ROW
   ========================================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  width: 100%;
  margin-top: 3.5rem;
  animation: slideInUp 0.6s ease;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  padding: 1.25rem 1rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-bounce);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

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

.stat-icon {
  font-size: 1.5rem;
  background: var(--primary-light);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

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

@media (max-width: 800px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   DARK THEME CUSTOMIZATION
   ========================================== */
body.dark-theme {
  --bg-primary: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --primary: #818cf8;
  --primary-light: rgba(129, 140, 248, 0.15);
  --primary-hover: #6366f1;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-purple: #c084fc;
  --accent-blue: #38bdf8;
  --border-glass: rgba(129, 140, 248, 0.15);
  --border-glass-focused: rgba(129, 140, 248, 0.35);
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
  
  background: radial-gradient(circle at 10% 20%, #1e293b 0%, #0f172a 100%);
}

body.dark-theme header {
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid rgba(129, 140, 248, 0.1);
}

body.dark-theme .btn-icon {
  background: #1e293b;
  border-color: rgba(129, 140, 248, 0.1);
  color: #94a3b8;
}

body.dark-theme .btn-icon:hover {
  color: #818cf8;
  border-color: #818cf8;
  background: rgba(129, 140, 248, 0.15);
}

body.dark-theme .btn-secondary {
  background: #1e293b;
  color: #818cf8;
  border-color: rgba(129, 140, 248, 0.25);
}

body.dark-theme .btn-secondary:hover {
  background: rgba(129, 140, 248, 0.1);
}

body.dark-theme .chip {
  background: #1e293b;
  border-color: rgba(129, 140, 248, 0.1);
  color: #94a3b8;
}

body.dark-theme .chip:hover {
  background: rgba(129, 140, 248, 0.15);
  color: #818cf8;
  border-color: #818cf8;
}

body.dark-theme .toggle-container {
  background: #1e293b;
  border-color: rgba(129, 140, 248, 0.1);
}

body.dark-theme .option-btn {
  background: #1e293b;
  border-color: rgba(129, 140, 248, 0.1);
  color: #f8fafc;
}

body.dark-theme .option-btn:hover:not(.disabled) {
  border-color: #818cf8;
  background: rgba(129, 140, 248, 0.15);
}

body.dark-theme .option-badge {
  background: #0f172a;
  color: #94a3b8;
}

body.dark-theme .modal-content {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid rgba(129, 140, 248, 0.15);
}

body.dark-theme .drawer {
  background: #1e293b;
  color: #f8fafc;
  border-left: 1px solid rgba(129, 140, 248, 0.15);
}

body.dark-theme .input-field {
  background: #0f172a;
  border-color: rgba(129, 140, 248, 0.1);
  color: #f8fafc;
}

body.dark-theme .input-field:focus {
  background: #0f172a;
  border-color: #818cf8;
}

body.dark-theme .quiz-progress-container {
  background: #1e293b;
  border-color: rgba(129, 140, 248, 0.1);
}

body.dark-theme .loader-overlay {
  background: rgba(15, 23, 42, 0.95);
}

body.dark-theme .history-item {
  background: #0f172a;
  border-color: rgba(129, 140, 248, 0.1);
}

body.dark-theme .history-item:hover {
  background: rgba(129, 140, 248, 0.15);
  border-color: #818cf8;
}

body.dark-theme .feedback-score-circle {
  background: rgba(129, 140, 248, 0.15);
  border-color: #818cf8;
}

body.dark-theme .score-num {
  color: #818cf8;
}

