/* ==========================================================================
   Inflecto Design System & Modern Responsive Stylesheet
   Theme: Vibrant Indigo / Deep Violet Slate (Dark/Light mode native)
   ========================================================================== */

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

:root {
  /* Color Palette - Vibrant Modern Theme */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-glass: rgba(30, 41, 59, 0.75);
  --bg-glass-card: rgba(30, 41, 59, 0.85);

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --accent-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #9333ea 50%, #db2777 100%);
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border-color: rgba(255, 255, 255, 0.1);
  --border-color-hover: rgba(99, 102, 241, 0.4);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.35);

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-card: rgba(255, 255, 255, 0.95);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border-color: rgba(0, 0, 0, 0.08);
  --border-color-hover: rgba(99, 102, 241, 0.5);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Background Ambient Glow Effects */
body::before {
  content: '';
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.08) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

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

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.content-area {
  flex: 1;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Header & Glass Navbar */
.glass-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.nav-item {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: var(--transition-fast);
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-item:hover, .nav-item.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-item.active {
  color: var(--accent-primary);
}

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

/* Language Switcher */
.lang-selector-dropdown {
  position: relative;
}

.btn-lang {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-lang:hover {
  border-color: var(--accent-primary);
}

.lang-menu {
  position: absolute;
  top: 110%;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  min-width: 160px;
  overflow: hidden;
  z-index: 1000;
}

.lang-menu.show {
  display: flex;
}

.lang-menu button {
  padding: 0.65rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-menu button:hover {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-normal);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

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

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

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

.btn-outline:hover {
  background: rgba(99, 102, 241, 0.1);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-indigo { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-green  { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-amber  { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-rose   { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Glass Cards */
.glass-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
}

.glass-card:hover {
  border-color: var(--border-color-hover);
}

/* Landing Page / Portal Switcher Hero */
.hero-section {
  text-align: center;
  padding: 3rem 1rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 3rem;
  line-height: 1.15;
  margin-bottom: 1rem;
}

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

.portal-switch-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
  margin-top: 2rem;
}

.portal-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  border: 2px solid var(--border-color);
  transition: var(--transition-normal);
}

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

.portal-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.portal-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.portal-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Form Dropdown Option Styling for Dark Theme */
.form-input option, .form-select option, select option {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.5rem;
}

/* Modal Windows */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

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

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

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
}

.modal-close:hover { color: var(--text-primary); }

/* Dashboard Grids */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

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

.stat-lbl {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Flashcard Study Area & FSRS Engine UI */
.study-container {
  max-width: 680px;
  margin: 0 auto;
}

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

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 2rem;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  width: 0%;
  transition: width 0.3s ease;
}

/* 3D Flip Card Effect */
.card-perspective {
  perspective: 1000px;
  width: 100%;
  min-height: 320px;
  margin-bottom: 1.25rem;
}

.flashcard-3d {
  width: 100%;
  height: 100%;
  min-height: 320px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.flashcard-3d.flipped {
  transform: rotateY(180deg);
}

@keyframes cardShakeError {
  0%, 100% { transform: rotateY(180deg) translateX(0); }
  15%, 45%, 75% { transform: rotateY(180deg) translateX(-12px) rotate(-1.5deg); }
  30%, 60%, 90% { transform: rotateY(180deg) translateX(12px) rotate(1.5deg); }
}

.flashcard-3d.shake-error {
  animation: cardShakeError 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.flashcard-3d.shake-error .card-face {
  box-shadow: 0 0 35px rgba(239, 68, 68, 0.6) !important;
  border-color: #ef4444 !important;
}

.flashcard-3d.glow-success .card-face {
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.6) !important;
  border-color: #10b981 !important;
}

.flashcard-3d.glow-warning .card-face {
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.6) !important;
  border-color: #f59e0b !important;
}

/* Visual Splitsboom / Number Bond Component */
.splitsboom-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0.5rem 0;
  width: 100%;
}

.splitsboom-top-box {
  width: 72px;
  height: 60px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.splitsboom-legs-svg {
  width: 170px;
  height: 40px;
  margin: 0.15rem 0;
}

.splitsboom-bottom-row {
  display: flex;
  justify-content: space-between;
  width: 190px;
}

.splitsboom-bottom-box {
  width: 68px;
  height: 56px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.splitsboom-bottom-box.missing {
  border: 2px dashed var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
}

.splitsboom-bottom-box.filled-solution {
  border: 2px solid var(--success);
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

/* Bridge Math Visual Component */
.bridge-math-container {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
  width: 100%;
}

.bridge-math-inline-term {
  font-size: 2.5rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--text-primary);
  height: 44px;
  line-height: 44px;
  display: flex;
  align-items: center;
}

.bridge-splitsboom {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0.1rem;
  width: auto !important;
}

.splitsboom-top-box.bridge-top {
  width: 50px;
  height: 44px;
  font-size: 1.8rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.3);
}

.splitsboom-legs-svg.bridge-svg {
  width: 100px;
  height: 28px;
  margin: 0.05rem 0;
}

.splitsboom-bottom-row.bridge-row {
  width: 108px;
  gap: 0.5rem;
  justify-content: center;
}

.splitsboom-bottom-box.bridge-box.bridge-input {
  width: 44px;
  height: 38px;
  font-size: 1.35rem;
  font-family: var(--font-heading);
  font-weight: 800;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 2px dashed var(--accent-primary);
  color: var(--text-primary);
  text-align: center;
  outline: none;
  cursor: text;
  transition: all 0.2s ease;
}

.splitsboom-bottom-box.bridge-box.bridge-input::placeholder {
  color: var(--accent-primary);
  opacity: 0.6;
}

@keyframes activeBoxPulse {
  0% {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.6), 0 0 14px rgba(99, 102, 241, 0.6);
    transform: scale(1.06);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(168, 85, 247, 0.85), 0 0 24px rgba(168, 85, 247, 0.9);
    transform: scale(1.13);
  }
  100% {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.6), 0 0 14px rgba(99, 102, 241, 0.6);
    transform: scale(1.06);
  }
}

.splitsboom-bottom-box.bridge-box.active-target,
.math-inline-box.active-target {
  border-style: solid !important;
  border-width: 3px !important;
  border-color: #6366f1 !important;
  background: rgba(99, 102, 241, 0.28) !important;
  color: #ffffff !important;
  animation: activeBoxPulse 1.5s infinite ease-in-out !important;
  z-index: 10;
}

/* Inline Math Answer Box for Equations */
.math-inline-box {
  min-width: 64px;
  height: 56px;
  padding: 0 0.8rem;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.math-inline-box.missing {
  border: 2px dashed var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
}

.math-inline-box.filled-solution {
  border: 2px solid var(--success);
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--bg-glass-card);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  box-sizing: border-box;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.card-face::-webkit-scrollbar {
  display: none;
}

/* Mobile Responsive Scaling for Math & Language Cards */
@media (max-width: 640px) {
  body.view-study {
    overflow: hidden !important;
  }

  .study-header {
    margin-bottom: 0.4rem !important;
  }

  .progress-bar-container {
    margin-bottom: 0.5rem !important;
  }

  .card-perspective, .flashcard-3d {
    min-height: 220px !important;
    margin-bottom: 0.4rem !important;
  }

  .card-face {
    padding: 0.4rem 0.6rem !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  .card-prompt-word {
    font-size: 1.6rem !important;
    margin-bottom: 0.15rem !important;
  }

  .card-hint-badge {
    font-size: 0.75rem !important;
    padding: 0.15rem 0.5rem !important;
    margin-bottom: 0.25rem !important;
  }

  .card-sentence-context {
    font-size: 0.78rem !important;
    margin-top: 0.25rem !important;
  }

  .splitsboom-container {
    margin: 0.15rem 0 !important;
  }

  .splitsboom-top-box {
    width: 64px !important;
    height: 50px !important;
    font-size: 1.75rem !important;
  }

  .splitsboom-legs-svg {
    width: 140px !important;
    height: 32px !important;
    margin: 0.05rem 0 !important;
  }

  .splitsboom-bottom-row {
    width: 155px !important;
  }

  .splitsboom-bottom-box {
    width: 56px !important;
    height: 46px !important;
    font-size: 1.55rem !important;
  }

  .math-inline-box {
    min-width: 54px !important;
    height: 48px !important;
    font-size: 1.8rem !important;
  }
}

.card-face.card-back {
  transform: rotateY(180deg);
  border-color: var(--accent-primary);
}

.card-prompt-word {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.card-hint-badge {
  font-size: 0.85rem;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-sentence-context {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 90%;
  margin-top: 0.5rem;
}

/* FSRS Rating Buttons (Again, Hard, Good, Easy) */
.fsrs-button-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  width: 100%;
}

.btn-rating {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.btn-rating.again { border-color: var(--danger); }
.btn-rating.again:hover { background: rgba(239, 68, 68, 0.15); }
.btn-rating.hard  { border-color: var(--warning); }
.btn-rating.hard:hover  { background: rgba(245, 158, 11, 0.15); }
.btn-rating.good  { border-color: var(--accent-primary); }
.btn-rating.good:hover  { background: rgba(99, 102, 241, 0.15); }
.btn-rating.easy  { border-color: var(--success); }
.btn-rating.easy:hover  { background: rgba(16, 185, 129, 0.15); }

.rating-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.2rem; }
.rating-interval { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }

/* Tables */
.custom-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.custom-table th, .custom-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.custom-table th {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 2000;
}

.toast {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  animation: slideIn 0.3s ease;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--danger); }
.toast-info    { border-left: 4px solid var(--info); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* Responsive Media Queries */
@media (max-width: 768px), (max-height: 720px) {
  .hero-title { font-size: 2.2rem; }
  .fsrs-button-grid { grid-template-columns: repeat(2, 1fr); }
  .glass-header { padding: 0.6rem 1rem; }
  .nav-links { display: none; }
  .content-area { padding: 1rem 0.75rem 2rem; }

  /* Mobile Flashcard Compact Adaptations for Virtual Keyboards */
  .study-container { padding: 0 0.25rem; }
  .progress-bar-container { margin-bottom: 0.75rem; height: 6px; }
  .study-header { margin-bottom: 0.6rem; }
  .card-perspective, .flashcard-3d { min-height: 180px; margin-bottom: 0.85rem; }
  .card-face { padding: 1rem 0.75rem; }
  .card-prompt-word { font-size: 1.8rem; margin-bottom: 0.2rem; }
  .card-hint-badge { font-size: 0.78rem; padding: 0.15rem 0.6rem; margin-bottom: 0.35rem; }
  .card-sentence-context { font-size: 0.82rem; margin-top: 0.35rem; max-width: 95%; }
  .card-face p[style*="margin-top:2rem"] { margin-top: 0.5rem !important; font-size: 0.78rem !important; }

  /* Input box & button compactness */
  .glass-card { padding: 0.9rem !important; margin-bottom: 0.85rem !important; }
  .form-group { margin-bottom: 0.4rem !important; }
  .form-input { padding: 0.5rem 0.75rem !important; font-size: 0.95rem !important; }
}
