/* ==========================================
   KASHI QUIZ - CSS DESIGN SYSTEM & STYLES
   ========================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* Base variables */
:root {
  /* Fonts */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.25);

  /* DARK THEME (Default) */
  --bg-canvas: #090d16;
  --bg-canvas-gradient: radial-gradient(circle at top right, #111a2e 0%, #090d16 100%);
  --bg-surface: rgba(17, 25, 40, 0.7);
  --bg-surface-opaque: #111928;
  --bg-card: rgba(22, 31, 54, 0.6);
  --bg-card-hover: rgba(30, 41, 73, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-glow: rgba(139, 92, 246, 0.3);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --color-primary: #8b5cf6;
  --color-primary-dark: #6d28d9;
  --color-primary-light: #c084fc;
  --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #4f46e5 100%);
  --gradient-primary-hover: linear-gradient(135deg, #a78bfa 0%, #6366f1 100%);
  
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.15);
  --color-success-border: rgba(16, 185, 129, 0.3);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);

  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.15);
  --color-danger-border: rgba(239, 68, 68, 0.3);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);

  --color-warning: #f59e0b;
  --color-info: #06b6d4;
  --gradient-info: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);

  --glass-blur: blur(16px);
  --glass-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
  --accent-glow: 0 0 20px rgba(139, 92, 246, 0.35);
}

/* LIGHT THEME MODIFIERS */
[data-theme="light"] {
  --bg-canvas: #f1f5f9;
  --bg-canvas-gradient: radial-gradient(circle at top right, #e2e8f0 0%, #f1f5f9 100%);
  --bg-surface: rgba(255, 255, 255, 0.7);
  --bg-surface-opaque: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --border-color: rgba(15, 23, 42, 0.08);
  --border-color-glow: rgba(124, 58, 237, 0.2);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --color-primary: #7c3aed;
  --color-primary-dark: #5b21b6;
  --color-primary-light: #a78bfa;
  --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  --gradient-primary-hover: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  
  --color-success: #059669;
  --color-success-bg: rgba(5, 150, 105, 0.1);
  --color-success-border: rgba(5, 150, 105, 0.25);
  
  --color-danger: #d97706;
  --color-danger: #dc2626;
  --color-danger-bg: rgba(220, 38, 38, 0.1);
  --color-danger-border: rgba(220, 38, 38, 0.25);

  --color-warning: #d97706;
  --color-info: #0891b2;
  --gradient-info: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);

  --glass-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5);
  --accent-glow: 0 0 20px rgba(124, 58, 237, 0.15);
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg-canvas);
  background-image: var(--bg-canvas-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-canvas);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================
   LAYOUT CONTAINERS
   ========================================== */
.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2rem 0;
}

/* View Handling (SPA) */
.view {
  opacity: 1;
  transition: opacity var(--transition-normal) ease-in-out, transform var(--transition-normal) ease-in-out;
}

.view.hidden {
  display: none !important;
  opacity: 0;
  transform: translateY(15px);
}

.hidden:not(.mobile-drawer):not(.drawer-backdrop) {
  display: none !important;
}

/* ==========================================
   NAVIGATION HEADER
   ========================================== */
header {
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color var(--transition-normal), border-bottom var(--transition-normal);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  position: relative;
}

.logo-icon-wrap {
  width: 38px;
  height: 38px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--accent-glow);
  color: #fff;
  font-size: 1.2rem;
  overflow: hidden;
}

.logo-icon-wrap img {
  border-radius: 50%;
}

.logo-text {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--color-primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

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

/* Streak Badge */
.streak-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.35rem 0.8rem;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-warning);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.streak-badge:hover {
  transform: scale(1.05);
}

.streak-badge i {
  animation: pulse-flame 1.5s infinite alternate;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  border-color: var(--color-primary);
  background-color: var(--bg-card-hover);
  transform: translateY(-2px);
}

.theme-toggle .fa-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .fa-moon {
  display: none;
}

[data-theme="light"] .theme-toggle .fa-sun {
  display: block;
  color: var(--color-warning);
}

/* ==========================================
   UI COMPONENTS (GLASS PANELS & BUTTONS)
   ========================================== */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  box-shadow: var(--glass-shadow), var(--shadow-md);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

/* Buttons */
.btn {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.8rem 1.6rem;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-normal);
  text-decoration: none;
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--gradient-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.5);
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.btn-secondary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-success {
  background: var(--gradient-success);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

/* ==========================================
   DASHBOARD VIEW (HOME)
   ========================================== */
.hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.hero-content {
  flex: 1;
}

.hero-title {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.hero-buttons-container {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

/* Dashboard Stats Bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-color-glow);
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
}

.stat-icon.blue { background: var(--gradient-info); }
.stat-icon.purple { background: var(--gradient-primary); }
.stat-icon.orange { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }

.stat-value {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.4rem;
  line-height: 1.1;
}

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

/* Category Grid */
.section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: transparent;
  transition: background var(--transition-fast);
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.category-card.technical-english:hover {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.2), var(--shadow-md);
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(239, 68, 68, 0.04) 100%);
}

.category-card.engineering-mathematics:hover {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.2), var(--shadow-md);
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(139, 92, 246, 0.04) 100%);
}

.category-card.engineering-mechanics:hover {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.2), var(--shadow-md);
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.04) 100%);
}

.category-card.technical-english::before { background: var(--gradient-danger); }
.category-card.engineering-mathematics::before { background: var(--gradient-primary); }
.category-card.engineering-mechanics::before { background: var(--gradient-success); }

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

.cat-icon-container {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
}

.category-card.technical-english .cat-icon-container { background: var(--gradient-danger); }
.category-card.engineering-mathematics .cat-icon-container { background: var(--gradient-primary); }
.category-card.engineering-mechanics .cat-icon-container { background: var(--gradient-success); }

.difficulty-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.difficulty-tag.mixed {
  background: rgba(139, 92, 246, 0.15);
  color: var(--color-primary-light);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.cat-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.cat-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
  margin-bottom: 1.5rem;
  flex: 1;
}

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

.cat-questions-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.cat-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.category-card:hover .cat-play-btn {
  background: var(--color-primary);
  color: #fff;
  transform: scale(1.1);
}

/* Category Mastery Progress */
.cat-progress-wrap {
  width: 100%;
  margin-top: 0.75rem;
}
.cat-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.cat-progress-fill {
  height: 100%;
  border-radius: 10px;
  width: 0%;
  transition: width var(--transition-slow);
}
.category-card.technical-english .cat-progress-fill { background: var(--color-danger); }
.category-card.engineering-mathematics .cat-progress-fill { background: var(--color-primary); }
.category-card.engineering-mechanics .cat-progress-fill { background: var(--color-success); }

.cat-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ==========================================
   INTERACTIVE QUIZ ENGINE VIEW
   ========================================== */
.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.quiz-meta {
  flex: 1;
}

.quiz-title-text {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.question-counter {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Circular Timer Wrapper */
.timer-container {
  position: relative;
  width: 80px;
  height: 80px;
}

.timer-svg {
  transform: rotate(-90deg);
}

.timer-bg-circle {
  stroke: var(--border-color);
}

.timer-fg-circle {
  transition: stroke-dashoffset 0.1s linear, stroke var(--transition-normal);
}

.timer-text-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
}

/* Live Linear Progress Bar */
.progress-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin-bottom: 2.5rem;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-primary);
  border-radius: 10px;
  transition: width var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* Question Area */
.question-container {
  margin-bottom: 2.5rem;
}

.question-text {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

/* Options Grid */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.option-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  text-align: left;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-fast);
  width: 100%;
  position: relative;
  outline: none;
}

.option-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.option-text-span {
  flex: 1;
}

/* Option States */
.option-btn:hover:not(.locked) {
  background-color: var(--bg-card-hover);
  border-color: var(--color-primary-light);
  transform: translateX(4px);
}

.option-btn:hover:not(.locked) .option-badge {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* Selected, Correct, Incorrect Styling */
.option-btn.selected {
  border-color: var(--color-primary);
  background-color: rgba(139, 92, 246, 0.1);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.option-btn.correct {
  border-color: var(--color-success) !important;
  background-color: var(--color-success-bg) !important;
  color: var(--text-primary) !important;
}

.option-btn.correct .option-badge {
  background: var(--color-success) !important;
  border-color: var(--color-success) !important;
  color: white !important;
}

.option-btn.incorrect {
  border-color: var(--color-danger) !important;
  background-color: var(--color-danger-bg) !important;
}

.option-btn.incorrect .option-badge {
  background: var(--color-danger) !important;
  border-color: var(--color-danger) !important;
  color: white !important;
}

.option-btn.locked {
  cursor: not-allowed;
}

/* Haptic visual feedbacks */
.shake-animation {
  animation: shake 0.5s ease-in-out;
}

.pulse-animation {
  animation: pulse-correct 0.6s ease-in-out;
}

/* Explanation Panel */
.explanation-panel {
  margin-top: 1.5rem;
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 12px;
  padding: 1.25rem;
  animation: slideUp 0.3s ease-out;
}

.explanation-title {
  color: var(--color-info);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.explanation-body {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Quiz Footer */
.quiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

/* ==========================================
   RESULTS SCREEN VIEW
   ========================================== */
.results-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Score Ring Animation */
.score-ring-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 2rem;
}

.score-ring-svg {
  transform: rotate(-90deg);
}

.score-ring-bg {
  stroke: var(--border-color);
}

.score-ring-fg {
  stroke-dasharray: 439.82; /* 2 * PI * 70 = 439.822 */
  stroke-dashoffset: 439.82;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  stroke: var(--color-primary);
}

.score-text-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-number {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 2.75rem;
  line-height: 1;
}

.score-percent-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-top: 0.25rem;
}

.feedback-headline {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.feedback-sub {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 450px;
}

.results-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
  max-width: 500px;
  margin-bottom: 2.5rem;
}

.result-stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.result-stat-val {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
}

.result-stat-lbl {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

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

/* Achievement Unlocked Card */
.unlock-badge-alert {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
  border: 1px dashed var(--color-success);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  max-width: 500px;
  width: 100%;
  animation: pulse-border 2s infinite alternate;
}

.unlock-badge-icon {
  font-size: 2.2rem;
}

.unlock-badge-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-success);
}

.unlock-badge-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==========================================
   LEADERBOARD & PROGRESS ANALYTICS VIEW
   ========================================== */
.analytics-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

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

.panel-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Circular Mastery Rings inside Analytics */
.mastery-rings-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.mastery-ring-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 100px;
}

.mastery-ring-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 0.75rem;
}

.mastery-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
}

.mastery-ring-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  max-width: 100px;
}

/* Achievements List Grid */
.achievements-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
}

.badge-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: all var(--transition-normal);
}

.badge-card.locked {
  opacity: 0.45;
  filter: grayscale(1);
}

.badge-card:not(.locked):hover {
  transform: translateY(-4px);
  border-color: var(--border-color-glow);
  background-color: var(--bg-card-hover);
  box-shadow: var(--shadow-sm);
}

.badge-icon {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.badge-name {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.badge-desc {
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* History Table Log */
.history-table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  margin-top: 1rem;
}

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

table.history-table th {
  background: rgba(0, 0, 0, 0.15);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

table.history-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

table.history-table tr:last-child td {
  border-bottom: none;
}

table.history-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.history-score-badge {
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
}

.history-score-badge.high {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}
.history-score-badge.mid {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warning);
}
.history-score-badge.low {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

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

/* ==========================================
   TOAST NOTIFICATION MODALS
   ========================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 380px;
  width: 100%;
}

.toast {
  background: var(--bg-surface-opaque);
  border: 1px solid var(--border-color-glow);
  box-shadow: var(--shadow-lg), var(--accent-glow);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-primary);
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  transform: translateX(0);
}

.toast-badge-icon {
  font-size: 2rem;
}

.toast-content {
  flex: 1;
}

.toast-header-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--color-primary-light);
  letter-spacing: 0.5px;
}

.toast-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.1rem;
}

.toast-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ==========================================
   FOOTER SECTION
   ========================================== */
footer {
  text-align: center;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}

footer a:hover {
  color: var(--color-primary-light);
}

/* ==========================================
   KEYFRAME ANIMATIONS
   ========================================== */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@keyframes pulse-correct {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { transform: scale(1.02); box-shadow: 0 0 15px 4px rgba(16, 185, 129, 0.4); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-flame {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.4)); }
  100% { transform: scale(1.15); filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.8)); }
}

@keyframes pulse-border {
  0% { border-color: rgba(16, 185, 129, 0.3); }
  100% { border-color: rgba(16, 185, 129, 0.9); }
}

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

/* ==========================================
   ENHANCED HOMEPAGE & MODAL STYLES
   ========================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.dashboard-side-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 16, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 1;
  transition: opacity 0.25s ease;
}

.modal.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  width: 92%;
  max-width: 500px;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface-opaque);
  position: relative;
  animation: modalSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition-fast);
}

.close-btn:hover {
  color: var(--color-danger);
}

.modal-body {
  padding: 1.75rem;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 1.75rem;
}

/* ==========================================
   MOBILE RESPONSIVENESS OVERRIDES
   ========================================== */
@media (max-width: 600px) {
  .hero-section {
    display: flex !important;
    flex-direction: column !important;
    text-align: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
  }

  .hero-section.glass-panel {
    background: linear-gradient(135deg, rgba(17, 25, 40, 0.85) 0%, rgba(22, 31, 54, 0.7) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  }

  [data-theme="light"] .hero-section.glass-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(241, 245, 249, 0.8) 100%);
    border-color: rgba(124, 58, 237, 0.15);
  }

  .hero-image-container {
    display: flex !important;
    justify-content: center;
    width: 100%;
    order: -1;
    margin-bottom: 0.5rem;
  }

  .hero-banner-img {
    max-width: 160px;
    filter: drop-shadow(0 8px 16px rgba(139, 92, 246, 0.2));
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
  }

  .hero-buttons-container {
    justify-content: center;
  }

  .stats-bar {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.75rem;
  }
  
  .stat-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem 0.5rem;
    gap: 0.5rem;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1rem;
  }
  
  .stat-value {
    font-size: 1.1rem;
  }
  
  .stat-label {
    font-size: 0.7rem;
  }

  .glass-panel {
    padding: 1.25rem;
  }

  .category-card {
    padding: 1.25rem;
  }

  .question-text {
    font-size: 1.2rem;
  }

  .option-btn {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
  }

  .quiz-header {
    gap: 0.75rem;
  }

  .timer-container {
    width: 60px;
    height: 60px;
  }

  .timer-svg {
    width: 60px;
    height: 60px;
    viewBox: 0 0 80 80;
  }

  .timer-text-overlay {
    font-size: 1rem;
  }

  .results-stats-grid {
    gap: 0.75rem;
  }

  .result-stat-val {
    font-size: 1.2rem;
  }

  .result-stat-lbl {
    font-size: 0.75rem;
  }

  .results-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  .results-actions .btn {
    width: 100%;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: calc(100% - 2rem);
  }

  /* Mobile Bottom Sheet Modals override */
  .modal {
    align-items: flex-end;
  }

  .modal-content {
    width: 100%;
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    margin-bottom: 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    transform: translateY(100%);
    animation: sheetSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes sheetSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

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

  .modal-body {
    padding: 1.25rem;
    max-height: 60vh;
  }

  .modal-footer {
    padding: 1.25rem;
    flex-direction: column-reverse;
    align-items: stretch;
    width: 100%;
  }

  .modal-footer .btn {
    width: 100%;
    margin: 0;
  }
}



/* Customizer Choice Buttons */
.customizer-section {
  margin-bottom: 1.5rem;
}

.customizer-section:last-child {
  margin-bottom: 0;
}

.customizer-label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--color-primary-light);
  letter-spacing: 0.75px;
  margin-bottom: 0.75rem;
}

.radio-card-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.radio-card {
  display: block;
  cursor: pointer;
  position: relative;
}

.radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-card-body {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  transition: all var(--transition-fast);
  text-align: left;
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.radio-card input[type="radio"]:checked + .radio-card-body {
  border-color: var(--color-primary);
  background-color: rgba(139, 92, 246, 0.1);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.15);
}

.radio-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.radio-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

/* User Input Field */
.text-input {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.8rem 1.25rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

.text-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* Avatar Grid Selector */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
}

.avatar-item {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.avatar-item:hover {
  transform: translateY(-2px);
  background-color: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.avatar-item.selected {
  border-color: var(--color-primary);
  background-color: rgba(139, 92, 246, 0.1);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
  transform: scale(1.05);
}

/* Daily Challenge Card overlay */
.daily-challenge-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(16, 185, 129, 0.08) 100%) !important;
  border: 1px solid rgba(139, 92, 246, 0.25) !important;
}

.daily-challenge-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-success));
}

.daily-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--gradient-primary);
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 5px;
  letter-spacing: 0.75px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.daily-title {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
  font-weight: 800;
}

.daily-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Recent Trend Chart */
.trend-chart-container {
  margin-top: 0.5rem;
}

.trend-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 100px;
  gap: 0.6rem;
  padding: 0.25rem 0.5rem 0 0.5rem;
}

.chart-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.chart-bar {
  width: 100%;
  max-width: 26px;
  background: var(--gradient-primary);
  border-radius: 6px 6px 0 0;
  transition: height 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  cursor: pointer;
  min-height: 4px;
}

.chart-bar:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface-opaque);
  color: var(--text-primary);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  margin-bottom: 6px;
  pointer-events: none;
  z-index: 10;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.chart-bar.high { background: var(--gradient-success); }
.chart-bar.mid { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.chart-bar.low { background: var(--gradient-danger); }

.chart-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  text-align: center;
  max-width: 52px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Simulated Leaderboard */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.leader-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.leader-item:hover {
  transform: scale(1.02);
}

.leader-item.current-user {
  border-color: var(--color-primary-light);
  background-color: rgba(139, 92, 246, 0.06);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.08);
}

.leader-rank {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9rem;
  width: 18px;
  color: var(--text-muted);
  text-align: center;
}

.leader-item:nth-child(1) .leader-rank { color: #ffd700; font-size: 1.15rem; }
.leader-item:nth-child(2) .leader-rank { color: #c0c0c0; font-size: 1.05rem; }
.leader-item:nth-child(3) .leader-rank { color: #cd7f32; font-size: 0.95rem; }

.leader-avatar {
  font-size: 1.25rem;
  line-height: 1;
}

.leader-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.leader-name {
  font-size: 0.85rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-name span {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.leader-streak {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-warning);
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.text-info {
  color: var(--color-info) !important;
}

/* ==========================================
   NAVIGATION LINKS (DESKTOP & MOBILE MENU)
   ========================================== */
.nav-links-desktop {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-route {
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.nav-route:hover {
  color: var(--color-primary-light);
}

.nav-route.active {
  color: var(--color-primary-light);
  border-color: var(--color-primary-light);
}

/* Mobile Hamburger Menu */
.mobile-menu-btn {
  display: none !important;
}

@media (max-width: 768px) {
  .nav-links-desktop {
    display: none !important;
  }
  .mobile-menu-btn {
    display: flex !important;
  }
}

/* Drawer Menu Panel */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  background-color: var(--bg-surface-opaque);
  border-left: 1px solid var(--border-color);
  z-index: 600;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(0);
}

.mobile-drawer.hidden {
  transform: translateX(100%);
  pointer-events: none;
}

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

.drawer-body {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  gap: 0.5rem;
}

.drawer-route {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  transition: all var(--transition-fast);
}

.drawer-route:hover {
  color: var(--text-primary);
  background-color: var(--bg-card);
}

.drawer-route.active {
  color: var(--color-primary-light);
  background-color: rgba(139, 92, 246, 0.1);
  border-left: 4px solid var(--color-primary);
}

/* Backdrop */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 550;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ==========================================
   HERO BANNER & IMAGE STYLING
   ========================================== */
.hero-section {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: center;
}

.hero-image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.hero-banner-img {
  width: 100%;
  max-width: 280px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(139, 92, 246, 0.25));
  animation: floatIllustration 4s ease-in-out infinite alternate;
}

@keyframes floatIllustration {
  from { transform: translateY(-6px); }
  to { transform: translateY(6px); }
}

@media (max-width: 768px) {
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 1.5rem;
  }
  .hero-image-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    order: 2;
  }
  .hero-banner-img {
    max-width: 200px;
  }
}

/* ==========================================
   WHY KASHI FEATURES GRID
   ========================================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition-normal);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.feature-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: var(--radius-lg);
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: 1;
  pointer-events: none;
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-card:hover::after {
  opacity: 1;
}

.feature-card.habit:hover {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.15), var(--shadow-md);
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(245, 158, 11, 0.03) 100%);
}

.feature-card.config:hover {
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 10px 25px -5px rgba(6, 182, 212, 0.15), var(--shadow-md);
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(6, 182, 212, 0.03) 100%);
}

.feature-card.badges:hover {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.15), var(--shadow-md);
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(139, 92, 246, 0.03) 100%);
}

.feature-card.analytics:hover {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.15), var(--shadow-md);
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.03) 100%);
}

.feature-icon {
  font-size: 2.25rem;
  margin-bottom: 1.25rem;
  transition: transform var(--transition-normal);
  display: inline-block;
}

/* Micro-animations on card hover */
.feature-card:hover .feature-icon {
  transform: scale(1.1);
}

.feature-card.habit:hover .feature-icon i {
  animation: pulse-flame 1.2s infinite alternate;
}

.feature-card.config:hover .feature-icon i {
  animation: spinGears 3s infinite linear;
}

.feature-card.badges:hover .feature-icon i {
  animation: floatBadge 1.5s infinite alternate ease-in-out;
}

.feature-card.analytics:hover .feature-icon i {
  animation: tiltPie 1.5s infinite alternate ease-in-out;
}

@keyframes spinGears {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes floatBadge {
  0% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 2px rgba(139, 92, 246, 0.2)); }
  100% { transform: translateY(-4px) scale(1.05); filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.6)); }
}

@keyframes tiltPie {
  0% { transform: rotate(-8deg); }
  100% { transform: rotate(8deg); }
}

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 2;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.45;
  position: relative;
  z-index: 2;
}

/* ==========================================
   STUDY RESOURCES HUB PAGE
   ========================================== */
.resources-search-wrap {
  margin-bottom: 2rem;
}

.search-bar-inner {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-input-field {
  width: 100%;
  padding-left: 3rem !important;
}

.resources-grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.resource-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition-normal);
  text-align: left;
}

.resource-card.hidden {
  display: none !important;
}

.resource-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-color-glow);
  background-color: var(--bg-card-hover);
  box-shadow: var(--shadow-sm);
}

.res-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  align-self: flex-start;
  letter-spacing: 0.5px;
}

.res-badge.web {
  background: rgba(6, 182, 212, 0.12);
  color: var(--color-info);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.res-badge.science {
  background: rgba(139, 92, 246, 0.12);
  color: var(--color-primary-light);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.res-badge.history {
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.resource-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.resource-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.45;
  flex: 1;
}

.res-link {
  color: var(--color-primary-light);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color var(--transition-fast);
  margin-top: 0.5rem;
  align-self: flex-start;
}

.res-link:hover {
  color: var(--text-primary);
}

/* ==========================================
   FAQ & ACCORDION HELP PAGE
   ========================================== */
.faq-header-card {
  text-align: left;
}

.faq-accordion-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto 2.5rem auto;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background-color: var(--bg-card);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.faq-accordion-btn {
  width: 100%;
  border: none;
  background: transparent;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
}

.faq-accordion-btn:hover {
  background-color: var(--bg-card-hover);
  color: var(--color-primary-light);
}

.faq-chevron {
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-accordion-content {
  max-height: 0;
  padding: 0 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
}

.faq-item.active {
  border-color: var(--border-color-glow);
  background-color: var(--bg-card-hover);
}

.faq-item.active .faq-chevron {
  transform: rotate(180deg);
  color: var(--color-primary-light);
}

.faq-item.active .faq-accordion-content {
  max-height: 200px;
  padding: 0 1.5rem 1.5rem 1.5rem;
}

/* ==========================================
   CONTACT US PAGE
   ========================================== */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

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

.contact-info-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.75rem;
}

.detail-item-interactive {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.detail-item-interactive.link-item {
  cursor: pointer;
}

.detail-item-interactive.link-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-color-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.detail-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  color: #fff;
  transition: transform var(--transition-fast);
}

.detail-item-interactive:hover .detail-icon {
  transform: scale(1.05);
}

.detail-icon.blue-glow {
  background: var(--gradient-info);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.detail-icon.green-glow {
  background: var(--gradient-success);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.detail-icon.purple-glow {
  background: var(--gradient-primary);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

.detail-info-text {
  flex: 1;
}

.detail-info-text h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
  color: var(--text-primary);
}

.detail-info-text p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.3;
}

.external-link-indicator {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.detail-item-interactive.link-item:hover .external-link-indicator {
  color: var(--color-primary-light);
  transform: translate(2px, -2px);
}

/* Simulated Dark-Theme Map Box */
.simulated-map-container {
  height: 150px;
  background: radial-gradient(circle at center, #161f36 0%, #090d16 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  transition: border-color var(--transition-fast);
}

.simulated-map-container:hover {
  border-color: var(--border-color-glow);
}

.map-grid-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 20px 20px;
}

.map-radar-glow {
  position: absolute;
  width: 44px;
  height: 44px;
  background: rgba(16, 185, 129, 0.15);
  border: 1.5px solid var(--color-success);
  border-radius: 50%;
  animation: radarPulse 2.5s infinite ease-out;
}

@keyframes radarPulse {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2.8); opacity: 0; }
}

.map-pin {
  font-size: 2.1rem;
  color: var(--color-success);
  z-index: 2;
  filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.6));
  animation: bouncePin 1s infinite alternate cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes bouncePin {
  from { transform: translateY(-4px); }
  to { transform: translateY(4px); }
}

.map-label {
  position: absolute;
  bottom: 0.6rem;
  left: 0.6rem;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: var(--shadow-sm);
}

.contact-form-card {
  position: relative;
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
}

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

@media (max-width: 768px) {
  .form-group-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

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

.form-group label {
  text-align: left;
}

.textarea-input {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-body);
}

/* Spinner */
.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spinLoader 0.6s linear infinite;
}

@keyframes spinLoader {
  to { transform: rotate(360deg); }
}

/* Contact Success Card Overlay */
.contact-success-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 320px;
  padding: 1rem;
  animation: slideUp 0.4s ease-out;
}

.success-checkmark-wrap {
  margin-bottom: 1.5rem;
}

.success-checkmark-wrap .success-icon {
  font-size: 4rem;
  color: var(--color-success);
  animation: scalePulse 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scalePulse {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================
   MULTI-COLUMN FOOTER
   ========================================== */
footer {
  background-color: var(--bg-surface-opaque);
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0 0 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
  text-align: left;
}

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

@media (max-width: 500px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-about-text {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

.footer-socials {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.footer-socials a {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.footer-socials a:hover {
  border-color: var(--color-primary-light);
  color: #fff;
  background: var(--gradient-primary);
  transform: translateY(-2px);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.footer-col.links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color var(--transition-fast);
  display: inline-block;
  padding: 0.1rem 0;
  text-align: left;
}

.footer-col.links a:hover {
  color: var(--color-primary-light);
}

.footer-subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}

.footer-bottom-bar {
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 0;
  background-color: rgba(0, 0, 0, 0.15);
}

.footer-bottom-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-bottom-container a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-bottom-container a:hover {
  color: var(--color-primary-light);
}

/* Streak Calendar Grid styles */
.streak-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.streak-day-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.6rem 0.25rem;
  border-radius: 12px;
  font-size: 0.75rem;
  transition: all var(--transition-fast);
  cursor: help;
}

.streak-day-card:hover {
  transform: translateY(-2px);
  border-color: var(--text-muted);
}

.streak-day-card.active {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.streak-day-card.today {
  border-color: var(--color-primary-light);
  background: rgba(139, 92, 246, 0.08);
}

.streak-day-card.today.active {
  border-color: var(--color-warning);
  background: rgba(245, 158, 11, 0.12);
}

.streak-day-label {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.streak-day-card.active .streak-day-label {
  color: var(--color-warning);
}

.streak-day-icon {
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0.5;
}

.streak-day-card.active .streak-day-icon {
  color: var(--color-warning);
  opacity: 1;
  animation: pulse-flame 1.5s infinite alternate;
}

/* Mobile Footer Refinements */
@media (max-width: 600px) {
  footer {
    padding-top: 2.5rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
    text-align: center !important;
  }

  .footer-col {
    align-items: center;
  }

  .footer-col.about {
    align-items: center;
  }

  .footer-col.links a {
    text-align: center !important;
  }
  
  .footer-socials {
    justify-content: center;
  }
  
  .footer-bottom-container {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
}


