/* ClassCards - Unified Design System */

:root {
  /* Blue educational color scheme inspired by easy4me.info */
  --primary: #1E5BA8;
  --primary-dark: #164480;
  --primary-light: #4A90E2;
  --secondary: #4A90E2;
  --accent-orange: #4A90E2;
  --success: #4CAF50;
  --success-dark: #388E3C;
  --danger: #F44336;
  --danger-dark: #D32F2F;
  --warning: #4A90E2;
  --info: #1E5BA8;
  --text-primary: #212121;
  --text-secondary: #757575;
  --text-light: #9E9E9E;
  --bg-primary: #FAFAFA;
  --bg-secondary: #F5F5F5;
  --bg-tertiary: #EEEEEE;
  --card-bg: #FFFFFF;
  --border: #E0E0E0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 1px 2px 0 rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
  --radius-sm: 4px;
  --radius: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Responsive spacing scale */
  --space-xs: clamp(0.25rem, 0.5vw, 0.5rem);
  --space-sm: clamp(0.5rem, 1vw, 0.75rem);
  --space-md: clamp(0.75rem, 1.5vw, 1rem);
  --space-lg: clamp(1rem, 2vw, 1.5rem);
  --space-xl: clamp(1.5rem, 3vw, 2rem);
  --space-2xl: clamp(2rem, 4vw, 3rem);

  /* Responsive font sizes */
  --text-xs: clamp(0.75rem, 1.5vw, 0.875rem);
  --text-sm: clamp(0.875rem, 2vw, 1rem);
  --text-base: clamp(1rem, 2.5vw, 1.125rem);
  --text-lg: clamp(1.125rem, 3vw, 1.25rem);
  --text-xl: clamp(1.25rem, 3.5vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 4vw, 2rem);
  --text-3xl: clamp(2rem, 5vw, 3rem);
  --text-4xl: clamp(2.5rem, 6vw, 4rem);

  /* Container widths */
  --container-xs: min(100%, 30rem);
  --container-sm: min(100%, 40rem);
  --container-md: min(100%, 60rem);
  --container-lg: min(100%, 75rem);
  --container-xl: min(100%, 90rem);

  /* Bottom nav height variable for calculations */
  --bottom-nav-height: 3.5rem;

  /* Status indicator colors (for progress, badges, stats) */
  --color-success-alt: #10b981;
  --color-info: #3b82f6;
  --color-warning-alt: #f59e0b;
  --color-purple: #8b5cf6;
  --color-muted: #94a3b8;

  /* Alpha variants for status backgrounds */
  --color-success-alt-bg: rgba(16, 185, 129, 0.15);
  --color-info-bg: rgba(59, 130, 246, 0.15);
  --color-warning-alt-bg: rgba(245, 158, 11, 0.15);
  --color-danger-bg: rgba(239, 68, 68, 0.15);
  --color-purple-bg: rgba(139, 92, 246, 0.15);
  --color-muted-bg: rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] {
  /* Dark mode with blue accents */
  --primary: #4A90E2;
  --primary-dark: #1E5BA8;
  --primary-light: #6BA5E7;
  --secondary: #4A90E2;
  --accent-orange: #6BA5E7;
  --success: #66BB6A;
  --success-dark: #4CAF50;
  --danger: #EF5350;
  --danger-dark: #F44336;
  --warning: #6BA5E7;
  --info: #4A90E2;
  --text-primary: #FAFAFA;
  --text-secondary: #BDBDBD;
  --text-light: #9E9E9E;
  --bg-primary: #212121;
  --bg-secondary: #303030;
  --bg-tertiary: #424242;
  --card-bg: #303030;
  --border: #424242;

  /* Status indicator colors (for progress, badges, stats) */
  --color-success-alt: #34d399;
  --color-info: #60a5fa;
  --color-warning-alt: #fbbf24;
  --color-purple: #a78bfa;
  --color-muted: #9ca3af;

  /* Alpha variants for status backgrounds */
  --color-success-alt-bg: rgba(52, 211, 153, 0.2);
  --color-info-bg: rgba(96, 165, 250, 0.2);
  --color-warning-alt-bg: rgba(251, 191, 36, 0.2);
  --color-danger-bg: rgba(248, 113, 113, 0.2);
  --color-purple-bg: rgba(167, 139, 250, 0.2);
  --color-muted-bg: rgba(156, 163, 175, 0.2);
}

/* ============================================
   ACCESSIBILITY UTILITIES
   ============================================ */

/* Skip to main content link - visible only on focus */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  z-index: 10000;
  text-decoration: none;
  font-weight: 500;
  border-radius: 0 0 var(--radius) 0;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Screen reader only content */
.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;
}

/* Focus visible styles for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Remove focus outline for mouse users, keep for keyboard */
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  outline: none;
}

/* Logout button icon styles */
.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}

.logout-btn:hover {
  color: var(--danger);
  background-color: var(--bg-secondary);
}

.logout-btn svg {
  width: 20px;
  height: 20px;
}

/* Dark mode specific styles for practice cards */
[data-theme="dark"] .card-display,
[data-theme="dark"] .flashcard {
  background: var(--bg-secondary);
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 1px rgba(74, 144, 226, 0.2), var(--shadow-lg);
}

/* Theme Dropdown */
.theme-dropdown-container {
  position: relative;
  display: inline-block;
}

.theme-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff; /* Always white background for readability */
  border: 1px solid #ddd;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  min-width: 160px;
  margin-top: 0.25rem;
  overflow: hidden;
}

.theme-dropdown.show {
  display: block;
}

.theme-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  color: #333 !important; /* Always dark text for readability */
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 0.875rem;
}

.theme-dropdown-item:hover {
  background: #f5f5f5;
}

.theme-dropdown-item.active {
  background: var(--primary);
  color: white !important;
}

.theme-dropdown-item .theme-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.theme-dropdown-item.active .theme-icon {
  border-color: rgba(255,255,255,0.5);
}

.theme-icon.light { background: linear-gradient(135deg, #FAFAFA, #E0E0E0); }
.theme-icon.dark { background: linear-gradient(135deg, #424242, #212121); }

/* Superadmin Pages Dropdown */
.superadmin-pages-dropdown {
  position: relative;
  display: inline-block;
}

.superadmin-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  min-width: 200px;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 1000;
  padding: 0.5rem 0;
}

.superadmin-pages-dropdown.open .superadmin-dropdown-menu {
  display: block;
}

.superadmin-dropdown-menu .dropdown-section-header {
  padding: 0.5rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary, #666);
  background: var(--bg-secondary, #f5f5f5);
  border-top: 1px solid var(--border, #e0e0e0);
  margin-top: 0.25rem;
}

.superadmin-dropdown-menu .dropdown-section-header:first-child {
  border-top: none;
  margin-top: 0;
}

.superadmin-dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text, #333);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background 0.15s;
}

.superadmin-dropdown-menu a:hover {
  background: var(--primary, #2196F3);
  color: white;
}

/* Deck Type Badges */
.deck-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.deck-type--class {
  background: #e3f2fd;
  color: #1565c0;
}

.deck-type--extra {
  background: #e8f5e9;
  color: #2e7d32;
}

.deck-type--personal {
  background: #f3e5f5;
  color: #7b1fa2;
}

.deck-type--template {
  background: #fff3e0;
  color: #e65100;
}

/* Tooltip styles */
.tooltip-icon {
  position: relative;
  display: inline-block;
  cursor: help;
  margin-left: 0.25rem;
  font-size: 0.875rem;
  opacity: 0.7;
}

.tooltip-text {
  visibility: hidden;
  position: absolute;
  z-index: 100;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.tooltip-icon:hover .tooltip-text {
  visibility: visible;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  /* Removed min-width: 1006px to enable mobile viewing */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
}

/* Header Bar */
#backgroundHeader {
  height: 100px;
  width: 100%;
  background: white;
  border-bottom: 3px solid var(--primary);
  box-shadow: var(--shadow-sm);
}

.header-content {
  width: var(--container-lg);
  margin-inline: auto;
  padding: var(--space-md);
}

/* Top Navbar (for authenticated pages) */
.navbar {
  background: linear-gradient(135deg, #1E5BA8 0%, #4A90E2 100%);
  border-bottom: 3px solid #164480;
  padding: 0.875rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

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

.nav-content h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

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

/* Consistent sizing for all navbar buttons */
.nav-right .btn-secondary,
.nav-right .language-switcher,
.nav-right .theme-switcher,
.nav-right .logout-btn {
  min-width: 40px;
  min-height: 40px;
  padding: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Logout button with icon */
.logout-btn {
  padding: 0.5rem !important;
  min-width: 40px !important;
}

.logout-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* Navbar Logo */
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.navbar-logo-circle {
  float: none !important;
  position: static !important;
  width: 2.75rem !important;
  height: 2.75rem !important;
  padding: 0.5rem !important;
  border-radius: 0.5rem !important;
  background-image: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar-logo-circle .logo-icon {
  width: 1.75rem;
  height: 1.5rem;
}

.navbar-logo-circle .logo-icon svg {
  width: 100%;
  height: 100%;
}

.navbar-brand {
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-tagline {
  color: white;
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.85;
  letter-spacing: 0.3px;
  white-space: nowrap;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(255,255,255,0.4);
  margin-left: 0.75rem;
}

@media (max-width: 768px) {
  .logo-tagline {
    display: none;
  }
}

.superadmin-badge {
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.9;
}

/* Theme Switcher */
.theme-switcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2) !important;
  border: 2px solid rgba(255, 255, 255, 0.5) !important;
  color: white !important;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.2s;
  line-height: 1;
}

.theme-switcher:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  color: white !important;
}

/* Language Switcher */
.language-switcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2) !important;
  border: 2px solid rgba(255, 255, 255, 0.5) !important;
  color: white !important;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.language-switcher:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  color: white !important;
}

/* Content Wrapper */
.contentWrapper {
  border-radius: var(--radius-xl);
  width: var(--container-lg);
  margin-inline: auto;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-xl);
  padding: var(--space-md);
  background-color: var(--bg-primary);
  box-shadow: 0px 8px 13px 0px rgba(0, 0, 0, 0.4);
}

/* Logo Circle */
.logo-circle {
  position: relative;
  z-index: 90;
  float: left;
  width: clamp(5rem, 15vw, 9rem);
  height: clamp(5rem, 15vw, 9rem);
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius-lg);
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50" y="55" font-size="40" text-anchor="middle" fill="white" font-weight="bold" font-family="Arial">Voc</text><text x="50" y="80" font-size="20" text-anchor="middle" fill="white" font-weight="bold" font-family="Arial">App</text></svg>');
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.25);
}

#contentHead {
  position: relative;
  float: left;
  width: 100%;
  margin-bottom: 10px;
}

/* Container for authenticated pages */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Content Layout with Sidebar */
.content-layout {
  position: relative;
  float: left;
  width: 100%;
  display: flex;
  gap: 10px;
}

#sidebar, .app-sidebar {
  width: 200px;
  flex-shrink: 0;
}

#contentBody, .app-content {
  flex: 1;
  min-width: 0;
}

/* App Layout - Base styles for sidebar + main content */
.app-layout {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 60px);
}

.left-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
}

.left-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.5rem;
}

.left-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  transition: background 0.2s;
}

.left-sidebar nav a:hover {
  background: var(--bg-secondary);
}

.left-sidebar nav a.active {
  background: var(--primary);
  color: white;
}

.left-sidebar nav a.active svg {
  stroke: white;
}

/* Main content area - standardized base styles */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  max-width: 1400px;
}

@media (min-width: 1600px) {
  .app-layout .main-content {
    margin: 0 auto;
  }
}

/* Gradient Boxes */
.gradient-box, .card, .section {
  background: var(--bg-secondary);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

/* Sidebar Menu */
.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu li {
  margin-bottom: 0.5rem;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  transition: all 0.2s;
}

.sidebar-menu a:hover {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
}

.sidebar-menu a.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
}

.sidebar-menu a svg,
.left-sidebar nav a svg {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9375rem;
}

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

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

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

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

/* Navbar btn-secondary needs white text on dark gradient background */
.nav-right .btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.nav-right .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: white;
}

/* Navbar logout button - ensure visibility on gradient background */
.nav-right .logout-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.nav-right .logout-btn:hover {
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border-color: rgba(239, 68, 68, 0.9);
}

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

.btn-success:hover {
  background: var(--success-dark);
}

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

.btn-danger:hover {
  background: var(--danger-dark);
}

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn-large {
  padding: 0.875rem 1.75rem;
  font-size: 1.0625rem;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Format Toolbar - B/I/U buttons for card content formatting */
.format-toolbar {
  display: inline-flex;
  gap: 2px;
  margin-left: 0.5rem;
  opacity: 0.6;
  transition: opacity 0.2s;
  vertical-align: middle;
}

.format-toolbar:hover {
  opacity: 1;
}

.format-btn {
  padding: 2px 6px;
  font-size: 0.75rem;
  font-family: inherit;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  color: var(--text-primary);
  line-height: 1.2;
}

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

.format-btn-bold { font-weight: bold; }
.format-btn-italic { font-style: italic; }
.format-btn-underline { text-decoration: underline; }

/* Mini toolbar for table cells */
.format-toolbar-mini {
  margin-left: 0.25rem;
}

.format-toolbar-mini .format-btn {
  padding: 1px 4px;
  font-size: 0.7rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-primary);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table thead {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
}

.data-table th {
  padding: 0.875rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9375rem;
}

.data-table td {
  padding: 0.875rem;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr:hover {
  background: var(--bg-secondary);
}

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

/* Responsive table wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--space-md);
}

.table-responsive .data-table {
  min-width: 40rem;
}

/* Responsive table adjustments */
@media (max-width: 768px) {
  .data-table th,
  .data-table td {
    min-width: 5rem;
    font-size: var(--text-sm);
    padding: var(--space-sm);
  }

  .data-table th:first-child,
  .data-table td:first-child {
    position: sticky;
    left: 0;
    background: inherit;
    z-index: 1;
  }
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
}

.stat-box {
  background: var(--bg-secondary);
  padding: 1.25rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
}

.stat-box .label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.stat-box .value {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--primary);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Flexbox Utilities */
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* Gap Utilities */
.gap-0 { gap: 0; }
.gap-xs { gap: 0.25rem; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 0.75rem; }
.gap-1 { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.gap-xl { gap: 2rem; }

/* Margin Utilities */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-xs { margin-top: 0.25rem; }
.mt-sm { margin-top: 0.5rem; }
.mt-1 { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mt-xl { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-xs { margin-bottom: 0.25rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }
.mb-xl { margin-bottom: 2rem; }
.ml-auto { margin-left: auto; }
.ml-lg { margin-left: 1.5rem; }
.mr-auto { margin-right: auto; }
.text-primary { color: var(--primary); }

/* Padding Utilities */
.p-0 { padding: 0; }
.p-xs { padding: 0.25rem; }
.p-sm { padding: 0.5rem; }
.p-1 { padding: 1rem; }
.p-lg { padding: 1.5rem; }
.px-sm { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-1 { padding-left: 1rem; padding-right: 1rem; }
.py-sm { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-1 { padding-top: 1rem; padding-bottom: 1rem; }

/* Width Utilities */
.w-100 { width: 100%; }
.w-auto { width: auto; }

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--color-muted); }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-bold { font-weight: 700; }
.fs-xs { font-size: 0.75rem; }
.fs-sm { font-size: 0.875rem; }
.fs-base { font-size: 1rem; }
.fs-lg { font-size: 1.125rem; }
.text-nowrap { white-space: nowrap; }

/* Status Color Text Classes */
.text-success-alt { color: var(--color-success-alt); }
.text-info { color: var(--color-info); }
.text-warning-alt { color: var(--color-warning-alt); }
.text-danger { color: var(--danger); }
.text-purple { color: var(--color-purple); }

/* Status Badge Classes */
.badge-status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-mastered {
  background: var(--color-success-alt-bg);
  color: var(--color-success-alt);
}
.badge-learning {
  background: var(--color-warning-alt-bg);
  color: var(--color-warning-alt);
}
.badge-struggling {
  background: var(--color-danger-bg);
  color: var(--danger);
}
.badge-excellent {
  background: var(--color-success-alt-bg);
  color: var(--color-success-alt);
}
.badge-good {
  background: var(--color-info-bg);
  color: var(--color-info);
}
.badge-not-started {
  background: var(--color-muted-bg);
  color: var(--text-secondary);
}
.badge-purple {
  background: var(--color-purple-bg);
  color: var(--color-purple);
}

/* Stat Box Color Variants */
.stat-box--success { border-left-color: var(--color-success-alt); }
.stat-box--success .value { color: var(--color-success-alt); }
.stat-box--info { border-left-color: var(--color-info); }
.stat-box--info .value { color: var(--color-info); }
.stat-box--warning { border-left-color: var(--color-warning-alt); }
.stat-box--warning .value { color: var(--color-warning-alt); }
.stat-box--danger { border-left-color: var(--danger); }
.stat-box--danger .value { color: var(--danger); }
.stat-box--purple { border-left-color: var(--color-purple); }
.stat-box--purple .value { color: var(--color-purple); }

/* Progress Bar with Status Colors */
.progress-bar {
  background: var(--bg-secondary);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  transition: width 0.3s ease;
}
.progress-success .fill { background: var(--color-success-alt); }
.progress-info .fill { background: var(--color-info); }
.progress-warning .fill { background: var(--color-warning-alt); }
.progress-danger .fill { background: var(--danger); }
.progress-purple .fill { background: var(--color-purple); }

/* Button Color Variants for inline style replacement */
.btn-success-alt {
  background: var(--color-success-alt);
  color: white;
  border-color: var(--color-success-alt);
}
.btn-success-alt:hover {
  background: #0d9f6e;
  border-color: #0d9f6e;
}
.btn-warning-alt {
  background: var(--color-warning-alt);
  color: white;
  border-color: var(--color-warning-alt);
}
.btn-warning-alt:hover {
  background: #d97706;
  border-color: #d97706;
}

/* Button Size Variants */
.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

/* Gradient Button Variants */
.btn-gradient-purple {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  border: none;
}

.btn-gradient-purple:hover {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: white;
}

/* Nav Link Utilities */
.nav-link-inherit {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Icon Size Utilities */
.icon-sm { width: 1.25rem; height: 1.25rem; }
.icon-md { width: 1.5rem; height: 1.5rem; }
.icon-lg { width: 2rem; height: 2rem; }
.icon-xl { width: 2.5rem; height: 2.5rem; }

/* Additional Font Size Utilities */
.fs-xl { font-size: 1.5rem; }
.fs-2xl { font-size: 2rem; }

/* Card Grid Layout */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1rem;
}

/* Class Card Styles */
.class-card-title {
  margin-top: 0;
  color: var(--primary);
}

.class-card-description {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.class-card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Online Status Badge */
.badge-online {
  padding: 0.5rem 1rem;
  background: rgba(16, 185, 129, 0.13);
  color: #10b981;
  border: 1px solid #10b981;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
}

/* Deck Item States */
.deck-item--inactive {
  opacity: 0.5;
  filter: grayscale(50%);
}

/* Stat Value Color Variants */
.stat-value--purple { color: #8b5cf6; text-decoration: none; cursor: pointer; }
.stat-value--blue { color: #2196F3; }

/* Impersonation Banner */
.impersonation-banner {
  background: var(--color-warning-alt);
  color: #000;
  padding: 0.75rem;
  text-align: center;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.impersonation-banner .btn-exit {
  background: var(--danger);
  color: white;
  padding: 0.375rem 0.75rem;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  font-weight: 600;
}

.impersonation-banner .btn-exit:hover {
  background: var(--danger-dark);
}

/* Admin Dashboard Elements */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.bulk-actions-bar {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.bulk-actions-label {
  font-weight: 600;
  margin-right: 0.5rem;
}

.selection-count {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.th-narrow {
  width: 40px;
}

/* Role Badges */
.badge-teacher {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-student {
  background: #d1fae5;
  color: #047857;
}

/* Status Badges */
.badge-inactive {
  background: #fee2e2;
  color: #dc2626;
}

.badge-unverified {
  background: #fef3c7;
  color: #d97706;
}

.badge-active {
  background: #d1fae5;
  color: #047857;
}

/* Plan Select */
.plan-select {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Info Box */
.info-box {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1rem;
}

.info-box h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.info-box h3:first-child {
  margin-top: 0;
}

.info-box ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.info-box li {
  margin: 0.5rem 0;
  color: var(--text-primary);
}

/* Sync Result Messages */
.sync-result-success {
  padding: 1rem;
  background: var(--color-success-alt);
  color: white;
  border-radius: var(--radius);
}

.sync-result-error {
  padding: 1rem;
  background: var(--danger);
  color: white;
  border-radius: var(--radius);
}

.sync-result-loading {
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

/* Filter Controls */
.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.filter-controls .form-group {
  margin: 0;
}

.filter-controls label {
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  display: block;
}

.filter-controls input,
.filter-controls select {
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  min-width: 120px;
}

/* Engagement Color Classes */
.engagement-high { color: var(--color-success-alt); font-weight: 600; }
.engagement-medium { color: var(--color-warning-alt); font-weight: 600; }
.engagement-low { color: var(--danger); font-weight: 600; }

/* Sync Card Gradient */
.sync-card-gradient {
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
}

/* Code Inline */
.code-inline {
  background: var(--bg-secondary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: monospace;
}

/* Modal Width Variants */
.modal-content--sm { max-width: 500px; }
.modal-content--md { max-width: 600px; }
.modal-content--lg { max-width: 800px; }

/* Checkbox List Container */
.checkbox-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  padding: 0.5rem;
  border-radius: var(--radius);
}

.checkbox-list--tall {
  max-height: 300px;
}

/* Modal Action Buttons Row */
.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Gamification Elements */
.motivational-banner {
  background: linear-gradient(135deg, var(--color-purple), #6366f1);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.motivational-banner .content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.motivational-banner .close-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.25rem;
  opacity: 0.7;
}

.motivational-banner .close-btn:hover {
  opacity: 1;
}

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

.level-card {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: white;
  padding: 1.5rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.level-badge {
  width: 4.375rem;
  height: 4.375rem;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.level-info .level-label {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.level-info .level-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.xp-bar {
  background: rgba(255,255,255,0.2);
  border-radius: 1rem;
  height: 0.5rem;
  overflow: hidden;
}

.xp-bar .fill {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  height: 100%;
  transition: width 0.5s ease;
}

.xp-text {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}

.daily-goal-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.daily-goal-card.completed {
  border-color: var(--color-success-alt);
}

.goal-ring {
  position: relative;
  width: 4.375rem;
  height: 4.375rem;
}

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

.goal-ring .value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.25rem;
  font-weight: bold;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  padding: 1.25rem;
  border-radius: var(--radius);
  text-align: center;
  color: white;
}

.stat-card--blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat-card--amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-card--green { background: linear-gradient(135deg, #10b981, #059669); }
.stat-card--purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.stat-card .icon {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.stat-card .value {
  font-size: 1.5rem;
  font-weight: bold;
}

.stat-card .label {
  font-size: 0.75rem;
  opacity: 0.9;
}

/* Responsive gamification grid */
@media (max-width: 768px) {
  .gamification-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Activity Card */
.activity-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.activity-card h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

.activity-card p {
  margin: 0 0 0.5rem 0;
}

.activity-card p:last-child {
  margin-bottom: 0;
}

/* Quick Start Card - Made More Prominent */
.quick-start-card {
  padding: 2rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  min-height: 180px;
  grid-column: 1 / -1; /* Span full width - center the card */
}

.quick-start-card--primary {
  background: linear-gradient(135deg, #ff6b35, #f7931e, #ffb347);
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

.quick-start-card--purple {
  background: linear-gradient(135deg, var(--color-purple), #6366f1);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.quick-start-card .big-number {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

.quick-start-card .subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  opacity: 0.95;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.quick-start-card .btn-pill--white-primary {
  font-size: 1.125rem;
  padding: 0.875rem 2rem;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}

.quick-start-card .btn-pill--white-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.btn-pill {
  font-size: 0.9rem;
  padding: 0.6rem 1.25rem;
  font-weight: 600;
  border-radius: 2rem;
  text-decoration: none;
}

.btn-pill--white-purple {
  background: white;
  color: var(--color-purple);
}

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

.btn-pill--white-green {
  background: white;
  color: var(--color-success-alt);
}

/* Error Message */
.error {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.875rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  border-left: 4px solid var(--danger);
}

/* Success Message */
.success {
  background: #d1fae5;
  color: #065f46;
  padding: 0.875rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  border-left: 4px solid var(--success);
}

/* Auth Box (Login/Register) */
.auth-box {
  max-width: 400px;
  margin: 2rem auto;
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

/* Practice Container */
.practice-container {
  max-width: var(--container-md);
  margin: var(--space-xl) auto;
  padding: 0 var(--space-md);
}

/* Mode Selector */
.mode-selector {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.mode-btn {
  padding: 0.75rem 2rem;
  background: var(--bg-primary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.mode-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.mode-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* Practice Area */
.practice-area {
  margin-bottom: 2rem;
}

/* Card Display */
.card-display {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
  min-height: min(70vh, 31.25rem);
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

/* Flashcard specific - responsive size */
.flashcard {
  width: 100%;
  max-width: var(--container-md);
  min-height: min(70vh, 31.25rem);
  max-height: 80vh;
  box-sizing: border-box;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
}

.card-side {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-sizing: border-box;
  flex-shrink: 0;
}

.card-side.front {
  height: 350px;
  min-height: 350px;
  max-height: 350px;
}

.card-side.back {
  height: 350px;
  min-height: 350px;
  max-height: 350px;
  border-top: 2px solid var(--border);
}

.card-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  font-weight: 600;
}

.card-content {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2rem 0;
  line-height: 1.4;
}

/* Hint wrapper with hover effect */
.card-hint-wrapper {
  margin: 1.5rem -2rem 2rem -2rem;
  position: relative;
  min-height: 80px;
  width: calc(100% + 4rem);
}

.card-hint-wrapper .hint-icon {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  cursor: help;
  display: inline-block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border-left: 3px solid var(--warning);
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  transition: opacity 0.2s ease-in;
  white-space: nowrap;
}

.card-hint-wrapper .hint-text {
  display: none;
  font-size: 1rem;
  color: var(--text-primary);
  font-style: italic;
  padding: 0.75rem 2rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  animation: fadeIn 0.2s ease-in;
  line-height: 1.6;
  box-sizing: border-box;
}

.card-hint-wrapper:hover .hint-icon {
  opacity: 0;
  pointer-events: none;
}

.card-hint-wrapper:hover .hint-text {
  display: block;
}

/* Mobile tap support - same as hover but triggered by .active class */
.card-hint-wrapper.active .hint-icon {
  opacity: 0;
  pointer-events: none;
}

.card-hint-wrapper.active .hint-text {
  display: block;
}

/* Flashcard-specific hint styling (works within flex layout) */
.flashcard-content .card-hint-wrapper {
  margin: 1rem 0;
  width: 100%;
  min-height: 50px;
  position: relative;
}

.flashcard-content .card-hint-wrapper .hint-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.flashcard-content .card-hint-wrapper .hint-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  max-width: 90%;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Feedback Buttons */
.feedback-buttons {
  margin-top: 2rem;
  gap: 0.75rem;
}

.feedback-buttons button {
  font-weight: 600;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
}

/* Typing Mode */
.typing-input {
  width: 100%;
  max-width: 500px;
  padding: 1rem;
  font-size: 1.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  margin: 1.5rem 0;
  text-align: center;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.typing-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.typing-feedback {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 1.125rem;
  font-weight: 600;
}

.typing-feedback.correct {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid var(--success);
}

.typing-feedback.incorrect {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid var(--danger);
}

.typing-feedback.partially-correct {
  background: #fef3c7;
  color: #92400e;
  border-left: 4px solid var(--warning);
}

/* Practice Stats */
.practice-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1.5rem;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 120px;
}

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

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

/* Keyboard Shortcuts Display */
.keyboard-shortcuts {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 2px dashed var(--border);
}

.shortcuts-title {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  font-weight: 600;
  text-align: center;
}

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

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
}

.shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0.25rem 0.5rem;
  background: var(--text-primary);
  color: var(--bg-primary);
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 0.875rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.shortcut-description {
  font-size: 0.875rem;
  color: var(--text-primary);
}

/* ========================================
   ANKI-STYLE PRACTICE INTERFACE
   ======================================== */

/* Prevent horizontal scrollbar during animations */
body:has(.practice-viewport) {
  overflow-x: hidden;
}

/* Practice Viewport - Full screen container */
.practice-viewport {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary, #f5f5f5);
  position: relative;
  overflow-x: hidden; /* Prevent horizontal scrollbar during swipe animations */
  width: 100%;
  max-width: 100vw;
}

/* Minimal Header */
.practice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: transparent;
  flex-wrap: wrap;
  gap: 1rem;
}

.practice-header-left,
.practice-header-center,
.practice-stats-minimal {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-minimal {
  color: var(--text-secondary, #666);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-minimal:hover {
  background: rgba(0,0,0,0.05);
}

.practice-stats-minimal {
  color: var(--text-secondary, #666);
  font-size: 0.9rem;
}

/* Card Container - Centered with flex */
.practice-card-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
  overflow-x: hidden; /* Prevent horizontal scrollbar during swipe animations */
}

/* ============================================
   3D FLASHCARD WITH FLIP ANIMATION
   ============================================ */
.flashcard-container {
  perspective: 1000px;
  -webkit-perspective: 1000px;
  max-width: 550px;
  width: 100%;
  min-height: 320px;
  height: auto;
}

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

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

/* Ensure front is hidden and back is visible when flipped */
.flashcard.flipped .flashcard-front {
  visibility: hidden;
  opacity: 0;
}

.flashcard.flipped .flashcard-back {
  visibility: visible;
  opacity: 1;
}

.flashcard-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 320px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 12px;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.1),
    0 10px 20px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Writing lines background */
.flashcard-lines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent 1.8rem,
      rgba(100, 149, 237, 0.15) 1.8rem,
      rgba(100, 149, 237, 0.15) calc(1.8rem + 1px)
    );
}

.flashcard-front {
  background: linear-gradient(180deg, #fffef8 0%, #fff9e6 100%);
  z-index: 2;
  visibility: visible;
  opacity: 1;
  transition: visibility 0.3s, opacity 0.3s;
}

.flashcard-back {
  background: linear-gradient(180deg, #f0f8ff 0%, #e6f2ff 100%);
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  z-index: 1;
  transition: visibility 0.3s, opacity 0.3s;
}

.flashcard-content {
  position: relative;
  z-index: 1;
  padding: 2rem 2.5rem 1.5rem 2.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.flashcard-face .language-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  font-weight: 600;
}

.flashcard-face .card-content {
  font-size: 1.6rem;
  line-height: 1.6;
  color: #2c3e50;
  font-weight: 500;
  word-wrap: break-word;
}

.flashcard-face .card-image {
  margin-top: 1rem;
}

.flashcard-face .card-image img {
  max-width: 100%;
  max-height: 150px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.flashcard-front .btn-show-answer {
  margin: 1rem 2rem 1.5rem 2rem;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light, #4a90e2) 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.flashcard-front .btn-show-answer:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Dark mode adjustments for flashcards */
[data-theme="dark"] .flashcard-front {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

[data-theme="dark"] .flashcard-back {
  background: linear-gradient(180deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
}

[data-theme="dark"] .flashcard-lines {
  background:
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent 1.8rem,
      rgba(255, 255, 255, 0.05) 1.8rem,
      rgba(255, 255, 255, 0.05) calc(1.8rem + 1px)
    );
  border-left-color: rgba(255, 100, 100, 0.15);
}

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

/* ============================================
   END 3D FLASHCARD
   ============================================ */

/* Practice Card - Anki style (for typing mode) */
.practice-card {
  background: var(--bg-primary, white);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 3rem 2.5rem;
  max-width: 600px;
  width: 100%;
  min-height: 200px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow-y: auto;
}

/* Card Content */
.practice-card .card-content {
  font-size: 1.75rem;
  line-height: 1.5;
  color: var(--text-primary, #333);
  margin: 0;
  word-wrap: break-word;
  width: 100%;
}

/* Question Side */
.card-question {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Answer Side */
.card-answer {
  width: 100%;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-divider {
  width: 100%;
  height: 1px;
  background: var(--border, #ddd);
  margin: 1.5rem 0;
}

/* Card Image */
.practice-card .card-image {
  margin-top: 1.5rem;
  width: 100%;
  display: flex;
  justify-content: center;
}

.practice-card .card-image img {
  max-width: 100%;
  max-height: 250px;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* Card Hint - Hover to reveal */
.practice-card .card-hint-wrapper {
  margin: 1.5rem -2rem 2rem -2rem;
  padding: 0;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: calc(100% + 4rem);
}

.practice-card .card-hint-wrapper .hint-icon {
  font-size: 1rem;
  color: var(--text-secondary, #999);
  cursor: help;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s;
}

.practice-card .card-hint-wrapper .hint-text {
  display: none;
  font-size: 1rem;
  color: var(--text-primary);
  font-style: italic;
  padding: 0.75rem 2rem;
  background: var(--bg-secondary, #f9f9f9);
  border-radius: 4px;
  border-left: 3px solid var(--primary);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  animation: fadeIn 0.2s ease-in;
  line-height: 1.6;
  box-sizing: border-box;
}

.practice-card .card-hint-wrapper:hover .hint-icon {
  opacity: 0;
  pointer-events: none;
}

.practice-card .card-hint-wrapper:hover .hint-text {
  display: block;
}

/* Practice card - mobile tap support */
.practice-card .card-hint-wrapper.active .hint-icon {
  opacity: 0;
  pointer-events: none;
}

.practice-card .card-hint-wrapper.active .hint-text {
  display: block;
}

/* Show Answer Button */
.btn-show-answer {
  margin-top: 2rem;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  background: var(--primary, #2196F3);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  font-weight: 500;
}

.btn-show-answer:hover {
  background: #1976D2;
}

/* Fixed Button Bar - Anki style */
.practice-buttons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background: var(--bg-primary, white);
  border-top: 1px solid var(--border, #e0e0e0);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
  flex-wrap: wrap;
}

/* Difficulty Buttons */
.btn-difficulty {
  flex: 1;
  max-width: 150px;
  min-width: 100px;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
}

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

.btn-difficulty:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(50%);
}

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

.btn-shortcut {
  font-size: 0.75rem;
  opacity: 0.6;
}

/* Interval preview labels (Anki-style) */
.btn-interval {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.9;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  background: rgba(255, 255, 255, 0.2);
  margin-top: 0.125rem;
}

.btn-again .btn-interval { background: rgba(255, 255, 255, 0.25); }
.btn-hard .btn-interval { background: rgba(255, 255, 255, 0.2); }
.btn-good .btn-interval { background: rgba(255, 255, 255, 0.25); }
.btn-easy .btn-interval { background: rgba(255, 255, 255, 0.25); }

/* Button Colors - Anki style */
.btn-again {
  background: #ef5350;
  color: white;
}

.btn-again:hover:not(:disabled) {
  background: #e53935;
}

.btn-hard {
  background: #78909c;
  color: white;
}

.btn-hard:hover:not(:disabled) {
  background: #607d8b;
}

.btn-good {
  background: #66bb6a;
  color: white;
}

.btn-good:hover:not(:disabled) {
  background: #4caf50;
}

.btn-easy {
  background: #42a5f5;
  color: white;
}

.btn-easy:hover:not(:disabled) {
  background: #2196F3;
}

/* Keyboard Hint - Subtle corner indicator */
.keyboard-hint {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  font-size: 0.8rem;
  color: #999;
  background: rgba(255,255,255,0.9);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  z-index: 10;
}

/* Typing Mode Adjustments */
.practice-card .typing-input {
  width: 100%;
  max-width: 500px;
  padding: 1rem;
  font-size: 1.25rem;
  border: 2px solid var(--border, #ddd);
  border-radius: 4px;
  text-align: center;
  transition: border-color 0.2s;
}

.practice-card .typing-input:focus {
  outline: none;
  border-color: var(--primary, #2196F3);
}

.practice-card #typingForm {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  align-items: center;
}

/* Animations for card transitions */
.practice-card.entering {
  animation: slideInUp 0.4s ease-out;
}

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

.practice-card.animating {
  pointer-events: none;
}

.practice-card.animating-known {
  animation: swipeRight 0.5s ease-out;
}

.practice-card.animating-not-known {
  animation: swipeLeft 0.5s ease-out;
}

@keyframes swipeRight {
  to {
    transform: translateX(100vw) rotate(20deg);
    opacity: 0;
  }
}

@keyframes swipeLeft {
  to {
    transform: translateX(-100vw) rotate(-20deg);
    opacity: 0;
  }
}

/* Feedback overlay for animations */
.feedback-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 100;
}

.feedback-icon {
  font-size: 8rem;
  font-weight: bold;
  opacity: 0;
  animation: feedbackPulse 0.5s ease-out;
}

.feedback-icon.checkmark {
  color: #4caf50;
}

.feedback-icon.x-mark {
  color: #ef5350;
}

@keyframes feedbackPulse {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.2);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

/* ============================================
   WOODEN DESK PRACTICE THEME
   ============================================ */

/* Wooden desk background - applies to practice viewport */
.practice-viewport.wooden-desk-theme {
  /* Use real wooden desk texture image */
  background:
    /* Slight darkening overlay for better card contrast */
    linear-gradient(rgba(0,0,0,0.05), rgba(0,0,0,0.1)),
    url('/img/wooden-desk-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  /* Fallback color if image fails to load */
  background-color: #b8845a;
  position: relative;
}

/* Subtle vignette effect for desk depth */
.practice-viewport.wooden-desk-theme::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    /* Corner shadows for depth */
    radial-gradient(ellipse at 0% 0%, rgba(0, 0, 0, 0.15) 0%, transparent 35%),
    radial-gradient(ellipse at 100% 0%, rgba(0, 0, 0, 0.15) 0%, transparent 35%),
    radial-gradient(ellipse at 0% 100%, rgba(0, 0, 0, 0.2) 0%, transparent 40%),
    radial-gradient(ellipse at 100% 100%, rgba(0, 0, 0, 0.2) 0%, transparent 40%),
    /* Overall subtle vignette for focus effect */
    radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.15) 100%);
  pointer-events: none;
  z-index: -1;
}

/* Ensure content stays above vignette (exclude scattered-cards which needs absolute positioning) */
.practice-viewport.wooden-desk-theme > *:not(.scattered-cards) {
  position: relative;
  z-index: 1;
}

/* ============================================
   SCATTERED CARDS ON DESK
   ============================================ */

/* Container for scattered cards - absolute position within practice-viewport */
.scattered-cards {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;  /* Above vignette (-1) and other content (1), below flashcard (5) */
  overflow: hidden;
}

/* Ensure scattered cards display in wooden desk theme */
.practice-viewport.wooden-desk-theme .scattered-cards {
  display: block;
}

/* Individual desk card - realistic flashcard appearance */
.desk-card {
  position: absolute;
  left: var(--x, 10%);
  top: var(--y, 20%);
  width: 120px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;

  /* 3D perspective - card lying on desk */
  transform:
    rotate(var(--rot, 0deg))
    perspective(800px)
    rotateX(8deg)
    translateZ(0);
  transform-origin: center center;

  /* Realistic paper appearance */
  background-color: #fffef5;
  border-radius: 6px;

  /* Paper texture - notebook lines on cream gradient */
  background-image:
    /* Red margin line */
    linear-gradient(90deg, transparent 8px, rgba(220, 80, 80, 0.2) 8px, rgba(220, 80, 80, 0.2) 10px, transparent 10px),
    /* Blue ruled lines */
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 10px,
      rgba(100, 149, 237, 0.18) 10px,
      rgba(100, 149, 237, 0.18) 11px
    ),
    /* Base paper gradient */
    linear-gradient(145deg, #fffef5 0%, #faf8f0 50%, #f5f3eb 100%);

  /* Realistic layered shadow - card sitting on desk */
  box-shadow:
    /* Contact shadow */
    0 1px 1px rgba(0,0,0,0.12),
    /* Soft ambient shadow */
    0 2px 4px rgba(0,0,0,0.1),
    /* Larger diffuse shadow */
    0 4px 12px rgba(0,0,0,0.08),
    /* Subtle edge highlight */
    inset 0 1px 0 rgba(255,255,255,0.5),
    /* Bottom edge shadow for thickness */
    inset 0 -1px 0 rgba(0,0,0,0.05);

  /* Subtle border for definition */
  border: 1px solid rgba(0,0,0,0.06);

  /* Idle floating animation */
  animation: cardFloat 5s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

/* Idle floating animation - subtle breathing effect */
@keyframes cardFloat {
  0%, 100% {
    transform:
      rotate(var(--rot, 0deg))
      perspective(800px)
      rotateX(8deg)
      translateY(0px)
      translateZ(0);
  }
  50% {
    transform:
      rotate(var(--rot, 0deg))
      perspective(800px)
      rotateX(8deg)
      translateY(-3px)
      translateZ(2px);
  }
}

/* Text inside scattered desk cards - shows upcoming vocabulary */
.desk-card-text {
  font-size: 0.55rem;
  font-weight: 500;
  color: #555;
  text-align: center;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  word-break: break-word;
  max-height: 100%;
  padding: 2px;
}

/* Known cards - green tinted paper */
.desk-card.known-card {
  background-color: #e8f5e9;
  background-image:
    linear-gradient(90deg, transparent 8px, rgba(76, 175, 80, 0.15) 8px, rgba(76, 175, 80, 0.15) 10px, transparent 10px),
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 10px,
      rgba(76, 175, 80, 0.15) 10px,
      rgba(76, 175, 80, 0.15) 11px
    ),
    linear-gradient(145deg, #e8f5e9 0%, #dcedc8 50%, #c8e6c9 100%);
  border-color: rgba(76, 175, 80, 0.2);
}

/* Known counter badge - floating in corner */
.known-counter-badge {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #4caf50 0%, #43a047 100%);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow:
    0 4px 12px rgba(76, 175, 80, 0.4),
    0 2px 4px rgba(0,0,0,0.2);
  z-index: 10;
  pointer-events: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.known-counter-badge:not(:empty):not([data-count="0"]) {
  animation: counterPulse 0.3s ease;
}

@keyframes counterPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Hide scattered cards on mobile - not enough space */
@media (max-width: 768px) {
  .scattered-cards,
  .practice-viewport.wooden-desk-theme .scattered-cards {
    display: none !important;
  }
  .known-counter-badge {
    bottom: 80px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

/* Active card styling on wooden desk */
.wooden-desk-theme .flashcard-container {
  position: relative;
  z-index: 5;
}

.wooden-desk-theme .flashcard {
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.2),
    0 20px 40px rgba(0, 0, 0, 0.15);
}

.wooden-desk-theme .flashcard-face {
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.15),
    0 12px 24px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Enhanced paper texture for cards on desk */
.wooden-desk-theme .flashcard-lines {
  background:
    /* Notebook holes on left */
    radial-gradient(circle at 25px 50%, transparent 4px, #fffef8 4px, #fffef8 6px, transparent 6px),
    /* Blue lines */
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent 1.8rem,
      rgba(100, 149, 237, 0.2) 1.8rem,
      rgba(100, 149, 237, 0.2) calc(1.8rem + 1px)
    );
  /* Red margin line */
  border-left: 2px solid rgba(255, 100, 100, 0.3);
  margin-left: 30px;
}

/* Typing mode on wooden desk */
.wooden-desk-theme .practice-card {
  background: linear-gradient(180deg, #fffef8 0%, #fff9e6 100%);
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.2),
    0 20px 40px rgba(0, 0, 0, 0.15);
  border: none;
  position: relative;
}

/* Paper texture for typing mode */
.wooden-desk-theme .practice-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent 1.8rem,
      rgba(100, 149, 237, 0.15) 1.8rem,
      rgba(100, 149, 237, 0.15) calc(1.8rem + 1px)
    );
  border-radius: inherit;
  pointer-events: none;
}

/* Typing input styled as pencil writing */
.wooden-desk-theme .typing-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(100, 149, 237, 0.3);
  border-radius: 0;
  font-family: 'Comic Sans MS', 'Bradley Hand', cursive;
  color: #2c3e50;
}

.wooden-desk-theme .typing-input:focus {
  border-bottom-color: var(--primary);
  box-shadow: none;
}

/* Card animations for wooden desk theme */
@keyframes cardFromPile {
  0% {
    transform: translateX(-40vw) translateY(20px) rotate(-8deg) scale(0.5);
    opacity: 0.4;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
  }
  30% {
    transform: translateX(-20vw) translateY(-30px) rotate(-4deg) scale(0.8);
    opacity: 0.8;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.3));
  }
  100% {
    transform: translateX(0) translateY(0) rotate(0) scale(1);
    opacity: 1;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.2));
  }
}

@keyframes cardToKnownPile {
  0% {
    transform: translateX(0) translateY(0) rotate(0) scale(1);
    opacity: 1;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.2));
  }
  40% {
    transform: translateX(15vw) translateY(-40px) rotate(5deg) scale(0.9);
    opacity: 1;
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.25));
  }
  100% {
    transform: translateX(40vw) translateY(15px) rotate(12deg) scale(0.5);
    opacity: 0.5;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.2));
  }
}

@keyframes cardBackToPile {
  0% {
    transform: translateX(0) translateY(0) rotate(0) scale(1);
    opacity: 1;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.2));
  }
  40% {
    transform: translateX(-15vw) translateY(-35px) rotate(-5deg) scale(0.9);
    opacity: 1;
    filter: drop-shadow(0 18px 28px rgba(0,0,0,0.25));
  }
  100% {
    transform: translateX(-40vw) translateY(15px) rotate(-10deg) scale(0.5);
    opacity: 0.5;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.2));
  }
}

/* Placeholder for removed duplicate */
@keyframes cardBackToPileOld {
  0% {
    transform: translateX(0) rotate(0);
    opacity: 1;
  }
  100% {
    transform: translateX(-45vw) rotate(-10deg) scale(0.6);
    opacity: 0.5;
  }
}

/* Apply wooden desk animations */
.wooden-desk-theme .practice-card.entering,
.wooden-desk-theme .flashcard-container.entering {
  animation: cardFromPile 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.wooden-desk-theme .practice-card.animating-known,
.wooden-desk-theme .flashcard-container.animating-known {
  animation: cardToKnownPile 0.65s ease-out forwards;
}

.wooden-desk-theme .practice-card.animating-not-known,
.wooden-desk-theme .flashcard-container.animating-not-known {
  animation: cardBackToPile 0.6s ease-out forwards;
}

/* Dark theme adjustments for wooden desk */
[data-theme="dark"] .practice-viewport.wooden-desk-theme {
  /* Darker overlay on the wooden desk image for dark mode */
  background:
    linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.5)),
    url('/img/wooden-desk-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-color: #2d1f15;
}

[data-theme="dark"] .card-pile::before,
[data-theme="dark"] .card-pile::after,
[data-theme="dark"] .card-pile .pile-card {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .card-pile-right::before,
[data-theme="dark"] .card-pile-right::after,
[data-theme="dark"] .card-pile-right .pile-card {
  background: linear-gradient(180deg, #1b3d1f 0%, #2d4a31 100%);
  border-color: rgba(76, 175, 80, 0.3);
}

/* Desk theme toggle button */
.desk-theme-toggle {
  position: fixed;
  bottom: 100px;
  right: 20px;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s;
}

.desk-theme-toggle:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Hide piles on mobile - not enough space */
@media (max-width: 768px) {
  .desk-card-piles {
    display: none;
  }

  .wooden-desk-theme .flashcard-container.entering,
  .wooden-desk-theme .practice-card.entering {
    animation: cardEntry 0.4s ease-out;
  }

  .wooden-desk-theme .flashcard-container.animating-known,
  .wooden-desk-theme .practice-card.animating-known {
    animation: swipeRight 0.5s ease-out forwards;
  }

  .wooden-desk-theme .flashcard-container.animating-not-known,
  .wooden-desk-theme .practice-card.animating-not-known {
    animation: swipeLeft 0.5s ease-out forwards;
  }
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .practice-card {
    padding: 2rem 1.5rem;
    max-height: 80vh;
  }

  .practice-card .card-content {
    font-size: 1.5rem;
  }

  .practice-buttons {
    padding: 1rem;
    gap: 0.5rem;
  }

  .btn-difficulty {
    min-width: 80px;
    padding: 0.75rem 1rem;
  }

  .btn-label {
    font-size: 0.9rem;
  }

  .btn-shortcut {
    font-size: 0.7rem;
  }

  .keyboard-hint {
    font-size: 0.7rem;
    padding: 0.4rem 0.6rem;
  }

  .practice-header {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.5rem;
    gap: 0.5rem;
  }

  .practice-header-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
  }

  /* Consistent button sizing in practice header mobile */
  .practice-header button,
  .practice-header .btn,
  .practice-header .btn-minimal,
  .practice-header a.btn {
    height: 32px !important;
    min-height: 32px !important;
    font-size: 0.875rem !important;
    padding: 0 0.5rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Back button - arrow only */
  .practice-header-left .btn-minimal {
    font-size: 0 !important;
    width: 32px !important;
    padding: 0 !important;
  }

  .practice-header-left .btn-minimal::before {
    content: '←';
    font-size: 1rem;
  }

  /* Hide non-essential elements on mobile */
  #undoBtn,
  #randomModeIndicator,
  #switchToGapBtn {
    display: none !important;
  }

  /* Compact direction toggle - consistent sizing */
  #directionToggleBtn {
    height: 32px !important;
    min-height: 32px !important;
    margin: 0 !important;
    padding: 0 0.5rem !important;
    font-size: 0.875rem !important;
    gap: 0.15rem !important;
    background: var(--bg-tertiary, var(--bg-secondary)) !important;
    border: 1px solid var(--border) !important;
    border-radius: 1rem !important;
  }

  /* Make flag emojis consistent size */
  #directionToggleBtn span {
    font-size: 0.875rem !important;
    line-height: 1 !important;
  }

  /* Fix text readability in mobile practice header for all themes */
  .practice-header,
  .practice-header .btn-minimal,
  .practice-header button,
  .practice-header a {
    color: var(--text-primary) !important;
  }

  /* Back button arrow needs good contrast */
  .practice-header-left .btn-minimal::before {
    color: var(--text-primary) !important;
  }

  .practice-header-center {
    flex: 1;
    justify-content: flex-end;
  }

  #progressInfo {
    gap: 0.4rem !important;
  }

  /* Minimal circular progress - just the number */
  #circularProgress {
    width: 32px !important;
    height: 32px !important;
  }

  #circularProgress svg {
    display: none !important;
  }

  #cardsRemainingNumber {
    position: static !important;
    transform: none !important;
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    background: var(--primary, #2196F3);
    color: white !important;
    height: 32px !important;
    min-width: 32px;
    padding: 0 0.5rem;
    border-radius: 1rem;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Hide labels and extra info */
  #progressInfo > div:not(#circularProgress) {
    display: none !important;
  }

  #streakDisplay {
    display: none !important;
  }

  .practice-header-right {
    display: none !important; /* Hide on mobile - !important overrides inline style */
  }

  /* Hide desktop flashcard on mobile, show mobile version */
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block;
  }

  /* Mobile flashcard - simple card without 3D transforms */
  .mobile-flashcard {
    width: 100%;
    max-width: 100%;
    padding: 0 1rem;
  }

  .mobile-card {
    background: linear-gradient(180deg, #fffef8 0%, #fff9e6 100%);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
  }

  .mobile-card .language-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
  }

  .mobile-card .card-content {
    font-size: 1.4rem;
    line-height: 1.5;
    color: #2c3e50;
  }

  .mobile-card .btn-show-answer {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
  }

  .flashcard-content {
    padding: 1.5rem 1.5rem 1rem 2.5rem;
  }

  .flashcard-face .card-content {
    font-size: 1.3rem;
  }
}

/* Extra small phones - further reduce button sizes */
@media (max-width: 480px) {
  .practice-buttons {
    gap: 0.35rem;
    padding: 0.75rem;
  }

  .btn-difficulty {
    min-width: 60px;
    padding: 0.6rem 0.5rem;
    font-size: 0.85rem;
  }

  .btn-label {
    font-size: 0.8rem;
  }

  .btn-shortcut {
    display: none;
  }

  .btn-interval {
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
  }

  .mobile-card .card-content {
    font-size: 1.2rem;
  }
}

/* Desktop only - hide mobile elements */
@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }

  .desktop-only {
    display: block;
  }
}

/* Dark mode support for Anki-style interface */
@media (prefers-color-scheme: dark) {
  .practice-viewport {
    background: var(--bg-secondary);
  }

  .practice-card {
    background: var(--bg-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }

  .keyboard-hint {
    background: rgba(0,0,0,0.7);
    color: #ccc;
  }
}

/* Deck Grid */
.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.deck-card {
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.deck-card h3 {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.deck-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.deck-meta {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.deck-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.deck-stats .stat {
  flex: 1;
  min-width: 75px;
  text-align: center;
  padding: 0.75rem 0.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.deck-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.deck-actions .btn {
  flex: 1;
}

/* Card */
.flashcard {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: var(--shadow-lg);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s;
}

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

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
  border-bottom: 1px dotted var(--text-secondary);
  cursor: help;
}

.tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: #1e293b;
  color: white;
  text-align: center;
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.875rem;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  transition: width 0.3s;
}

/* Footer */
.info-footer {
  color: white;
  text-align: center;
  margin: 20px auto;
  padding-bottom: 20px;
}

.info-footer a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.info-footer a:hover {
  text-decoration: underline;
}

/* Utility Classes */
.clearBoth {
  clear: both;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Responsive */
@media (max-width: 1200px) {
  html {
    min-width: auto;
  }

  .contentWrapper {
    width: 95%;
    margin-left: -47.5%;
  }

  .header-content {
    width: 95%;
    margin-left: -47.5%;
  }

  .container {
    padding: 1rem;
  }
}

@media (max-width: 768px) {
  .content-layout {
    flex-direction: column;
  }

  #sidebar, .app-sidebar {
    width: 100%;
  }

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

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

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

  .logo-circle {
    width: 100px;
    height: 100px;
  }

  /* Mobile card/box padding fixes */
  .gradient-box, .card, .section {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
  }

  .stat-card {
    padding: 1rem;
  }

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

  .container {
    padding: 1rem;
  }
}

/* ===================================
   GDPR/DSGVO Cookie Consent Styles
   =================================== */

.cookie-consent-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease-in;
}

.cookie-consent-overlay.cookie-consent-closing {
  animation: fadeOut 0.3s ease-out;
}

.cookie-consent-modal {
  background: var(--card-bg);
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

.cookie-consent-closing .cookie-consent-modal {
  animation: slideDown 0.3s ease-in;
}

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

.cookie-consent-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-color);
}

.cookie-consent-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.cookie-consent-close:hover {
  background: var(--hover-bg);
  color: var(--text-color);
}

.cookie-consent-body {
  padding: 1.5rem;
}

.cookie-consent-body > p {
  margin-bottom: 1.5rem;
  line-height: 1.6;
  color: var(--text-color);
}

.cookie-consent-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cookie-option {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  transition: border-color 0.2s;
}

.cookie-option:hover {
  border-color: var(--primary-color);
}

.cookie-option-header {
  margin-bottom: 0.5rem;
}

.cookie-option-header label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-color);
  cursor: pointer;
}

.cookie-option-header input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.cookie-option-header input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.cookie-required {
  font-size: 0.85rem;
  font-weight: normal;
  color: var(--text-muted);
  font-style: italic;
}

.cookie-option-description {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding-left: 1.6rem;
}

.cookie-consent-links {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.cookie-consent-links a {
  color: var(--primary-color);
  text-decoration: none;
}

.cookie-consent-links a:hover {
  text-decoration: underline;
}

.cookie-consent-links span {
  margin: 0 0.5rem;
  color: var(--text-muted);
}

.cookie-consent-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

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

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

/* ===================================
   Practice Card Swipe Animations
   =================================== */

@keyframes swipeRightKnown {
  0% {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateX(120%) rotate(15deg);
    opacity: 0;
  }
}

@keyframes swipeLeftNotKnown {
  0% {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateX(-120%) rotate(-15deg);
    opacity: 0;
  }
}

@keyframes pulseCheckmark {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes shakeX {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

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

/* Animation state classes */
.card-display.animating-known {
  animation: swipeRightKnown 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

.card-display.animating-not-known {
  animation: swipeLeftNotKnown 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

.card-display.entering {
  animation: fadeInCard 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Feedback overlay */
.feedback-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  pointer-events: none;
}

.feedback-icon {
  font-size: 120px;
  line-height: 1;
  display: block;
}

.feedback-icon.checkmark {
  color: var(--success);
  animation: pulseCheckmark 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feedback-icon.x-mark {
  color: var(--danger);
  animation: shakeX 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure practice area is positioned for overlay */
.practice-area {
  position: relative;
}

/* Disable pointer events during animation */
.card-display.animating {
  pointer-events: none;
}

/* ===================================
   Legal Pages Styles
   =================================== */

.legal-page {
  max-width: 900px;
  margin: 2rem auto;
  padding: 2rem;
}

.legal-content {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 2.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.legal-content h1 {
  color: var(--text-color);
  margin-bottom: 0.5rem;
  font-size: 2.5rem;
}

.last-updated {
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.legal-content section {
  margin-bottom: 2.5rem;
}

.legal-content h2 {
  color: var(--primary-color);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.75rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.legal-content h3 {
  color: var(--text-color);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.legal-content h4 {
  color: var(--text-color);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.legal-content p {
  line-height: 1.8;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.legal-content ul, .legal-content ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
  line-height: 1.8;
}

.legal-content li {
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.legal-content a {
  color: var(--primary-color);
  text-decoration: none;
}

.legal-content a:hover {
  text-decoration: underline;
}

.legal-content code {
  background: var(--code-bg, #f5f5f5);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--code-color, #d63384);
}

.legal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
  flex-wrap: wrap;
}

.cookie-table {
  overflow-x: auto;
  margin: 1rem 0;
}

.cookie-table table {
  width: 100%;
  border-collapse: collapse;
  background: var(--table-bg, var(--card-bg));
  border-radius: 8px;
  overflow: hidden;
}

.cookie-table thead {
  background: var(--primary-color);
  color: white;
}

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

.cookie-table th {
  font-weight: 600;
  font-size: 0.95rem;
}

.cookie-table td {
  color: var(--text-color);
}

.cookie-table tbody tr:hover {
  background: var(--hover-bg);
}

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

/* Footer Styles - Minimal single-line footer */
footer,
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 0.4rem 1rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  /* Not fixed - only visible when scrolling to bottom */
}

.site-footer .container > div {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

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

@media (max-width: 768px) {
  footer,
  .site-footer {
    padding: 0.4rem 0.75rem;
    font-size: 0.65rem;
    /* No extra margin - just stays at document bottom */
  }
}

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

.footer-content p {
  margin: 0;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Responsive adjustments for legal pages */
@media (max-width: 768px) {
  .legal-page {
    padding: 1rem;
  }

  .legal-content {
    padding: 1.5rem;
  }

  .legal-content h1 {
    font-size: 2rem;
  }

  .legal-content h2 {
    font-size: 1.5rem;
  }

  .legal-actions {
    flex-direction: column;
  }

  .legal-actions .btn-primary,
  .legal-actions .btn-secondary {
    width: 100%;
    text-align: center;
  }

  .cookie-consent-modal {
    width: 95%;
  }

  .cookie-consent-footer {
    flex-direction: column;
  }

  .cookie-consent-footer button {
    width: 100%;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

/* Activity Log Styles */
.filter-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.multi-select {
  height: 120px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text-primary);
}

.multi-select option {
  padding: 0.5rem;
  margin: 0.25rem 0;
  border-radius: 4px;
}

.multi-select option:checked {
  background: var(--primary);
  color: white;
}

.export-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.weekly-table {
  font-size: 0.875rem;
}

.weekly-table th {
  text-align: center;
  padding: 0.5rem;
  background: var(--bg-secondary);
}

.weekly-table td {
  text-align: center;
  padding: 0.5rem;
}

.weekly-table td:first-child {
  text-align: left;
  font-weight: 600;
}

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

/* Hamburger button - hidden on desktop */
.hamburger-btn {
  display: none;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 4px;
  color: white;
  font-size: 1.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  margin-right: 0.5rem;
  z-index: 250;
  position: relative;
}

.hamburger-btn:hover,
.hamburger-btn:active {
  background: rgba(255,255,255,0.2);
}

/* Sidebar overlay - hidden by default */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
}

.sidebar-overlay.active {
  display: block;
}

/* Tablet breakpoint - 768px */
@media (max-width: 768px) {
  /* Show hamburger button */
  .hamburger-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Sidebar becomes slide-out drawer */
  .left-sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 260px !important;
    height: 100vh !important;
    z-index: 200 !important;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    padding-top: 60px !important;
    background: var(--card-bg) !important;
    border-right: 1px solid var(--border) !important;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
  }

  .left-sidebar.open {
    transform: translateX(0) !important;
  }

  /* Main content takes full width */
  .main-content {
    width: 100% !important;
    padding: 1rem !important;
    margin-left: 0 !important;
  }

  .app-layout {
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
  }

  /* Navbar adjustments */
  .navbar {
    padding: 0.5rem 0;
  }

  .nav-content {
    padding: 0 0.5rem;
    width: 100%;
    max-width: 100%;
    gap: 0.5rem;
  }

  .nav-content h2 {
    font-size: 1.1rem;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-content h2 img {
    height: 24px;
    margin-right: 4px;
  }

  .nav-right {
    gap: 0.25rem;
    flex-shrink: 0;
  }

  /* Hide non-essential navbar items on mobile */
  .nav-right .btn-secondary:not([href="/logout"]):not(.logout-btn):not(.language-switcher) {
    display: none;
  }

  /* Hide welcome text on mobile */
  .nav-right > span:not(.theme-switcher):not(.language-switcher),
  .nav-right > a[href="/settings"] {
    display: none;
  }

  /* Keep essential buttons visible */
  .nav-right .theme-switcher,
  .nav-right .language-switcher,
  .nav-right .logout-btn,
  .nav-right [href="/logout"] {
    display: inline-flex;
  }

  /* Compact buttons on mobile */
  .nav-right .btn-secondary,
  .nav-right .language-switcher {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    min-width: unset;
  }

  /* Sidebar nav links - larger touch targets */
  .left-sidebar nav a {
    padding: 1rem;
    min-height: 48px;
  }

  /* Stats grid single column */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* Tables scroll horizontally */
  .table-container {
    overflow-x: auto;
  }

  /* Cards full width */
  .card {
    margin: 0 0 1rem 0;
  }

  /* Form layouts */
  .form-row {
    grid-template-columns: 1fr;
  }

  /* Dashboard and section full width */
  .dashboard,
  .section {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  /* Deck grid single column */
  .deck-grid {
    grid-template-columns: 1fr !important;
  }

  /* Container full width */
  .container {
    padding: 1rem;
    max-width: 100%;
  }

  /* Quiz results grid - stack on mobile */
  #quiz-results [style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  /* Quiz result stat boxes smaller padding */
  #quiz-results [style*="background: var(--bg-secondary)"] {
    padding: 1rem !important;
  }

  /* Quiz input larger touch target */
  #quiz-form input[type="text"] {
    font-size: 1rem;
    padding: 0.875rem;
  }
}

/* Small phone breakpoint - 480px */
@media (max-width: 480px) {
  /* Mobile content padding - enough space but not too much */
  .main-content {
    padding: 1rem 0.75rem;
  }

  /* Card/box padding for small screens */
  .gradient-box, .card, .section {
    padding: 0.875rem;
    margin-bottom: 0.875rem;
    margin-left: 0;
    margin-right: 0;
    border-radius: 8px;
  }

  /* Grid gaps for mobile */
  .deck-grid,
  .stats-grid,
  .gamification-grid {
    gap: 0.75rem;
  }

  /* Container width fixes */
  .container {
    padding: 0.75rem;
    width: 100%;
    max-width: 100%;
  }

  .contentWrapper {
    width: 100%;
    margin: 0;
    padding: 0 0.5rem;
  }

  /* Stat cards */
  .stat-card {
    padding: 0.875rem;
  }

  /* Navbar - hide text, show only logo */
  .nav-content h2 {
    font-size: 0;
  }

  .nav-content h2 img {
    height: 28px;
  }

  /* Compact buttons */
  .nav-right .btn-secondary,
  .nav-right .language-switcher {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
  }

  .nav-right .theme-switcher {
    padding: 0.35rem;
  }

  /* Compact logout button on small screens */
  .nav-right .logout-btn {
    padding: 0.35rem !important;
    min-width: unset !important;
  }

  .nav-right .logout-btn svg {
    width: 1.1rem;
    height: 1.1rem;
  }

  /* Hamburger smaller */
  .hamburger-btn {
    padding: 0.35rem 0.5rem;
    font-size: 1.1rem;
  }

  /* Practice card adjustments */
  .practice-card {
    padding: 1.5rem 1rem;
  }

  .card-content {
    font-size: 1.25rem;
  }

  /* 2x2 difficulty button grid */
  .difficulty-buttons {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .btn-difficulty {
    min-height: 48px;
    min-width: unset;
    max-width: unset;
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }

  /* Hide keyboard hints on touch devices */
  .keyboard-hint {
    display: none !important;
  }

  /* Practice viewport - fixed on mobile but allow vertical scroll */
  .practice-viewport {
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    overflow-y: auto; /* Allow scrolling if content is too tall */
    overflow-x: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
  }

  body:has(.practice-viewport) {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  /* Make card container smaller on mobile portrait to fit buttons */
  .practice-card-container {
    flex: 1;
    min-height: 0; /* Allow shrinking */
    padding: 1rem;
  }

  /* Smaller mobile card */
  .mobile-card {
    padding: 1rem;
  }

  .mobile-card .card-content {
    font-size: 1.2rem;
  }

  /* Compact practice buttons for portrait */
  .practice-buttons {
    padding: 0.75rem;
    gap: 0.4rem;
    flex-shrink: 0; /* Don't let buttons shrink */
  }

  .btn-difficulty {
    padding: 0.6rem 0.5rem;
    min-width: 70px;
  }

  /* Touch-friendly hints - tap to reveal (keep icon visible, text hidden until tapped) */
  .card-hint-wrapper .hint-text {
    display: none;
    font-size: 0.875rem;
  }

  .card-hint-wrapper .hint-icon {
    display: inline-block;
    cursor: pointer;
  }

  .card-hint-wrapper.active .hint-text {
    display: block;
  }

  .card-hint-wrapper.active .hint-icon {
    display: none;
  }

  /* Stat cards smaller */
  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.75rem;
  }

  /* Section headers */
  .section h1 {
    font-size: 1.5rem;
  }

  .section h2 {
    font-size: 1.25rem;
  }
}

/* Portrait orientation fix - ensure buttons stay visible */
@media (max-width: 768px) and (orientation: portrait) {
  .practice-viewport {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    height: 100vh;
  }

  .practice-header {
    flex-shrink: 0;
  }

  .practice-card-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .practice-card {
    max-height: calc(100dvh - 200px); /* Leave room for header and buttons */
    max-height: calc(100vh - 200px);
    overflow-y: auto;
  }

  .practice-buttons {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: var(--bg-primary, white);
    z-index: 10;
  }

  /* Hide circular progress on very small portrait screens to save space */
  #circularProgress {
    width: 45px !important;
    height: 45px !important;
  }

  #circularProgress svg {
    width: 45px !important;
    height: 45px !important;
  }

  #cardsRemainingNumber {
    font-size: 1rem !important;
  }
}

/* Extra small phones - 360px */
@media (max-width: 360px) {
  .practice-card {
    padding: 1rem 0.75rem;
  }

  .card-content {
    font-size: 1.1rem;
  }

  .btn-difficulty {
    padding: 0.5rem;
    font-size: 0.8rem;
  }

  .left-sidebar {
    width: 100%;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .btn, button {
    min-height: 44px;
  }

  /* Hide keyboard hints on touch devices */
  .keyboard-hint,
  .btn-shortcut,
  .shortcut-key {
    display: none !important;
  }

  /* Hints: tap to reveal instead of hover */
  .card-hint-wrapper .hint-icon {
    cursor: pointer;
  }

  .card-hint-wrapper.active .hint-text {
    display: block;
  }

  .card-hint-wrapper.active .hint-icon {
    display: none;
  }

  /* Remove hover effects that don't work on touch */
  .left-sidebar nav a:hover {
    background: transparent;
  }

  .left-sidebar nav a:active {
    background: var(--bg-secondary);
  }
}

/* App Mode: Deck cards inside sections should not have separate card styling */
.dashboard .section .deck-grid .deck-card {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 1rem 0 !important;
  border-bottom: 1px solid var(--border) !important;
}

.dashboard .section .deck-grid .deck-card:last-child {
  border-bottom: none !important;
}

/* ============================================
   BOTTOM NAVIGATION BAR - Mobile Only
   ============================================ */
.bottom-nav {
  display: none; /* Hidden by default (desktop) */
}

@media (max-width: 768px) {
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height, 3.5rem);
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  /* Hide left sidebar on mobile when bottom nav exists */
  .app-layout .left-sidebar {
    display: none !important;
  }

  /* Adjust main content padding for bottom nav */
  .app-layout .main-content {
    padding-bottom: calc(var(--bottom-nav-height, 3.5rem) + 1rem) !important;
  }
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.5rem;
  min-width: 3.5rem;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-nav a:hover {
  background: var(--bg-secondary);
}

.bottom-nav a.active {
  color: var(--primary);
}

.bottom-nav a.active svg {
  transform: scale(1.1);
}

.bottom-nav a svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

/* ===========================================
   Online Students Widget
   =========================================== */
.online-students-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.online-students-section .section-header h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.125rem;
}

.online-indicator {
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.9); }
}

.online-count {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.online-students-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.online-student-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  transition: background 0.2s, border-color 0.2s;
  border: 2px solid transparent;
}

.online-student-item.practicing {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.student-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-practicing {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.status-online {
  background: #60a5fa;
}

.student-info {
  flex: 1;
  min-width: 0;
}

.student-name {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-class {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.student-activity {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.activity-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.activity-badge.practicing {
  background: #22c55e;
  color: white;
}

.activity-badge.browsing {
  background: var(--border);
  color: var(--text-secondary);
}

.duration {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Accessibility: Respect reduced motion preference */
@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;
  }
}

/* ============================================
   Custom Modal System
   ============================================ */

.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 1rem;
}

.custom-modal-overlay.modal-visible {
  opacity: 1;
}

.custom-modal-overlay.modal-closing {
  opacity: 0;
}

.custom-modal {
  background: var(--bg-primary);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  width: 100%;
  padding: 1.5rem;
  position: relative;
  transform: scale(0.9) translateY(-20px);
  transition: transform 0.2s ease;
}

.modal-visible .custom-modal {
  transform: scale(1) translateY(0);
}

.modal-closing .custom-modal {
  transform: scale(0.9) translateY(-20px);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

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

.modal-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.modal-icon svg {
  width: 48px;
  height: 48px;
}

.modal-icon-warning {
  color: #f59e0b;
}

.modal-icon-error {
  color: #ef4444;
}

.modal-icon-success {
  color: #10b981;
}

.modal-icon-info {
  color: #3b82f6;
}

.modal-title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.modal-message {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
  white-space: pre-line;
}

.modal-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 1.25rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.modal-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}

.modal-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.modal-buttons .btn {
  min-width: 100px;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
}

/* Modal with list items (for class selection) */
.modal-list {
  text-align: left;
  margin: 0.75rem 0 1.25rem;
  padding-left: 1.5rem;
}

.modal-list li {
  color: var(--text-secondary);
  padding: 0.25rem 0;
}

/* Stacked buttons variant for custom modals */
.modal-buttons-stacked {
  flex-direction: column;
}

.modal-buttons-stacked .btn {
  width: 100%;
}

/* Dark mode adjustments */
[data-theme="dark"] .custom-modal {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .custom-modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

/* Mobile responsive */
@media (max-width: 480px) {
  .custom-modal {
    padding: 1.25rem;
    margin: 0.5rem;
  }

  .modal-buttons {
    flex-direction: column;
  }

  .modal-buttons .btn {
    width: 100%;
  }
}
