/*
 * Flashcards App - Modern UI Styles
 */

/* Mobile scroll fixes - prevent over-scrolling and horizontal scroll */
html {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

body {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
  -ms-overflow-style: -ms-autohiding-scrollbar;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom, 60px);
  min-height: 100vh;
}

/* ===============================================
   DESIGN SYSTEM - CONSISTENT TOKENS
   =============================================== */

/* Spacing Scale - Consistent spacing throughout the app */
:root {
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
}

/* Typography Scale - Consistent font sizes */
:root {
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
  
  /* Line heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;
}

/* Touch Targets - Minimum 44px for accessibility */
:root {
  --touch-target: 2.75rem; /* 44px minimum */
}

/* ===============================================
   ACCESSIBILITY & FOCUS MANAGEMENT
   =============================================== */

/* Global focus indicator - visible and consistent */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(124, 77, 255, 0.15);
}

/* Enhanced focus for interactive elements */
button:focus, 
input:focus, 
textarea:focus, 
select:focus,
a:focus,
.btn:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(124, 77, 255, 0.2);
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
  *:focus {
    outline: 3px solid currentColor;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.5);
  }
}

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

/* Skip navigation for keyboard users */
.skip-link {
  position: absolute;
  top: -40px;
  left: var(--space-4);
  background: var(--primary-color);
  color: white;
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  border-radius: var(--radius-md);
  z-index: 1000;
  font-weight: 500;
}

.skip-link:focus {
  top: var(--space-4);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-primary: #000000;
    --text-secondary: #333333;
  }
  
  /* Ensure all interactive elements have strong borders */
  .btn, .card, .action-card, .stat-card {
    border: 2px solid currentColor !important;
  }
  
  /* Remove subtle backgrounds in high contrast */
  .glass-bg {
    background: transparent !important;
    backdrop-filter: none !important;
  }
  
  /* Ensure sufficient contrast for status badges */
  .status-badge {
    border: 2px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Performance optimization for low-end devices */
@media (max-width: 768px) and (max-resolution: 1.5dppx) {
  /* Disable expensive effects on lower-end mobile devices */
  * {
    backdrop-filter: none !important;
  }
  
  /* Use solid backgrounds instead of glassmorphism */
  .card, .stat-card, .action-card {
    background: var(--background-primary) !important;
    border: 1px solid var(--border-color);
  }
}

/* Additional mobile fixes */
* {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Allow text selection for content areas */
.question-text,
.correct-answer-text,
.user-answer-text,
input,
textarea,
.card-content,
p {
  -webkit-user-select: text;
  -khtml-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Container width fixes for mobile */
.container,
.main-container,
.dashboard-container {
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Prevent any element from causing horizontal scroll */
* {
  box-sizing: border-box;
  max-width: 100%;
}

/* Mobile-specific overflow fixes */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
  }
  
  body {
    padding-bottom: max(env(safe-area-inset-bottom), 80px);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }
  
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: 0;
    margin-right: 0;
    padding-bottom: 2rem;
  }
  
  /* Ensure no child elements break out */
  .filter-container,
  .cards-table,
  .study-session-card,
  .action-grid,
  .stats-overview {
    max-width: 100%;
    overflow-x: hidden;
  }
  
  /* Add extra space at bottom of main content areas */
  .main-container,
  .dashboard-container {
    padding-bottom: 3rem;
  }
}

/* CSS Custom Properties for Design System */
:root {
  /* Dark theme variables (default) */
  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-card: #1E293B;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-tertiary: #64748B;
  --border-light: #334155;
  --border-medium: #475569;
  --accent-subtle: #A78BFA;
  --stats-purple: #A78BFA;
  --stats-pink: #F472B6;
  --stats-teal: #22D3EE;
  --stats-orange: #FBBF24;
  
  /* Legacy color mappings for compatibility */
  --primary-color: var(--accent-subtle);
  --primary-hover: #8B5CF6;
  --secondary-color: var(--stats-pink);
  --success-color: #10B981;
  --warning-color: var(--stats-orange);
  --danger-color: #EF4444;
  --info-color: var(--stats-teal);
  
  /* Simplified gradients */
  --gradient-primary: linear-gradient(135deg, var(--accent-subtle) 0%, var(--primary-hover) 100%);
  --gradient-secondary: linear-gradient(135deg, var(--stats-pink) 0%, #EC4899 100%);
  --gradient-success: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
  --gradient-warning: linear-gradient(135deg, var(--stats-orange) 0%, #F59E0B 100%);
  --gradient-danger: linear-gradient(135deg, var(--danger-color) 0%, #DC2626 100%);
  --gradient-info: linear-gradient(135deg, var(--stats-teal) 0%, #06B6D4 100%);
  
  --gradient-text: linear-gradient(45deg, var(--accent-subtle), var(--stats-pink));
  
  --background-primary: var(--bg-secondary);
  --background-secondary: var(--bg-card);
  --background-tertiary: #334155;
  --background-gradient: var(--bg-primary);
  --background-body: var(--bg-primary);
  
  --text-muted: var(--text-tertiary);
  
  --border-color: var(--border-light);
  --border-hover: var(--border-medium);
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.1);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 16px rgba(139, 92, 246, 0.15);
  
  /* Simplified component shadows */
  --shadow-button: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-button-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 2px 8px rgba(0, 0, 0, 0.12);
  
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  
  --glass-bg: var(--bg-card);
  --glass-border: var(--border-light);
}

/* Light Theme Override */
[data-theme="light"] {
  /* Light theme variables */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F9FA;
  --bg-card: #F8F9FA;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --border-light: #E5E7EB;
  --border-medium: #D1D5DB;
  --accent-subtle: #8B5CF6;
  --stats-purple: #8B5CF6;
  --stats-pink: #EC4899;
  --stats-teal: #06B6D4;
  --stats-orange: #F59E0B;
  
  /* Legacy color mappings for compatibility */
  --primary-color: var(--accent-subtle);
  --primary-hover: #7C3AED;
  --secondary-color: var(--stats-pink);
  --success-color: #10B981;
  --warning-color: var(--stats-orange);
  --danger-color: #EF4444;
  --info-color: var(--stats-teal);
  
  /* Light theme gradients */
  --gradient-primary: linear-gradient(135deg, var(--accent-subtle) 0%, var(--primary-hover) 100%);
  --gradient-secondary: linear-gradient(135deg, var(--stats-pink) 0%, #DB2777 100%);
  --gradient-success: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
  --gradient-warning: linear-gradient(135deg, var(--stats-orange) 0%, #D97706 100%);
  --gradient-danger: linear-gradient(135deg, var(--danger-color) 0%, #DC2626 100%);
  --gradient-info: linear-gradient(135deg, var(--stats-teal) 0%, #0891B2 100%);
  
  --gradient-text: linear-gradient(45deg, var(--accent-subtle), var(--stats-pink));
  
  --background-primary: var(--bg-secondary);
  --background-secondary: var(--bg-card);
  --background-tertiary: #F3F4F6;
  --background-gradient: var(--bg-primary);
  --background-body: var(--bg-primary);
  
  --text-muted: var(--text-tertiary);
  
  --border-color: var(--border-light);
  --border-hover: var(--border-medium);
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 16px rgba(139, 92, 246, 0.1);
  
  /* Light theme component shadows */
  --shadow-button: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-button-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 2px 8px rgba(107, 70, 193, 0.1);
  --shadow-card-hover: 0 4px 15px rgba(107, 70, 193, 0.2);
  
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(107, 70, 193, 0.1);
}

/* Base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: all 0.3s ease;
}

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

/* New Study Interface Styles */
.main-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.success-banner {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  margin-bottom: 32px;
  text-align: center;
  font-weight: 500;
}

.study-session-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 32px;
  color: var(--text-primary);
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}

.session-header {
  text-align: center;
  margin-bottom: 32px;
}

.session-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.session-stats {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 24px;
}

.progress-container {
  margin-bottom: 32px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--background-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-progress);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text {
  text-align: right;
  color: var(--text-secondary);
  font-size: 14px;
}

.question-section {
  background: var(--background-secondary);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.question-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-number {
  background: var(--background-tertiary);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
}

.question-text {
  font-size: 20px;
  line-height: 1.5;
  margin-bottom: 32px;
  color: var(--text-primary);
}

.answer-section {
  background: var(--background-secondary);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
}

.answer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.answer-icon {
  font-size: 20px;
}

.answer-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.correct-answer {
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid var(--success-color);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.correct-answer-text {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-primary);
  font-weight: 500;
}

.user-answer-section {
  margin-bottom: 24px;
}

.user-answer-label {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 500;
}

.user-answer-input {
  width: 100%;
  background: var(--background-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 20px;
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.5;
  min-height: 80px;
  resize: vertical;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

.user-answer-input:focus {
  border-color: var(--primary-color);
  /* Global focus indicator from design system will handle outline */
}

.user-answer-input::placeholder {
  color: var(--text-muted);
}

.answer-shown-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: block;
  margin: 0 auto;
}

.answer-shown-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.answer-shown-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.difficulty-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.difficulty-title {
  text-align: center;
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.difficulty-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.difficulty-form {
  display: contents; /* Makes form not affect grid layout */
}

.difficulty-btn {
  padding: 16px 12px;
  border: 2px solid transparent;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  text-decoration: none;
  display: block;
}

.difficulty-btn.again {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.difficulty-btn.hard {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.3);
}

.difficulty-btn.good {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.3);
}

.difficulty-btn.easy {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}

.difficulty-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.difficulty-times {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
}

.exit-btn {
  background: var(--background-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: block;
  margin: 0 auto;
  text-decoration: none;
}

.exit-btn:hover {
  background: var(--background-secondary);
  color: var(--text-primary);
  text-decoration: none;
  border-color: var(--border-hover);
}

.feedback-note {
  background: var(--background-tertiary);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 16px;
}

/* Desktop styles for difficulty buttons */
.difficulty-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.difficulty-btn .btn-label {
  font-weight: 600;
}

.difficulty-btn .btn-time {
  font-size: 0.85em;
  opacity: 0.9;
}

/* Enhanced Study Specific Styles */
.enhanced-variations-container {
  background: var(--background-primary);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
}

.enhanced-variations-container.answers-revealed {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.variations-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.variation-tab {
  background: var(--background-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.variation-tab:hover {
  background: var(--background-tertiary);
  border-color: var(--border-hover);
}

.variation-tab.active {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  border-color: var(--primary-color);
}

.variation-tab.answered {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success-color);
  border-color: var(--success-color);
}

.variation-content {
  display: none;
}

.variation-content.active {
  display: block;
}

.variation-style-note {
  margin-bottom: 20px;
}

.style-badge {
  background: rgba(124, 77, 255, 0.2);
  color: var(--primary-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  display: inline-block;
}

.enhanced-instruction {
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 20px;
  text-align: center;
}

.enhanced-study-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 32px;
}

.switch-btn {
  background: rgba(124, 77, 255, 0.2);
  color: var(--primary-color);
  border: 2px solid var(--border-color);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.switch-btn:hover {
  transform: translateY(-2px);
  background: rgba(124, 77, 255, 0.3);
  color: var(--primary-color);
  text-decoration: none;
  border-color: var(--border-hover);
}

/* Keyboard Shortcuts Help */
.keyboard-shortcuts-help {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  z-index: 1000;
}

.shortcuts-toggle {
  padding: 12px 16px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.shortcuts-toggle:hover {
  background: var(--background-secondary);
}

.shortcuts-list {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  max-width: 300px;
}

.shortcut {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.shortcut kbd {
  background: var(--background-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

/* Form styling for study interface */
.difficulty-form {
  display: contents;
}

/* Completion state styles */
.completion-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

h1 { font-size: 2.25rem; line-height: 2.5rem; }
h2 { font-size: 1.875rem; line-height: 2.25rem; }
h3 { font-size: 1.5rem; line-height: 2rem; }
h4 { font-size: 1.25rem; line-height: 1.75rem; }

/* Navigation */
.navbar {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  margin-bottom: 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-md);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  color: var(--primary-color) !important;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}


.navbar-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-link {
  color: var(--text-secondary) !important;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.875rem;
}

.nav-link:hover {
  background-color: rgba(124, 77, 255, 0.1);
  color: var(--primary-color) !important;
  transform: translateY(-1px);
}

/* Active navigation state */
.nav-link.active {
  background: var(--primary-color);
  color: white !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(124, 77, 255, 0.3);
}

.nav-link.active:hover {
  background: var(--primary-color);
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 77, 255, 0.4);
}

.theme-toggle {
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background-color: var(--background-tertiary);
  transform: translateY(-1px);
}

.theme-icon {
  transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
  transform: rotate(20deg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  margin: 0.125rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #3730a3 100%);
  color: white;
}

.btn-success {
  background: var(--gradient-success);
  color: white;
  border-color: var(--success-color);
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: white;
}

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

.btn-secondary:hover {
  background: var(--background-tertiary);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.5);
  transform: translateY(-1px);
}

/* Dark theme delete button adjustment */
[data-theme="dark"] .btn-danger {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}

[data-theme="dark"] .btn-danger:hover {
  background: rgba(248, 113, 113, 0.25);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.5);
}

.btn-warning {
  background: var(--gradient-warning);
  color: white;
  border-color: var(--warning-color);
}

.btn-warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: white;
}

.btn-info {
  background: var(--gradient-info);
  color: white;
  border-color: var(--info-color);
}

.btn-info:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
}

/* Study Rating Buttons - Color Theory Based Design */
.rating-btn.btn-danger {
  background: linear-gradient(135deg, #e53e3e 0%, #c92a2a 100%);
  border: none;
  box-shadow: 0 2px 8px rgba(229, 62, 62, 0.25);
  color: white;
}

.rating-btn.btn-danger:hover {
  background: linear-gradient(135deg, #c92a2a 0%, #a61e1e 100%);
  box-shadow: 0 4px 12px rgba(229, 62, 62, 0.35);
  transform: translateY(-1px);
}

.rating-btn.btn-warning {
  background: linear-gradient(135deg, #fd7f2d 0%, #f76707 100%);
  border: none;
  box-shadow: 0 2px 8px rgba(253, 127, 45, 0.25);
  color: white;
}

.rating-btn.btn-warning:hover {
  background: linear-gradient(135deg, #f76707 0%, #e8590c 100%);
  box-shadow: 0 4px 12px rgba(253, 127, 45, 0.35);
  transform: translateY(-1px);
}

.rating-btn.btn-info {
  background: linear-gradient(135deg, #4c7cf0 0%, #364fc7 100%);
  border: none;
  box-shadow: 0 2px 8px rgba(76, 124, 240, 0.25);
  color: white;
}

.rating-btn.btn-info:hover {
  background: linear-gradient(135deg, #364fc7 0%, #2f3f99 100%);
  box-shadow: 0 4px 12px rgba(76, 124, 240, 0.35);
  transform: translateY(-1px);
}

.rating-btn.btn-success {
  background: linear-gradient(135deg, #37b679 0%, #2f9e6f 100%);
  border: none;
  box-shadow: 0 2px 8px rgba(55, 182, 121, 0.25);
  color: white;
}

.rating-btn.btn-success:hover {
  background: linear-gradient(135deg, #2f9e6f 0%, #298459 100%);
  box-shadow: 0 4px 12px rgba(55, 182, 121, 0.35);
  transform: translateY(-1px);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: white;
}

.btn-outline-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.btn-outline-secondary:hover {
  background: var(--text-secondary);
  color: white;
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger-color);
  border-color: var(--danger-color);
}

.btn-outline-danger:hover {
  background: var(--danger-color);
  color: white;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1);
  background-color: var(--background-primary);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-text {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.375rem;
}

.form-actions {
  margin-top: 2rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

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

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.alert-success {
  color: #065f46;
  background-color: #d1fae5;
  border-color: #a7f3d0;
}

.alert-success::before {
  background-color: var(--success-color);
}

.alert-danger {
  color: #991b1b;
  background-color: #fee2e2;
  border-color: #fecaca;
}

.alert-danger::before {
  background-color: var(--danger-color);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card-item {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

.card-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-progress);
}

.card-front {
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.card-meta {
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-danger {
  color: white;
  background: linear-gradient(135deg, var(--danger-color), #dc2626);
}

.badge-warning {
  color: white;
  background: linear-gradient(135deg, var(--warning-color), #d97706);
}

.badge-info {
  color: white;
  background: linear-gradient(135deg, var(--info-color), #2563eb);
}

.badge-success {
  color: white;
  background: linear-gradient(135deg, var(--success-color), #059669);
}

/* Study Interface */
.study-interface {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}

.study-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem;
  background: var(--background-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.study-progress {
  margin-top: 1.5rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.progress-text {
  font-weight: 600;
  color: var(--text-primary);
}

.progress-remaining {
  color: var(--text-secondary);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--background-tertiary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.progress-fill {
  height: 100%;
  background: var(--gradient-progress);
  border-radius: var(--radius-sm);
  transition: width 0.3s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.flashcard {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-lg);
  min-height: 400px;
  position: relative;
  overflow: hidden;
}

.flashcard::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: var(--gradient-progress-multi);
}

/* Answer Input */
.answer-input {
  margin-top: 2rem;
  padding: 2rem;
  background: var(--background-secondary);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-color);
  transition: all 0.2s ease;
}

.answer-input:hover {
  border-color: var(--primary-color);
  background: var(--background-tertiary);
}

.answer-input label {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-size: 1rem;
}

.answer-input textarea {
  margin-bottom: 1rem;
  font-family: 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  min-height: 120px;
  resize: vertical;
}

.answer-input button {
  margin-top: 0.5rem;
}

/* User Answer Review */
.user-answer-review {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--background-secondary);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--primary-color);
}

.user-answer-review h4 {
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-size: 1rem;
}

.user-answer-text {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 0;
  font-family: 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

/* Rating Section */
.rating-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.rating-section h4 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.rating-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.rating-btn {
  flex: 1;
  padding: 1rem 1.5rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  min-height: 60px;
}

.rating-help {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--background-tertiary);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Code Highlighting */
pre {
  background: var(--background-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
}

code {
  background: var(--background-tertiary);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.875em;
  font-family: 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

pre code {
  background: none;
  padding: 0;
}

/* Links */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

a:visited {
  color: var(--primary-color);
}

/* Utility Classes */
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-info { color: var(--info-color); }
.text-muted { color: var(--text-muted); }

/* Layout Components */
.header-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  padding: 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* All Cards Page Styles */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2rem;
  font-weight: bold;
  margin: 0;
}

/* Default (dark theme) title */
[data-theme="dark"] .page-title {
  color: var(--text-primary);
}

/* Light theme title with gradient */
[data-theme="light"] .page-title {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.back-link {
  text-decoration: none;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  color: var(--primary-color);
}

/* Light theme back button enhancement */
[data-theme="light"] .back-link {
  box-shadow: 0 2px 8px rgba(107, 70, 193, 0.08);
}

.back-link:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  color: var(--primary-color);
  text-decoration: none;
}

/* Default (dark theme) back button hover */
[data-theme="dark"] .back-link:hover {
  background: rgba(124, 77, 255, 0.1);
}

/* Light theme back button hover */
[data-theme="light"] .back-link:hover {
  background: rgba(107, 70, 193, 0.15);
  box-shadow: 0 4px 12px rgba(107, 70, 193, 0.15);
}

.add-card-btn, .import-btn, .export-btn, .batch-delete-btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: white;
}

.add-card-btn {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.import-btn {
  background: linear-gradient(135deg, var(--success-color) 0%, #26d0ce 100%);
}

.export-btn {
  background: linear-gradient(135deg, var(--warning-color) 0%, #ffb74d 100%);
}

/* Default (dark theme) button shadows */
[data-theme="dark"] .add-card-btn {
  box-shadow: 0 4px 15px rgba(124, 77, 255, 0.3);
}
[data-theme="dark"] .import-btn {
  box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}
[data-theme="dark"] .export-btn {
  box-shadow: 0 4px 15px rgba(255, 167, 38, 0.3);
}

/* Light theme button shadows */
[data-theme="light"] .add-card-btn {
  box-shadow: 0 4px 15px rgba(107, 70, 193, 0.25);
}
[data-theme="light"] .import-btn {
  box-shadow: 0 4px 15px rgba(8, 145, 178, 0.25);
}
[data-theme="light"] .export-btn {
  box-shadow: 0 4px 15px rgba(234, 88, 12, 0.25);
}

.add-card-btn:hover, .import-btn:hover, .export-btn:hover, .batch-delete-btn:hover {
  transform: translateY(-2px);
  color: white;
  text-decoration: none;
}

/* Default (dark theme) button hover shadows */
[data-theme="dark"] .add-card-btn:hover {
  box-shadow: 0 6px 20px rgba(124, 77, 255, 0.4);
}
[data-theme="dark"] .import-btn:hover {
  box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}
[data-theme="dark"] .export-btn:hover {
  box-shadow: 0 6px 20px rgba(255, 167, 38, 0.4);
}

/* Light theme button hover shadows */
[data-theme="light"] .add-card-btn:hover {
  box-shadow: 0 6px 20px rgba(107, 70, 193, 0.35);
}
[data-theme="light"] .import-btn:hover {
  box-shadow: 0 6px 20px rgba(8, 145, 178, 0.35);
}
[data-theme="light"] .export-btn:hover {
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.35);
}

/* Filters Section */
.filters-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border-radius: 1rem;
  backdrop-filter: blur(10px);
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.filters-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 1.25rem;
  align-items: center;
}

.search-box {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.875rem;
  transition: all 0.3s ease;
  background: var(--background-secondary);
  color: var(--text-primary);
  backdrop-filter: blur(10px);
}

.search-input:focus {
  border-color: var(--primary-color);
  background: var(--background-primary);
  /* Global focus indicator from design system will handle outline */
}

.search-input::placeholder {
  color: var(--text-muted);
}

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

.filter-select {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--background-secondary);
  color: var(--text-primary);
  backdrop-filter: blur(10px);
}

.filter-select:focus {
  border-color: var(--primary-color);
  /* Global focus indicator from design system will handle outline */
}

.clear-btn {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--secondary-color);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  background: rgba(var(--secondary-color), 0.1);
  color: var(--secondary-color);
  text-decoration: none;
}

.clear-btn:hover {
  background: rgba(var(--secondary-color), 0.2);
  text-decoration: none;
  color: var(--secondary-color);
}

.results-count {
  text-align: center;
  padding: 1rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  background: var(--background-secondary);
  color: var(--text-secondary);
}

/* Cards Table */
.cards-table {
  border-radius: 1rem;
  overflow: hidden;
  backdrop-filter: blur(10px);
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.table-header {
  display: grid;
  grid-template-columns: 40px 3fr 1fr 1fr 1fr 1fr 1.5fr;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--background-secondary);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.card-row {
  display: grid;
  grid-template-columns: 40px 3fr 1fr 1fr 1fr 1fr 1.5fr;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  transition: all 0.3s ease;
  border-bottom: 1px solid var(--border-light);
  align-items: center;
}

.card-row:hover {
  background: rgba(var(--primary-color), 0.05);
}

.card-row:last-child {
  border-bottom: none;
}

/* Truncated question text for card listings only */
.cards-table .question-text,
.card-row .question-text {
  font-size: 0.875rem;
  line-height: 1.4;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--text-primary);
}

.status-badge {
  padding: 0.25rem 0.625rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.75rem;
  white-space: nowrap;
}

/* Default (dark theme) status badges */
[data-theme="dark"] .status-overdue {
  background: linear-gradient(135deg, #ff6b6b, #dc2626);
  color: white;
}

[data-theme="dark"] .status-due {
  background: linear-gradient(135deg, #ffa726, #d97706);
  color: white;
}

[data-theme="dark"] .status-learning {
  background: linear-gradient(135deg, #7c4dff, #2563eb);
  color: white;
}

[data-theme="dark"] .status-review {
  background: linear-gradient(135deg, #4ecdc4, #059669);
  color: white;
}

/* Light theme status badges */
[data-theme="light"] .status-overdue {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

[data-theme="light"] .status-due {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  color: white;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.2);
}

[data-theme="light"] .status-learning {
  background: linear-gradient(135deg, #0891b2, #0e7490);
  color: white;
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.2);
}

[data-theme="light"] .status-review {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  color: white;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.2);
}

.difficulty-score {
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* ===============================================
   IMPROVED UX COMPONENTS
   =============================================== */

/* Collapsible Filters */
.filters-header {
  margin-bottom: var(--space-4);
}

.filters-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: var(--touch-target);
  padding: var(--space-3) var(--space-4);
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filters-toggle:hover {
  background: rgba(var(--primary-color-rgb), 0.05);
  border-color: var(--primary-color);
}

.toggle-icon {
  font-size: var(--text-sm);
  transition: transform 0.2s ease;
}

.filter-container.collapsed .filters-wrapper {
  display: none;
}

.filter-container:not(.collapsed) .filters-wrapper {
  display: block;
  animation: slideDown 0.3s ease;
}

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

/* Mobile Cards Grid */
.mobile-cards-grid {
  display: none; /* Hidden by default, shown on mobile via media query */
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.mobile-card {
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: all 0.3s ease;
}

.mobile-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(var(--primary-color-rgb), 0.3);
}

.mobile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.mobile-card-checkbox input[type="checkbox"] {
  min-width: var(--space-5);
  min-height: var(--space-5);
}

.mobile-card-content {
  margin-bottom: var(--space-4);
}

.mobile-card-question {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-4);
  color: var(--text-primary);
  font-weight: 500;
}

.mobile-card-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
}

.meta-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.mobile-card-actions {
  display: flex;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-color);
}

.mobile-card-actions .action-btn {
  flex: 1;
  text-align: center;
  min-height: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive Layout Changes */
@media (max-width: 768px) {
  /* Hide desktop table, show mobile cards */
  .cards-table {
    display: none;
  }
  
  .mobile-cards-grid {
    display: flex;
    flex-direction: column;
  }
  
  /* Make filters more mobile-friendly */
  .filters-wrapper {
    padding: var(--space-4);
  }
  
  .filter-group {
    margin-bottom: var(--space-3);
  }
  
  .filter-pill {
    min-height: var(--touch-target);
    font-size: var(--text-base); /* Prevent iOS zoom */
  }
}

.next-review {
  font-weight: 500;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* Status column alignment */
.card-row > div:nth-child(3) {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* Default (dark theme) difficulty and review colors */
[data-theme="dark"] .difficulty-score {
  color: #4ecdc4;
}

[data-theme="dark"] .next-review {
  color: #ffa726;
}

/* Light theme difficulty and review colors */
[data-theme="light"] .difficulty-score {
  color: #0891b2;
}

[data-theme="light"] .next-review {
  color: #ea580c;
}

.actions-cell {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
}

.action-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  min-width: 3.5rem;
}

/* Default (dark theme) action buttons */
[data-theme="dark"] .view-btn {
  background: rgba(78, 205, 196, 0.2);
  color: #4ecdc4;
  border-color: rgba(78, 205, 196, 0.3);
}

[data-theme="dark"] .edit-btn {
  background: rgba(255, 167, 38, 0.2);
  color: #ffa726;
  border-color: rgba(255, 167, 38, 0.3);
}

[data-theme="dark"] .delete-btn {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.3);
}

/* Light theme action buttons */
[data-theme="light"] .view-btn {
  background: rgba(8, 145, 178, 0.15);
  color: #0c4a6e;
  border-color: rgba(8, 145, 178, 0.4);
}

[data-theme="light"] .edit-btn {
  background: rgba(234, 88, 12, 0.15);
  color: #9a3412;
  border-color: rgba(234, 88, 12, 0.4);
}

[data-theme="light"] .delete-btn {
  background: rgba(239, 68, 68, 0.15);
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.4);
}

.view-btn:hover,
.edit-btn:hover,
.delete-btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

/* Default (dark theme) action button hovers */
[data-theme="dark"] .view-btn:hover {
  background: rgba(78, 205, 196, 0.3);
  color: #4ecdc4;
}

[data-theme="dark"] .edit-btn:hover {
  background: rgba(255, 167, 38, 0.3);
  color: #ffa726;
}

[data-theme="dark"] .delete-btn:hover {
  background: rgba(255, 107, 107, 0.3);
  color: #ff6b6b;
}

/* Light theme action button hovers */
[data-theme="light"] .view-btn:hover {
  background: rgba(8, 145, 178, 0.25);
  color: #0c4a6e;
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.2);
}

[data-theme="light"] .edit-btn:hover {
  background: rgba(234, 88, 12, 0.25);
  color: #9a3412;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.2);
}

[data-theme="light"] .delete-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #991b1b;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.no-cards-message {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  border: 2px dashed var(--border-color);
  box-shadow: var(--shadow-md);
}

.no-cards-message h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

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

  .page-header {
    flex-direction: column;
    gap: 1.25rem;
    align-items: stretch;
  }

  .header-actions {
    justify-content: space-between;
  }

  .table-header,
  .card-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .actions-cell {
    justify-content: flex-start;
  }
}

.header-section h1 {
  margin: 0;
  flex: 1;
}

.stats {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.stats p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

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

.import-section {
  background: var(--background-primary);
  padding: 2rem;
  border-radius: var(--radius-xl);
  margin-bottom: 2.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.import-section h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.cards-list h3 {
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.card-details {
  background: var(--background-primary);
  padding: 2.5rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.card-content {
  margin: 2.5rem 0;
}

.card-side {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.card-side:last-child {
  border-bottom: none;
}

.card-side .content {
  margin-top: 1rem;
  padding: 1.5rem;
  background: var(--background-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.card-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--background-secondary);
  border-radius: var(--radius-lg);
}

.card-info p {
  margin: 0;
  font-size: 0.875rem;
}

.markdown-help {
  margin-top: 2.5rem;
  padding: 2rem;
  background: var(--background-tertiary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
}

.no-cards {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--background-primary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.study-actions {
  text-align: center;
  margin-top: 2rem;
}

/* Filter Section */
.filter-section {
  background: var(--background-primary);
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.filter-form {
  margin-bottom: 1rem;
}

.search-row {
  display: grid;
  grid-template-columns: 2fr 3fr 1fr;
  gap: 1rem;
  align-items: end;
}

.search-input {
  position: relative;
}

.search-input::before {
  content: "🔍";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  opacity: 0.5;
}

.search-input .form-control {
  padding-left: 2.5rem;
}

.filter-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.filter-select {
  font-size: 0.875rem;
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
  align-items: end;
}

.active-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--primary-color);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

.filter-remove {
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 0 0.25rem;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.filter-remove:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.results-info {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 0.5rem;
  background: var(--background-tertiary);
  border-radius: var(--radius-md);
}

/* Keyboard Shortcuts Help */
.keyboard-shortcuts-help {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 100;
  max-width: 300px;
}

.shortcuts-toggle {
  background: var(--primary-color);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transition: all 0.2s ease;
  text-align: center;
}

.shortcuts-toggle:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.shortcuts-list {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-top: 0.5rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

.shortcut {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border-light);
}

.shortcut:last-child {
  border-bottom: none;
}

kbd {
  background: var(--background-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Import Page Styles */
.import-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.upload-section {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

/* Default (dark theme) upload section */
[data-theme="dark"] .upload-section {
  background: rgba(255, 255, 255, 0.03);
}

/* Light theme upload section */
[data-theme="light"] .upload-section {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 32px rgba(107, 70, 193, 0.08);
}

.upload-section:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

/* Default (dark theme) upload section hover */
[data-theme="dark"] .upload-section:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 32px rgba(124, 77, 255, 0.15);
}

/* Light theme upload section hover */
[data-theme="light"] .upload-section:hover {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 40px rgba(107, 70, 193, 0.12);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.upload-section h3 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-weight: 600;
}

.upload-description {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.upload-form {
  margin-top: 2rem;
}

.file-input-container {
  position: relative;
  margin-bottom: 2rem;
}

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

.file-input-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--background-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-primary);
  font-weight: 500;
}

.file-input-label:hover {
  border-color: var(--primary-color);
  background: var(--background-tertiary);
  transform: translateY(-1px);
}

/* Default (dark theme) file input label hover */
[data-theme="dark"] .file-input-label:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Light theme file input label hover */
[data-theme="light"] .file-input-label:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 12px rgba(107, 70, 193, 0.08);
}

.file-icon {
  font-size: 2rem;
  opacity: 0.7;
}

.file-text {
  font-size: 0.9rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.import-btn {
  padding: 0.875rem 2rem;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Default (dark theme) import button */
[data-theme="dark"] .import-btn {
  box-shadow: 0 4px 15px rgba(124, 77, 255, 0.3);
}

/* Light theme import button */
[data-theme="light"] .import-btn {
  box-shadow: 0 4px 15px rgba(107, 70, 193, 0.25);
}

.import-btn:hover {
  transform: translateY(-2px);
  color: white;
  text-decoration: none;
}

/* Default (dark theme) import button hover */
[data-theme="dark"] .import-btn:hover {
  box-shadow: 0 6px 20px rgba(124, 77, 255, 0.4);
}

/* Light theme import button hover */
[data-theme="light"] .import-btn:hover {
  box-shadow: 0 6px 20px rgba(107, 70, 193, 0.35);
}

.cancel-btn {
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--background-secondary);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cancel-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--background-tertiary);
  text-decoration: none;
  transform: translateY(-1px);
}

.format-guide {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

/* Default (dark theme) format guide */
[data-theme="dark"] .format-guide {
  background: rgba(255, 255, 255, 0.03);
}

/* Light theme format guide */
[data-theme="light"] .format-guide {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 32px rgba(107, 70, 193, 0.08);
}

.format-guide h4 {
  margin: 0 0 1.5rem 0;
  color: var(--text-primary);
  font-weight: 600;
}

.format-example {
  margin-bottom: 2rem;
}

.format-example h5 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
}

.code-block {
  background: var(--background-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 0;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.5;
}

.code-block code {
  background: none;
  padding: 0;
  font-family: 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  color: var(--text-primary);
}

.format-tips h5 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
}

.tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tips-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.tip-icon {
  color: var(--success-color);
  font-weight: 600;
  font-size: 0.8rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

/* Study Page Styles */
.study-interface {
  max-width: 950px;
  margin: 0 auto;
  padding: 1rem;
}

.study-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

/* Default (dark theme) study header */
[data-theme="dark"] .study-header {
  background: rgba(255, 255, 255, 0.03);
}

/* Light theme study header */
[data-theme="light"] .study-header {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 32px rgba(107, 70, 193, 0.08);
}

.study-title h1 {
  margin: 0 0 1rem 0;
  font-size: 2rem;
  font-weight: 700;
}

/* Default (dark theme) study title */
[data-theme="dark"] .study-title h1 {
  color: var(--text-primary);
}

/* Light theme study title with gradient */
[data-theme="light"] .study-title h1 {
  background: linear-gradient(45deg, #6b46c1, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.session-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.current-progress {
  color: var(--text-primary);
  font-weight: 600;
}

.remaining-count {
  color: var(--text-secondary);
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--background-tertiary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.progress-fill {
  height: 100%;
  background: var(--gradient-progress);
  border-radius: var(--radius-sm);
  transition: width 0.3s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

.progress-percentage {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 3rem;
  text-align: right;
}

.study-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-lg);
  min-height: 400px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Default (dark theme) study card */
[data-theme="dark"] .study-card {
  background: rgba(255, 255, 255, 0.03);
}

/* Light theme study card */
[data-theme="light"] .study-card {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 40px rgba(107, 70, 193, 0.1);
}

.study-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: var(--gradient-progress-multi);
}

.card-side {
  opacity: 1;
  transition: opacity 0.3s ease;
}

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

.card-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-number {
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: var(--background-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.card-content {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 2rem;
  min-height: 150px;
}

.answer-section {
  margin-top: 2rem;
  padding: 2rem;
  background: var(--background-secondary);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-color);
  transition: all 0.3s ease;
}

.answer-section:hover {
  border-color: var(--primary-color);
  background: var(--background-tertiary);
}

/* Default (dark theme) answer section hover */
[data-theme="dark"] .answer-section:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Light theme answer section hover */
[data-theme="light"] .answer-section:hover {
  background: rgba(255, 255, 255, 0.95);
}

.answer-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-size: 1rem;
}

.answer-textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--background-primary);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  min-height: 120px;
  resize: vertical;
  transition: all 0.3s ease;
}

.answer-textarea:focus {
  border-color: var(--primary-color);
  background: var(--background-secondary);
  /* Global focus indicator from design system will handle outline */
}

.answer-textarea::placeholder {
  color: var(--text-muted);
}

.reveal-btn {
  margin-top: 1rem;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  margin-right: auto;
}

/* Default (dark theme) reveal button */
[data-theme="dark"] .reveal-btn {
  box-shadow: 0 4px 15px rgba(124, 77, 255, 0.3);
}

/* Light theme reveal button */
[data-theme="light"] .reveal-btn {
  box-shadow: 0 4px 15px rgba(107, 70, 193, 0.25);
}

.reveal-btn:hover {
  transform: translateY(-2px);
}

/* Default (dark theme) reveal button hover */
[data-theme="dark"] .reveal-btn:hover {
  box-shadow: 0 6px 20px rgba(124, 77, 255, 0.4);
}

/* Light theme reveal button hover */
[data-theme="light"] .reveal-btn:hover {
  box-shadow: 0 6px 20px rgba(107, 70, 193, 0.35);
}

.btn-icon {
  font-size: 1rem;
}

.user-answer-review {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--background-secondary);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--primary-color);
}

.user-answer-review h4 {
  margin: 0 0 0.75rem 0;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
}

.user-answer-display {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  color: var(--text-primary);
}

.rating-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.rating-section h4 {
  text-align: center;
  margin: 0 0 1.5rem 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 1.5rem 0;
  max-width: 100%;
  overflow: visible;
}

.rating-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.rating-btn {
  width: 100%;
  padding: 0.875rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.rating-again {
  background: var(--background-secondary);
  color: var(--danger-color);
  border-color: rgba(255, 107, 107, 0.3);
}

.rating-hard {
  background: var(--background-secondary);
  color: var(--warning-color);
  border-color: rgba(255, 167, 38, 0.3);
}

.rating-good {
  background: var(--background-secondary);
  color: var(--info-color);
  border-color: rgba(124, 77, 255, 0.3);
}

.rating-easy {
  background: var(--background-secondary);
  color: var(--success-color);
  border-color: rgba(78, 205, 196, 0.3);
}

/* Default (dark theme) rating buttons */
[data-theme="dark"] .rating-again {
  background: rgba(255, 107, 107, 0.1);
}

[data-theme="dark"] .rating-hard {
  background: rgba(255, 167, 38, 0.1);
}

[data-theme="dark"] .rating-good {
  background: rgba(124, 77, 255, 0.1);
}

[data-theme="dark"] .rating-easy {
  background: rgba(78, 205, 196, 0.1);
}

/* Light theme rating buttons */
[data-theme="light"] .rating-again {
  background: rgba(239, 68, 68, 0.05);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

[data-theme="light"] .rating-hard {
  background: rgba(234, 88, 12, 0.05);
  color: #ea580c;
  border-color: rgba(234, 88, 12, 0.2);
}

[data-theme="light"] .rating-good {
  background: rgba(107, 70, 193, 0.05);
  color: #6b46c1;
  border-color: rgba(107, 70, 193, 0.2);
}

[data-theme="light"] .rating-easy {
  background: rgba(8, 145, 178, 0.05);
  color: #0891b2;
  border-color: rgba(8, 145, 178, 0.2);
}

.rating-btn:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

/* Default (dark theme) rating button hovers */
[data-theme="dark"] .rating-again:hover {
  background: rgba(255, 107, 107, 0.2);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.15);
}

[data-theme="dark"] .rating-hard:hover {
  background: rgba(255, 167, 38, 0.2);
  box-shadow: 0 4px 15px rgba(255, 167, 38, 0.15);
}

[data-theme="dark"] .rating-good:hover {
  background: rgba(124, 77, 255, 0.2);
  box-shadow: 0 4px 15px rgba(124, 77, 255, 0.15);
}

[data-theme="dark"] .rating-easy:hover {
  background: rgba(78, 205, 196, 0.2);
  box-shadow: 0 4px 15px rgba(78, 205, 196, 0.15);
}

/* Light theme rating button hovers */
[data-theme="light"] .rating-again:hover {
  background: rgba(239, 68, 68, 0.1);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.1);
}

[data-theme="light"] .rating-hard:hover {
  background: rgba(234, 88, 12, 0.1);
  box-shadow: 0 4px 15px rgba(234, 88, 12, 0.1);
}

[data-theme="light"] .rating-good:hover {
  background: rgba(107, 70, 193, 0.1);
  box-shadow: 0 4px 15px rgba(107, 70, 193, 0.1);
}

[data-theme="light"] .rating-easy:hover {
  background: rgba(8, 145, 178, 0.1);
  box-shadow: 0 4px 15px rgba(8, 145, 178, 0.1);
}

.rating-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
}

.rating-help {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--background-tertiary);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Default (dark theme) rating help */
[data-theme="dark"] .rating-help {
  background: rgba(255, 255, 255, 0.05);
}

/* Light theme rating help */
[data-theme="light"] .rating-help {
  background: rgba(255, 255, 255, 0.6);
}

.help-item {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.help-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

.study-actions {
  text-align: center;
  margin-top: 2rem;
}

.exit-study-btn {
  padding: 0.875rem 2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--background-secondary);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.exit-study-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--background-tertiary);
  text-decoration: none;
  transform: translateY(-1px);
}

.study-complete {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

/* Default (dark theme) study complete */
[data-theme="dark"] .study-complete {
  background: rgba(255, 255, 255, 0.03);
}

/* Light theme study complete */
[data-theme="light"] .study-complete {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 32px rgba(107, 70, 193, 0.08);
}

.completion-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.study-complete h1 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-weight: 700;
}

.study-complete p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.completion-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.back-to-cards-btn,
.back-to-dashboard-btn {
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border-color);
  background: var(--background-secondary);
  color: var(--text-primary);
}

.back-to-cards-btn:hover,
.back-to-dashboard-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--background-tertiary);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Responsive Design for Import and Study */
@media (max-width: 768px) {
  .import-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .upload-section,
  .format-guide {
    padding: 1.5rem;
  }
  
  .study-interface {
    padding: 0.75rem;
  }
  
  .study-header,
  .study-card {
    padding: 1.5rem;
  }
  
  .session-stats {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  
  .rating-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .rating-btn {
    font-size: 0.8rem;
    padding: 0.75rem 0.5rem;
  }
  
  .completion-actions {
    flex-direction: column;
    align-items: center;
  }
}

/* Table Styles */
.table-responsive {
  margin-top: 1.5rem;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.cards-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--background-primary);
  font-size: 0.875rem;
}

.cards-table thead {
  background: var(--background-secondary);
  border-bottom: 2px solid var(--border-color);
}

.cards-table th {
  padding: 1rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--background-secondary);
  z-index: 10;
}

.cards-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.card-row {
  transition: background-color 0.15s ease;
}

.card-row:hover {
  background-color: var(--background-tertiary);
}

.card-front-cell {
  max-width: 300px;
  width: 40%;
}

.card-front-preview {
  line-height: 1.4;
  color: var(--text-primary);
  word-break: break-word;
}

.status-cell {
  width: 120px;
  text-align: center;
}

.difficulty-cell {
  width: 80px;
  text-align: center;
}

.difficulty-value {
  font-weight: 600;
  color: var(--text-secondary);
}

.next-review-cell {
  width: 120px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.actions-cell {
  width: 200px;
}

.table-actions {
  display: flex;
  gap: 0.375rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.table-actions .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  min-width: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .header-section {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  
  .stats {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .actions {
    justify-content: center;
  }
  
  .rating-buttons {
    grid-template-columns: 1fr;
  }
  
  .rating-btn {
    min-width: auto;
  }
  
  .card-info {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .flashcard {
    padding: 1.5rem;
  }
  
  .navbar .container {
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .navbar-nav {
    width: 100%;
    justify-content: center;
  }
  
  /* Table responsive on mobile */
  .cards-table th:nth-child(3),
  .cards-table td:nth-child(3) {
    display: none; /* Hide difficulty column on mobile */
  }
  
  .card-front-cell {
    width: 50%;
  }
  
  .table-actions {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .table-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .study-interface {
    padding: 0.5rem;
  }
  
  .flashcard {
    padding: 1rem;
    margin: 1rem 0;
  }
  
  .answer-input {
    padding: 1rem;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Loading and Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-item,
.flashcard,
.header-section,
.import-section {
  animation: fadeIn 0.3s ease-out;
}

/* Modal Styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-backdrop.show {
  opacity: 1;
}

.confirmation-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  z-index: 1001;
  opacity: 0;
  transition: all 0.3s ease;
}

.confirmation-modal.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.modal-content {
  background: var(--background-primary);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  min-width: 400px;
  max-width: 90vw;
}

.modal-content h3 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-size: 1.25rem;
}

.modal-content p {
  margin: 0 0 2rem 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.modal-actions .btn {
  min-width: 80px;
}

/* Modal delete button should use solid styling for emphasis */
.modal-actions .btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.modal-actions .btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Authentication Styles */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--background-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  padding: 3rem;
  width: 100%;
  max-width: 450px;
  animation: fadeIn 0.3s ease-out;
}

.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-header h1 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-size: 2rem;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

.auth-form .form-group {
  margin-bottom: 1.5rem;
}

.auth-form .form-actions {
  margin-top: 2rem;
  margin-bottom: 0;
}

.btn-full-width {
  width: 100%;
  justify-content: center;
  padding: 0.875rem 1.5rem;
  font-weight: 600;
}

.auth-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}

.auth-footer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.auth-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Navigation User Greeting */
.nav-greeting {
  color: var(--text-secondary) !important;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.logout-link {
  color: #f87171 !important;
  opacity: 0.9;
}

.logout-link:hover {
  color: #ef4444 !important;
  opacity: 1;
}

/* New Card Creation Interface */
.new-card-page {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.card-form-container {
  background: var(--background-primary);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

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

.right-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card-preview-section {
  background: var(--background-primary);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.preview-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--background-secondary);
}

.preview-front,
.preview-back {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.preview-back {
  border-bottom: none;
  background: var(--background-tertiary);
}

.preview-front h4,
.preview-back h4 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
}

.preview-content {
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 60px;
}

.preview-content pre {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 0.5rem 0;
  overflow-x: auto;
  font-size: 0.875rem;
}

.preview-content code {
  background: var(--background-primary);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  border: 1px solid var(--border-light);
}

.preview-content pre code {
  background: none;
  padding: 0;
  border: none;
}

/* Header styling in preview */
.preview-content h1,
.preview-content h2,
.preview-content h3,
.preview-content h4,
.preview-content h5,
.preview-content h6 {
  margin: 1rem 0 0.5rem 0;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
}

.preview-content h1 { font-size: 1.875rem; }
.preview-content h2 { font-size: 1.5rem; }
.preview-content h3 { font-size: 1.25rem; }
.preview-content h4 { font-size: 1.125rem; }

.preview-content h1:first-child,
.preview-content h2:first-child,
.preview-content h3:first-child,
.preview-content h4:first-child {
  margin-top: 0;
}

/* Math formula styling */
.preview-content .MathJax,
.preview-content .MathJax_Display {
  margin: 0.5rem 0;
}

.preview-content .MathJax_Display {
  text-align: center;
}

/* Ensure math formulas are readable in both themes */
[data-theme="dark"] .preview-content .MathJax {
  color: var(--text-primary);
}

.card-content .MathJax,
.card-content .MathJax_Display {
  margin: 0.5rem 0;
}

.card-content .MathJax_Display {
  text-align: center;
}

[data-theme="dark"] .card-content .MathJax {
  color: var(--text-primary);
}

/* Study mode textarea styling */
.answer-input textarea.answer-revealed {
  background-color: var(--background-tertiary);
  border-color: var(--border-color);
  border-width: 2px;
}

.answer-input textarea.answer-revealed:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Global Difficulty Buttons Grid Layout */
.difficulty-buttons {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 8px !important;
}

.difficulty-section .difficulty-form {
  display: contents !important;
  margin: 0 !important;
}

/* Mobile Study Layout - Compact Design */
@media (max-width: 768px) {
  body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .main-container {
    height: 100vh;
    max-width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .study-session-card {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Compact Study Header - Minimized */
  .session-header {
    background: rgba(30, 35, 50, 0.95);
    backdrop-filter: blur(10px);
    padding: 8px 12px;
    color: white;
    margin-bottom: 0;
    flex-shrink: 0;
    max-height: 80px;
  }

  .session-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
  }

  .session-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: white;
  }

  .category-filter-form {
    margin-bottom: 4px;
  }

  .category-filter-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
  }

  .session-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
  }

  .progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
  }

  .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
  }

  .progress-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    min-width: 40px;
  }

  /* Card Content Area - Maximized with Theme Integration */
  .card-content-area {
    background: transparent;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .card-inner-content {
    flex: 1;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  /* Question Section - Compact with Theme Integration */
  .question-section {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px;
  }

  .question-header {
    display: none; /* Hide to save space */
  }

  .question-text {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    line-height: 1.4 !important;
  }

  /* Answer Input - Much Smaller */
  .answer-input {
    background: var(--background-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    font-size: 15px;
    color: var(--text-primary);
    resize: none;
    min-height: 50px;
    max-height: 70px;
    overflow-y: auto;
    line-height: 1.4;
    font-family: inherit;
  }

  .answer-input:focus {
    border-color: #667eea;
    /* Global focus indicator from design system will handle outline */
  }

  /* Show Answer Button */
  .show-answer-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
  }

  .show-answer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
  }

  /* Answer Revealed Section */
  .answer-revealed {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .question-reminder {
    background: rgba(248, 249, 250, 0.8);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 8px;
  }

  .question-reminder-header {
    display: none; /* Hide to save space */
  }

  .question-reminder-text {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    line-height: 1.4 !important;
  }

  .answer-header {
    display: none; /* Hide to save space */
  }

  .correct-answer {
    background: var(--background-secondary);
    border-radius: 10px;
    padding: 10px;
    border: 1px solid var(--border-color);
  }

  .correct-answer-text {
    font-size: 16px !important;
    color: var(--text-primary) !important;
    line-height: 1.4 !important;
    font-weight: 500 !important;
  }

  .user-answer-display {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .user-answer-label {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
  }

  .answer-shown-btn {
    background: rgba(240, 240, 240, 0.95);
    color: #1a1a1a;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    margin-top: 10px;
  }

  /* Compact Rating Section - Always Visible */
  .difficulty-section {
    background: rgba(30, 35, 50, 0.95);
    padding: 8px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0;
    flex-shrink: 0;
  }

  .difficulty-title {
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .difficulty-buttons {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  .difficulty-section .difficulty-form {
    display: contents !important; /* This makes the form not interfere with grid layout */
    margin: 0 !important;
  }

  .difficulty-btn {
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    position: relative;
    overflow: hidden;
    min-height: 38px;
  }

  .difficulty-btn.again {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
  }

  .difficulty-btn.hard {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.3);
  }

  .difficulty-btn.good {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.3);
  }

  .difficulty-btn.easy {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.3);
  }

  .difficulty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  }

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

  .difficulty-times {
    display: none; /* Hide timing info on mobile */
  }

  .feedback-note {
    display: none; /* Hide feedback note on mobile */
  }

  /* Proper text contrast for mobile study session using CSS variables */
  .study-session-card .question-text,
  .study-session-card .question-text p,
  .study-session-card .question-text span,
  .study-session-card .question-text div {
    color: var(--text-primary) !important;
  }

  .study-session-card .correct-answer-text,
  .study-session-card .correct-answer-text p,
  .study-session-card .correct-answer-text span,
  .study-session-card .correct-answer-text div {
    color: var(--text-primary) !important;
  }

  .study-session-card .question-reminder-text,
  .study-session-card .question-reminder-text p,
  .study-session-card .question-reminder-text span,
  .study-session-card .question-reminder-text div {
    color: var(--text-primary) !important;
  }

  /* Hide time in difficulty buttons on mobile */
  .difficulty-btn .btn-time {
    display: none !important;
  }

  .difficulty-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .difficulty-btn .btn-label {
    display: block !important;
  }

  /* Exit Button - Put it back in original position */
  .exit-btn {
    background: linear-gradient(135deg, #ef5350, #e53935);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    margin-top: 15px;
    text-align: center;
  }

  .exit-btn:hover {
    background: linear-gradient(135deg, #e53935, #d32f2f);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 83, 80, 0.4);
  }
}

/* Ensure answer input is visible and styled properly */
#answer-input-back {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--background-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

#answer-input-back label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: block;
}

/* Language-specific code styling */
.preview-content code[class*="language-"] {
  font-family: 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  background: var(--background-primary);
  border: 1px solid var(--border-light);
}

.preview-content pre code[class*="language-"] {
  background: none;
  border: none;
  font-family: 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Add slight background tint for different languages */
.preview-content pre code.language-bash,
.preview-content pre code.language-sh {
  color: #22c55e;
}

.preview-content pre code.language-javascript,
.preview-content pre code.language-js {
  color: #f59e0b;
}

.preview-content pre code.language-python,
.preview-content pre code.language-py {
  color: #3b82f6;
}

.preview-content pre code.language-ruby,
.preview-content pre code.language-rb {
  color: #ef4444;
}

.preview-content pre code.language-sql {
  color: #8b5cf6;
}

/* Markdown Help Collapsible */
.markdown-help {
  background: var(--background-primary);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.markdown-help details {
  cursor: pointer;
}

.markdown-help details summary {
  list-style: none;
  margin-bottom: 0;
  /* Focus will be handled by global focus indicator */
}

.markdown-help details summary::-webkit-details-marker {
  display: none;
}

.markdown-help details summary::before {
  content: "▶";
  margin-right: 0.5rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

.markdown-help details[open] summary::before {
  transform: rotate(90deg);
}

.markdown-help details summary h3 {
  display: inline;
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

.markdown-help details[open] summary h3 {
  color: var(--text-primary);
}

.markdown-help .help-content {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.markdown-help pre {
  background: var(--background-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin: 0.5rem 0;
  overflow-x: auto;
  font-size: 0.8rem;
}

.markdown-help code {
  background: var(--background-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  border: 1px solid var(--border-light);
}

/* Button improvements for new card flow */
.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 2rem;
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
  color: white;
  border-color: var(--success-color);
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: white;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .new-card-page {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Focus States for Accessibility */
.btn:focus,
.form-control:focus,
.nav-link:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .navbar,
  .actions,
  .card-actions,
  .study-actions,
  .rating-section,
  .answer-input {
    display: none !important;
  }
  
  .card-item,
  .flashcard {
    box-shadow: none;
    border: 1px solid #000;
    page-break-inside: avoid;
  }
}

/* ===== MOBILE RESPONSIVE STYLES ===== */

/* Mobile Navigation */
.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  position: relative;
}

@media (max-width: 768px) {
  .navbar-container {
    padding: 0 max(env(safe-area-inset-left, 0.25rem), 0.25rem) 0 max(env(safe-area-inset-right, 0.25rem), 0.25rem);
  }
  
  /* Enhanced mobile touch targets */
  .btn, .nav-link, .action-card, .card-link {
    min-height: var(--touch-target);
    touch-action: manipulation;
  }
  
  /* Mobile button spacing improvements */
  .btn {
    padding: 0.75rem 1rem;
    margin: 0.25rem;
  }
  
  /* Action buttons on mobile */
  .view-btn, .edit-btn, .delete-btn {
    min-height: var(--touch-target);
    min-width: var(--touch-target);
    padding: 0.625rem;
  }
  
  /* Mobile navigation improvements */
  .nav-link {
    padding: 1rem;
    margin: 0.25rem 0;
  }
  
  /* Optimize glassmorphism for mobile performance */
  .stat-card,
  .action-card,
  .card,
  .study-card,
  .no-cards-message,
  .format-guide,
  .upload-section {
    backdrop-filter: none;
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
  }
  
  /* Reduce blur effects on mobile */
  .mobile-menu {
    backdrop-filter: blur(10px) !important;
  }
  
  /* Simplify shadows on mobile */
  .card:hover,
  .action-card:hover,
  .stat-card:hover {
    transform: none;
    box-shadow: var(--shadow-md);
  }
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.625rem;
  width: var(--touch-target);
  height: var(--touch-target);
  justify-content: center;
  align-items: center;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.mobile-menu-toggle:hover {
  background: var(--background-tertiary);
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  margin: 2px 0;
  transition: all 0.3s ease;
  border-radius: 1px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Breakpoints */
@media (max-width: 768px) {
  /* Mobile body padding for safe areas */
  body {
    padding: 0;
    overflow-x: hidden;
    font-size: 16px;
  }
  
  /* Improve mobile typography */
  .container {
    padding: 1rem;
  }

  /* Mobile Navigation */
  .mobile-menu-toggle {
    display: flex;
  }

  .mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(20, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding: max(env(safe-area-inset-top, 80px), 80px) env(safe-area-inset-right, 0) max(env(safe-area-inset-bottom, 20px), 20px) 0;
    transition: right 0.3s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .mobile-menu.show {
    right: 0;
  }

  .mobile-menu .nav-greeting {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 32px;
    padding: 0 20px 20px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mobile-menu .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin: 4px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 15px;
    position: relative;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    min-height: var(--touch-target);
    touch-action: manipulation;
  }

  .mobile-menu .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(2px);
  }
  
  .mobile-menu .nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  }

  .mobile-menu .nav-link.active:hover {
    transform: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  }
  
  .mobile-menu .nav-link:active {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0.98);
  }




  /* Actions section with separator */
  .mobile-menu .logout-link {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    margin: 20px 20px 0 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
  }

  .mobile-menu .logout-link::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
  }

  .mobile-menu .logout-link:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
    transform: none;
  }

  .navbar-nav:not(.mobile-menu) {
    display: none;
  }

  /* Mobile Container */
  .container {
    margin: 0;
    padding: 0.5rem;
    max-width: 100%;
  }

  /* Mobile Page Headers */
  .page-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    text-align: center;
  }

  .page-title {
    font-size: 24px;
  }

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

  .header-actions .back-link,
  .header-actions .import-btn,
  .header-actions .export-btn,
  .header-actions .add-card-btn {
    width: 100%;
    justify-content: center;
    font-size: 14px;
    padding: 12px 16px;
  }

  /* Mobile Cards Grid */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Mobile Cards Table */
  .cards-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-header,
  .card-row {
    grid-template-columns: 1fr 80px 60px;
    gap: 8px;
    font-size: 14px;
  }

  .table-header div:nth-child(4),
  .card-row div:nth-child(4) {
    display: none; /* Hide "Next Review" column on mobile */
  }

  .question-text {
    font-size: 14px;
    line-height: 1.4;
  }

  .actions-cell {
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
  }

  .action-btn {
    font-size: 11px;
    padding: 4px 8px;
  }

  /* Mobile Filters */
  .filters-section {
    padding: 1rem;
  }

  .filters-row {
    flex-direction: column;
    gap: 12px;
  }

  .search-box {
    width: 100%;
  }

  .filter-select {
    font-size: 14px;
    padding: 10px 12px;
    background: var(--background-secondary);
    color: var(--text-primary);
  }

  .filter-select option {
    background: var(--background-secondary);
    color: var(--text-primary);
  }

  /* Mobile Forms */
  .form-container {
    padding: 1rem;
    margin: 0;
  }

  .form-section {
    padding: 1rem;
  }

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

  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px 16px;
  }

  .form-control textarea {
    min-height: 120px;
  }

  .form-actions {
    flex-direction: column;
    gap: 12px;
  }

  .btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
  }

  /* Mobile Alerts */
  .alert {
    margin: 0.5rem;
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 8px;
  }

  /* Mobile Study Interface */
  .study-container {
    padding: 0.5rem;
  }

  .session-progress {
    padding: 1rem;
  }

  .main-container {
    max-width: 100%;
    margin: 0;
    padding: 0.5rem;
    height: calc(100vh - 80px);
    height: calc(100dvh - 80px);
    overflow-y: auto;
  }

  .study-session-card {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-primary);
    height: fit-content;
    margin: 0;
  }

  .session-header {
    text-align: center;
    margin-bottom: 1rem;
  }

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

  .session-stats {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .progress-container {
    margin-bottom: 1rem;
  }

  .progress-bar {
    width: 100%;
    height: 6px;
    background: var(--background-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
  }

  .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    transition: width 0.3s ease;
  }

  .progress-text {
    text-align: right;
    color: var(--text-secondary);
    font-size: 12px;
  }

  .question-section {
    background: var(--background-secondary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
  }

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

  .question-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .card-number {
    background: var(--background-tertiary);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
  }

  .question-text {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    min-height: 60px;
  }

  .answer-input-section {
    background: var(--background-secondary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .answer-input-label {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 500;
  }

  .answer-input {
    padding: 1rem;
    font-size: 16px; /* Prevents zoom on iOS */
    line-height: 1.4;
    min-height: 100px;
    border-radius: 8px;
  }

  .answer-input:focus {
    border-color: var(--primary-color);
    /* Global focus indicator from design system will handle outline */
  }

  .answer-input::placeholder {
    color: var(--text-muted);
  }

  .show-answer-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
    margin: 1rem auto 0;
    width: 100%;
    max-width: 200px;
  }

  .show-answer-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.3);
  }

  .answer-revealed {
    background: var(--background-secondary);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
  }

  .answer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
  }

  .answer-icon {
    font-size: 16px;
  }

  .answer-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
  }

  .correct-answer {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
  }

  .correct-answer-text {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    font-weight: 400;
  }

  .user-answer-display {
    background: var(--background-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
  }

  .user-answer-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
  }

  .user-answer-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
    white-space: pre-wrap;
  }

  .answer-shown-btn {
    background: var(--background-tertiary);
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    display: block;
    margin: 0 auto;
    cursor: default;
  }

  .exit-btn {
    background: var(--background-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
    margin: 16px auto 0;
    text-decoration: none;
    text-align: center;
  }

  .exit-btn:hover {
    background: var(--background-secondary);
    color: var(--text-primary);
    text-decoration: none;
    border-color: var(--border-hover);
  }

  .flashcard {
    margin: 0.5rem 0;
    padding: 1.5rem;
  }

  .card-front,
  .card-back {
    font-size: 16px;
    line-height: 1.5;
    min-height: 120px;
  }

  .study-actions {
    padding: 1rem;
    gap: 12px;
  }

  .next-card-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
  }

  /* Mobile Difficulty Buttons */
  .difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 8px;
  }

  .difficulty-form {
    display: contents; /* Makes form not affect grid layout */
  }

  .difficulty-btn {
    padding: 12px 8px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
  }

  .difficulty-times {
    display: none; /* Hide times on mobile */
  }

  /* Mobile Dashboard improvements */
  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .stats-overview {
    margin-bottom: 2rem;
  }
  
  .stat-card {
    padding: 1.25rem;
    min-height: 120px;
  }
  
  .stat-number {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }
  
  .stat-label {
    font-size: 0.75rem;
  }

  .stat-card {
    padding: 1.5rem;
  }
}

/* Very Small Screens - Extra Compact Layout */
@media (max-width: 480px) {
  .container {
    margin: 0;
    padding: 0.25rem;
  }

  .main-container {
    margin: 0;
    padding: 0.25rem;
  }

  .study-session-card {
    padding: 0.75rem;
    border-radius: 8px;
    margin: 0;
  }

  .session-header {
    margin-bottom: 0.75rem;
  }

  .question-section {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .answer-input-section {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .answer-revealed {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .navbar-container {
    padding: 0 0.25rem;
  }

  .navbar-nav.mobile-menu {
    width: 260px;
  }

  /* Hide navigation on very small screens to save space */
  .navbar-nav:not(.mobile-menu) {
    display: none;
  }
}

  .stat-number {
    font-size: 28px;
  }

  .recent-activity {
    padding: 1rem;
  }

  /* Mobile Login/Signup */
  .auth-container {
    padding: 1rem;
    margin: 1rem 0.5rem;
  }

  .auth-form {
    padding: 1.5rem;
  }

  /* Mobile Theme Toggle */
  .theme-toggle {
    width: var(--touch-target);
    height: var(--touch-target);
    font-size: 18px;
    padding: 0.75rem;
  }
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.show {
  display: block;
  opacity: 1;
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
  overflow: hidden;
}

/* Adjust main container when mobile menu is open */
body.mobile-menu-open .container {
  transform: translateX(-280px);
  transition: transform 0.3s ease;
}

/* Prevent dashboard content shift on mobile when menu is open */
@media (max-width: 768px) {
  body.mobile-menu-open .dashboard-container {
    transform: none !important;
    margin-left: 0 !important;
  }

  body.mobile-menu-open .welcome-section,
  body.mobile-menu-open .stats-overview,
  body.mobile-menu-open .recent-activity {
    transform: none !important;
    margin-left: 0 !important;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  .mobile-menu {
    width: 100vw;
    right: -100vw;
  }

  .mobile-menu.show {
    right: 0;
  }

  .page-title {
    font-size: 20px;
  }

  .flashcard {
    padding: 1rem;
  }
}

/* Very small screens - maintain 2x2 grid but more compact */
@media (max-width: 380px) {
  .difficulty-buttons {
    gap: 6px;
  }

  .difficulty-btn {
    padding: 12px 14px;
    font-size: 13px;
    min-height: 44px;
  }
}

/* Close menu on nav item click for mobile */
@media (max-width: 768px) {
  .mobile-menu .nav-link {
    cursor: pointer;
  }
}

/* ===== CHATBOT INTERFACE STYLES ===== */

.chatbot-container {
  max-width: 800px;
  margin: 0 auto;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chatbot-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--background-secondary);
}

.chatbot-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.chatbot-icon {
  font-size: 1.5rem;
}

.chatbot-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.chatbot-stats {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.due-cards-count {
  background: var(--background-tertiary);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  gap: 0.75rem;
  animation: fadeInUp 0.3s ease;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--background-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.user-message .message-avatar {
  background: var(--primary-color);
}

.ai-message .message-avatar {
  background: var(--success-color);
}

.message-content {
  flex: 1;
  background: var(--background-secondary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  line-height: 1.5;
}

.user-message .message-content {
  background: var(--primary-color);
  color: white;
  margin-left: auto;
  max-width: 80%;
}

.ai-message .message-content {
  border: 1px solid var(--border-light);
}

.message-content p {
  margin: 0;
}

.message-content p + p {
  margin-top: 0.5rem;
}

.chat-input-section {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  background: var(--background-secondary);
}

.chat-input-container {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}

.chat-input {
  flex: 1;
  background: var(--background-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.4;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  transition: all 0.2s ease;
}

.chat-input:focus {
  border-color: var(--primary-color);
  /* Global focus indicator from design system will handle outline */
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.send-button {
  background: var(--primary-color);
  border: none;
  border-radius: var(--radius-md);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: white;
  font-size: 1rem;
}

.send-button:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.send-button:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

/* Question reminder in answer section */
.question-reminder {
  background: var(--background-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.question-reminder-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.question-icon {
  font-size: 16px;
}

.question-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.question-reminder-text {
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
}

/* Answer comparison styling */
.answer-comparison {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.answer-comparison.correct {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.answer-comparison.almost {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.answer-comparison.incorrect {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.answer-comparison.empty {
  background: rgba(156, 163, 175, 0.1);
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.match-correct {
  color: #059669;
}

.match-almost {
  color: #f59e0b;
}

.match-incorrect {
  color: #dc2626;
}

.match-empty {
  color: #6b7280;
}

.chat-suggestions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.suggestion-btn {
  background: var(--background-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.suggestion-btn:hover {
  background: var(--background-primary);
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.loading-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.loading-dots {
  display: flex;
  gap: 4px;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  background: var(--primary-color);
  border-radius: 50%;
  animation: loadingBounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingBounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

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

/* Mobile Chatbot Styles */
@media (max-width: 768px) {
  .chatbot-container {
    margin: 0;
    border-radius: 0;
    height: calc(100vh - 70px);
    border: none;
  }

  .chatbot-header {
    padding: 1rem;
  }

  .chatbot-title h1 {
    font-size: 1.25rem;
  }

  .chat-messages {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .message-content {
    padding: 0.5rem 0.75rem;
  }

  .user-message .message-content {
    max-width: 85%;
  }

  .chat-input-section {
    padding: 0.75rem 1rem;
  }

  .chat-input {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .chat-suggestions {
    gap: 0.25rem;
  }

  .suggestion-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
  }
}

@media (max-width: 480px) {
  .chatbot-header {
    padding: 0.75rem;
  }

  .chat-messages {
    padding: 0.5rem;
  }

  .chat-input-section {
    padding: 0.5rem 0.75rem;
  }

  .chat-suggestions {
    flex-direction: column;
  }

  .suggestion-btn {
    text-align: center;
  }
}

/* Improved control bar */
.control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  gap: 16px;
}

.cards-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.status-icon {
  width: 20px;
  height: 20px;
  background: #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.status-text {
  font-size: 14px;
  color: #e5e7eb;
}

.status-number {
  font-weight: 600;
  color: #10b981;
}

.controls-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.model-selector,
.category-filter-select {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 140px;
}

.model-selector:hover,
.category-filter-select:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.model-selector:focus,
.category-filter-select:focus {
  /* Global focus indicator from design system will handle outline and box-shadow */
}

.model-selector option,
.category-filter-select option {
  background: #2a2a2a;
  color: #ffffff;
}

.reset-chat-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.reset-chat-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.reset-icon {
  width: 14px;
  height: 14px;
}

@media (max-width: 768px) {
  .control-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
  }
  
  .cards-status {
    justify-content: center;
  }
  
  .controls-group {
    justify-content: center;
    gap: 8px;
  }
  
  .model-selector {
    font-size: 12px;
    padding: 6px 10px;
    min-width: 120px;
  }
  
  .reset-chat-btn {
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* Markdown styling in chat messages */
.message-content h1,
.message-content h2,
.message-content h3 {
  margin: 8px 0 4px 0;
  font-weight: bold;
}

.message-content h1 {
  font-size: 18px;
}

.message-content h2 {
  font-size: 16px;
}

.message-content h3 {
  font-size: 14px;
}

.message-content strong {
  font-weight: bold;
}

.message-content em {
  font-style: italic;
}

.message-content code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 4px;
  border-radius: 3px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
}

.message-content pre {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px;
  border-radius: 6px;
  margin: 8px 0;
  overflow-x: auto;
}

.message-content pre code {
  background: none;
  padding: 0;
  font-size: 12px;
  white-space: pre;
}

.message-content p {
  margin: 4px 0;
}

/* Category tags and badges */
.category-tag {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
}

.category-badge {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Update table grid to accommodate category column */
.cards-table .table-header,
.cards-table .card-row {
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
}

/* Model change notification */
.model-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1000;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .model-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    text-align: center;
    font-size: 13px;
  }
}

  .card-front,
  .card-back {
    font-size: 15px;
    min-height: 100px;
  }

  .difficulty-buttons {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .difficulty-times {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Desktop Study Interface Styles */
.answer-input-section {
  background: var(--background-secondary);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.answer-input-label {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 12px;
  font-weight: 500;
}

.answer-input {
  width: 100%;
  background: var(--background-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  min-height: 140px; /* Larger for desktop */
  resize: vertical;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

.answer-input:focus {
  border-color: var(--primary-color);
  /* Global focus indicator from design system will handle outline */
}

.answer-input::placeholder {
  color: var(--text-muted);
}

/* Desktop Show Answer Button */
.show-answer-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: block;
  margin: 16px auto 0;
  width: auto;
  min-width: 140px;
  text-align: center;
}

.show-answer-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(124, 77, 255, 0.3);
}

/* Touch improvements */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .nav-link,
  .action-btn,
  .difficulty-btn {
    min-height: 44px; /* iOS recommended touch target size */
    touch-action: manipulation;
  }

  .btn:active,
  .action-btn:active,
  .difficulty-btn:active {
    transform: scale(0.98);
  }
}

/* Enhanced Filter Styles */
.filter-container {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 30px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}

[data-theme="light"] .filter-container {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.filters-wrapper {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.filter-pill {
  padding: 10px 20px;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-width: 120px;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='rgba(255,255,255,0.6)' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
}

[data-theme="light"] .filter-pill {
  background: #f1f3f5;
  color: #495057;
  border: 1.5px solid #e9ecef;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23495057' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
}

.filter-pill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.filter-pill:hover::before {
  opacity: 1;
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .filter-pill:hover {
  background: #e9ecef;
  border-color: #dee2e6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.filter-pill.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
  }
  50% {
    box-shadow: 0 4px 30px rgba(102, 126, 234, 0.5);
  }
}

/* Dropdown arrow is now handled via CSS background-image */

.search-bar {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 12px 20px;
  border-radius: 25px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

[data-theme="light"] .search-bar input {
  background: white;
  border-color: #e9ecef;
  color: #495057;
  font-weight: 500;
}

.search-bar input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .search-bar input::placeholder {
  color: #adb5bd;
}

.clear-button {
  padding: 10px 24px;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
}

[data-theme="light"] .clear-button {
  background: white;
  color: #495057;
  border-color: #e9ecef;
}

.clear-button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

[data-theme="light"] .clear-button:hover {
  background: #f8f9fa;
  border-color: #dee2e6;
  transform: translateY(-1px);
}

/* Select elements are now styled as filter pills */

/* Responsive design */
@media (max-width: 768px) {
  .filters-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    flex-wrap: wrap;
  }

  .search-bar {
    min-width: 100%;
  }
}

/* Card review buttons in chat */
.card-review-buttons {
  margin-top: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.review-prompt {
  text-align: center;
  margin-bottom: 15px;
  font-weight: 600;
  color: #f8f9fa;
  font-size: 14px;
}

.review-button-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0;
}

/* Quiz mode visual separators */
.quiz-separator {
  text-align: center;
  color: rgba(255, 193, 7, 0.4);
  font-size: 12px;
  margin: 15px 0 10px 0;
  letter-spacing: 1px;
  user-select: none;
}

.review-btn {
  padding: 12px 8px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.1);
  color: #f8f9fa;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.review-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.review-btn:disabled {
  cursor: not-allowed;
}

.review-btn.again {
  background: rgba(220, 53, 69, 0.8);
  color: white;
}

.review-btn.hard {
  background: rgba(255, 193, 7, 0.8);
  color: white;
}

.review-btn.good {
  background: rgba(40, 167, 69, 0.8);
  color: white;
}

.review-btn.easy {
  background: rgba(23, 162, 184, 0.8);
  color: white;
}

.review-btn.again:hover:not(:disabled) {
  background: rgba(220, 53, 69, 0.9);
}

.review-btn.hard:hover:not(:disabled) {
  background: rgba(255, 193, 7, 0.9);
}

.review-btn.good:hover:not(:disabled) {
  background: rgba(40, 167, 69, 0.9);
}

.review-btn.easy:hover:not(:disabled) {
  background: rgba(23, 162, 184, 0.9);
}

.review-time {
  font-size: 10px;
  opacity: 0.9;
  font-weight: 400;
}

.keyboard-hint {
  font-size: 12px;
  opacity: 0.7;
  font-weight: 400;
  font-style: italic;
}

.shortcut {
  font-size: 9px;
  opacity: 0.8;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.2);
  padding: 1px 4px;
  border-radius: 3px;
  margin-top: 2px;
}

.review-success {
  text-align: center;
  padding: 12px;
  background: rgba(40, 167, 69, 0.2);
  border: 1px solid rgba(40, 167, 69, 0.3);
  border-radius: 8px;
  color: #28a745;
  font-weight: 600;
}

@media (max-width: 768px) {
  .review-button-group {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .review-btn {
    padding: 15px 10px;
    min-height: 70px;
    font-size: 13px;
  }
}

/* Batch Delete Styles - inherits base button styles with higher specificity */
.header-actions .batch-delete-btn {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
  border-radius: var(--radius-md) !important;
}

/* Default (dark theme) batch delete button shadow */
[data-theme="dark"] .header-actions .batch-delete-btn {
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3) !important;
}

/* Light theme batch delete button shadow */
[data-theme="light"] .header-actions .batch-delete-btn {
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.25) !important;
}

.header-actions .batch-delete-btn:hover {
  transform: translateY(-2px) !important;
  color: white !important;
  text-decoration: none !important;
}

/* Default (dark theme) batch delete button hover shadow */
[data-theme="dark"] .header-actions .batch-delete-btn:hover {
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4) !important;
}

/* Light theme batch delete button hover shadow */
[data-theme="light"] .header-actions .batch-delete-btn:hover {
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.35) !important;
}

.results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.batch-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.select-all-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  user-select: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  background: rgba(var(--primary-color), 0.05);
  border: 1px solid rgba(var(--primary-color), 0.1);
}

.select-all-checkbox:hover {
  background: rgba(var(--primary-color), 0.1);
  border-color: rgba(var(--primary-color), 0.2);
}

.select-all-checkbox input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--primary-color);
  margin: 0;
}

.checkbox-column {
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #007bff;
}

.card-row.selected {
  background-color: rgba(0, 123, 255, 0.05);
  border-left: 3px solid #007bff;
}

.card-row.selected:hover {
  background-color: rgba(0, 123, 255, 0.08);
}

/* Checkbox column is now included in main table styles above */

/* Shared markdown styling for card details and study views */
.card-markdown .question-text,
.card-markdown .question-text p,
.card-markdown .question-text span,
.card-markdown .question-text div {
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.5;
}

.card-markdown .correct-answer-text,
.card-markdown .correct-answer-text p,
.card-markdown .correct-answer-text span,
.card-markdown .correct-answer-text div {
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.6;
  font-weight: 500;
}

/* Tables inside card markdown (show view) and study session */
.card-markdown table,
.study-session-card table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.card-markdown th,
.card-markdown td,
.study-session-card th,
.study-session-card td {
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.6rem;
  text-align: left;
}

.card-markdown thead th,
.study-session-card thead th {
  background: rgba(148, 163, 184, 0.15);
  font-weight: 600;
}

.card-markdown tbody tr:nth-child(even),
.study-session-card tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.4);
}

@media (max-width: 768px) {
  .results-bar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    padding: 12px 16px;
  }
  
  .batch-controls {
    justify-content: center;
  }
  
  .select-all-checkbox {
    font-size: 12px;
    padding: 6px 10px;
  }
  
  .select-all-checkbox input[type="checkbox"] {
    width: 13px;
    height: 13px;
  }
  
  .batch-delete-btn {
    width: 100%;
    justify-content: center;
  }
  
  .cards-table .table-header,
  .cards-table .card-row {
    grid-template-columns: 40px 1fr auto;
    gap: 0.5rem;
  }
  
  /* Hide middle columns on mobile, keep checkbox, question, and actions */
  .cards-table .table-header > div:nth-child(3),
  .cards-table .table-header > div:nth-child(4),
  .cards-table .table-header > div:nth-child(5),
  .cards-table .table-header > div:nth-child(6),
  .cards-table .card-row > div:nth-child(3),
  .cards-table .card-row > div:nth-child(4),
  .cards-table .card-row > div:nth-child(5),
  .cards-table .card-row > div:nth-child(6) {
    display: none;
  }
}

/* ===============================================
   QUIZ SETUP STYLES
   =============================================== */

.quiz-setup-container {
  max-width: 700px;
  margin: 0 auto;
  padding: var(--space-4);
}

.quiz-setup-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.quiz-setup-header .quiz-icon {
  font-size: 3rem;
  margin-bottom: var(--space-3);
}

.quiz-setup-header h1 {
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.quiz-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-lg);
}

.quiz-setup-card {
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
}

.quiz-stats-banner {
  display: flex;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-4);
  background: var(--background-secondary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
}

.quiz-stats-banner .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.quiz-stats-banner .stat-icon {
  font-size: 1.5rem;
}

.quiz-stats-banner .stat-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--primary-color);
}

.quiz-stats-banner .stat-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.quiz-empty-state {
  text-align: center;
  padding: var(--space-8);
}

.quiz-empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
}

.quiz-empty-state h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.quiz-empty-state p {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.quiz-config-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.quiz-config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.quiz-config-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--background-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}

.quiz-config-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.1);
}

.quiz-config-item .config-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background-tertiary);
  border-radius: var(--radius-md);
}

.quiz-config-item .config-content {
  flex: 1;
  min-width: 0;
}

.quiz-config-item .config-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.quiz-config-item .inline-form {
  display: contents;
}

.quiz-select {
  width: 100%;
  padding: var(--space-3);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quiz-select:hover {
  border-color: var(--border-hover);
}

.quiz-select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.15);
}

.quiz-actions-container {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-color);
}

.quiz-actions-container .btn-large {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

@media (max-width: 768px) {
  .quiz-setup-container {
    padding: var(--space-3);
  }

  .quiz-setup-card {
    padding: var(--space-4);
  }

  .quiz-stats-banner {
    flex-direction: column;
    gap: var(--space-4);
  }

  .quiz-config-grid {
    grid-template-columns: 1fr;
  }

  .quiz-actions-container {
    flex-direction: column;
  }

  .quiz-actions-container .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===============================================
   QUIZ RESULTS STYLES
   =============================================== */

.quiz-results-container {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-4);
}

/* Score Card */
.quiz-score-card {
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  margin-bottom: var(--space-8);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.score-display {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--space-2);
}

.score-display.score-good {
  color: var(--success-color);
}

.score-display.score-ok {
  color: var(--warning-color);
}

.score-display.score-low {
  color: var(--danger-color);
}

.score-number {
  font-size: inherit;
}

.score-divider {
  opacity: 0.5;
  margin: 0 0.1em;
}

.score-total {
  font-size: inherit;
  opacity: 0.7;
}

.score-percentage {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.score-percentage.score-good {
  color: var(--success-color);
}

.score-percentage.score-ok {
  color: var(--warning-color);
}

.score-percentage.score-low {
  color: var(--danger-color);
}

.quiz-category {
  color: var(--text-secondary);
  font-size: var(--text-base);
}

/* Questions List */
.quiz-questions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Question Card */
.quiz-question-card {
  background: var(--glass-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all 0.2s ease;
}

.quiz-question-card.question-correct {
  border-left: 4px solid var(--success-color);
}

.quiz-question-card.question-incorrect {
  border-left: 4px solid var(--danger-color);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.question-number {
  background: var(--background-tertiary);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: var(--text-sm);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
}

.result-badge {
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
}

.result-badge.badge-correct {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success-color);
}

.result-badge.badge-incorrect {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger-color);
}

.question-prompt {
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-5);
  line-height: var(--leading-relaxed);
}

/* Answer Options */
.answer-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.answer-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.answer-option.option-correct {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--success-color);
}

.answer-option.option-wrong {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger-color);
}

.answer-option.option-neutral {
  background: var(--background-secondary);
  border-color: var(--border-color);
}

.option-indicator {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  font-weight: 700;
}

.icon-correct {
  color: var(--success-color);
}

.icon-wrong {
  color: var(--danger-color);
}

.icon-neutral {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.option-text {
  flex: 1;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
}

.option-correct .option-text {
  font-weight: 600;
}

.your-answer-tag {
  flex-shrink: 0;
  background: var(--background-tertiary);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.option-wrong .your-answer-tag {
  background: rgba(239, 68, 68, 0.3);
  color: var(--danger-color);
}

.option-correct .your-answer-tag {
  background: rgba(16, 185, 129, 0.3);
  color: var(--success-color);
}

/* Quiz Actions */
.quiz-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-color);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .quiz-results-container {
    padding: var(--space-3);
  }

  .quiz-score-card {
    padding: var(--space-6);
  }

  .score-display {
    font-size: 3rem;
  }

  .quiz-question-card {
    padding: var(--space-4);
  }

  .question-header {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .answer-option {
    padding: var(--space-3);
  }

  .quiz-actions {
    flex-direction: column;
  }

  .quiz-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===============================================
   FILL IN THE GAPS QUIZ STYLES
   =============================================== */

.fill-gap-answer {
  color: var(--success-color);
  background: rgba(16, 185, 129, 0.15);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
}

.fill-gap-result {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--background-secondary);
  border-radius: var(--radius-md);
}

.answer-comparison {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.answer-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.answer-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 120px;
}

.answer-value {
  font-size: var(--text-base);
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}

.answer-value.correct-answer {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success-color);
}

.answer-value.wrong-answer {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger-color);
}

@media (max-width: 768px) {
  .answer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }
  
  .answer-label {
    min-width: auto;
  }
}

/* ===============================================
   LOADING ANIMATIONS
   =============================================== */

/* Spinner */
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-spinner-sm {
  width: 24px;
  height: 24px;
  border-width: 3px;
}

.loading-spinner-lg {
  width: 64px;
  height: 64px;
  border-width: 5px;
}

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

/* Pulse animation */
.loading-pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-overlay-content {
  text-align: center;
  max-width: 400px;
  padding: var(--space-8);
}

.loading-overlay-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.loading-overlay-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.loading-overlay-message {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  min-height: 3em;
}

.loading-overlay-timer {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  background: var(--background-secondary);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
}

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

/* Loading Card (inline loading state) */
.loading-card {
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
}

.loading-card-spinner {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.loading-card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.loading-card-message {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.loading-card-timer {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Progress bar animation */
.loading-progress {
  width: 100%;
  height: 4px;
  background: var(--background-tertiary);
  border-radius: 2px;
  overflow: hidden;
  margin-top: var(--space-4);
}

.loading-progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 2px;
  animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-100%); width: 30%; }
  50% { transform: translateX(100%); width: 60%; }
  100% { transform: translateX(300%); width: 30%; }
}