/* ==========================================================================
   Edexcel IGCSE French (4FR1) Grammar Studio & iPad App
   French Tricolore & Parisian Gold Dark Mode Design System
   Native iPadOS 2-Pane Split View Architecture
   ========================================================================== */

:root {
  --bg-main: #090d16;
  --bg-panel: #0f172a;
  --bg-card: #131c31;
  --bg-card-hover: #1b2640;
  --bg-card-alt: #162038;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(59, 130, 246, 0.35);
  --border-gold: rgba(245, 158, 11, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* French Tricolore & Royal Gold Palette */
  --french-blue: #2563eb;
  --french-blue-light: #60a5fa;
  --french-blue-dark: #1d4ed8;
  --french-red: #e11d48;
  --french-red-light: #fb7185;
  --gold-primary: #f59e0b;
  --gold-light: #fde047;
  --gold-dark: #b45309;
  
  --accent-emerald: #10b981;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.6);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  touch-action: manipulation;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', -apple-system, sans-serif;
  letter-spacing: -0.02em;
}

.mono-font {
  font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   iPadOS Navigation Bar
   ========================================================================== */
.ipad-navbar {
  height: 64px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 20px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.sidebar-toggle-btn.active {
  background: rgba(37, 99, 235, 0.2);
  border-color: var(--french-blue-light);
  color: #ffffff;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(225, 29, 72, 0.25));
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
}

.header-brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.header-brand h1 span {
  color: var(--french-blue-light);
}

.syllabus-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.navbar-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-pill.success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.stat-pill.progress-pill {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--gold-light);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Base Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5);
}

.btn-trainer {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.35));
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
}

.btn-trainer:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.4), rgba(217, 119, 6, 0.5));
  color: #ffffff;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* ==========================================================================
   NATIVE IPADOS 2-PANE APP LAYOUT
   ========================================================================== */
.ipad-app-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  width: 100%;
  height: calc(100vh - 64px);
  height: calc(100dvh - 64px);
  overflow: hidden;
  transition: grid-template-columns 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ipad-app-layout.sidebar-collapsed {
  grid-template-columns: 0px 1fr;
}

.ipad-sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  transition: opacity 0.2s ease;
  padding-left: env(safe-area-inset-left);
}

.ipad-app-layout.sidebar-collapsed .ipad-sidebar {
  opacity: 0;
  pointer-events: none;
}

.col-header {
  height: 52px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.col-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-title .icon {
  font-size: 1.1rem;
}

.col-title h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border-radius: 9999px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.spec-code-badge {
  background: rgba(37, 99, 235, 0.2);
  color: var(--french-blue-light);
  border: 1px solid rgba(37, 99, 235, 0.4);
}

/* Left Sidebar Search & Filter Tabs */
.spec-search-box {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.spec-search-box input {
  width: 100%;
  min-height: 42px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: #ffffff;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
}

.spec-search-box input:focus {
  border-color: var(--french-blue-light);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--french-blue);
  color: #ffffff;
  border-color: var(--french-blue-light);
}

/* Sidebar Topics List */
.spec-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.module-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 10px 4px 10px;
}

.topic-list-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topic-list-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.topic-list-item.active {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.4);
}

.topic-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.topic-item-code {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--french-blue-light);
  font-family: 'JetBrains Mono', monospace;
}

.topic-item-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.topic-item-badge.productive {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

.topic-item-badge.receptive {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
}

.topic-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.topic-item-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   RIGHT MAIN STAGE: Detailed French Tables & Rules
   ========================================================================== */
.ipad-main-stage {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-main);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

.ipad-main-stage .col-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spec-detail-body {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Examiner Trap Box */
.trap-alert-box {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.12), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(225, 29, 72, 0.45);
  border-left: 4px solid var(--french-red);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.trap-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.trap-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--french-red-light);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.trap-content p {
  font-size: 0.88rem;
  color: #f1f5f9;
  line-height: 1.55;
}

/* Key Rules & Formula Card */
.rules-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.rules-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.rules-card-header h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.rule-item .rule-num {
  background: rgba(37, 99, 235, 0.2);
  color: var(--french-blue-light);
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 9999px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.formula-highlight-bar {
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.formula-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--gold-light);
}

/* ==========================================================================
   Paradigm Tables with Bold Endings & Translations
   ========================================================================== */
.paradigm-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.paradigm-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.paradigm-header {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.paradigm-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.table-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.grammar-table th {
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
}

.grammar-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  vertical-align: middle;
}

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

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

/* Ending Highlight & Translation styling */
.ending-highlight {
  font-weight: 800;
  color: var(--french-blue-light);
  background: rgba(37, 99, 235, 0.15);
  padding: 1px 4px;
  border-radius: 4px;
}

.ending-highlight-gold {
  font-weight: 800;
  color: var(--gold-light);
  background: rgba(245, 158, 11, 0.15);
  padding: 1px 4px;
  border-radius: 4px;
}

.ending-highlight-red {
  font-weight: 800;
  color: var(--french-red-light);
  background: rgba(225, 29, 72, 0.15);
  padding: 1px 4px;
  border-radius: 4px;
}

.inline-trans {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  margin-left: 6px;
}

/* ==========================================================================
   Topic Flashcards Section
   ========================================================================== */
.topic-cards-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-header h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.flashcards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.inline-flashcard {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
  position: relative;
}

.inline-flashcard:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: var(--bg-card-hover);
}

.inline-flashcard.is-mastered {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.05), var(--bg-card));
}

.flashcard-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flashcard-term {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.4;
}

.flashcard-answer-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.5;
  white-space: pre-line;
}

.flashcard-formula-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--gold-light);
  background: rgba(245, 158, 11, 0.12);
  padding: 3px 8px;
  border-radius: 4px;
  align-self: flex-start;
}

.flashcard-example {
  font-size: 0.8rem;
  color: #94a3b8;
  font-style: italic;
  border-left: 2px solid var(--french-blue);
  padding-left: 8px;
}

.flashcard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-tts {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.btn-tts:hover {
  color: var(--french-blue-light);
  background: rgba(255, 255, 255, 0.06);
}

.mastery-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* ==========================================================================
   MODALS: Speed Drill, Trainer, Export
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.trainer-modal-card {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-box {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.trainer-header, .modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.trainer-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trainer-counter {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s ease;
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.trainer-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.trainer-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--french-blue), var(--gold-primary));
  width: 0%;
  transition: width 0.25s ease;
}

/* 3D Flashcard in Trainer */
.trainer-card-area {
  padding: 24px 20px;
  perspective: 1000px;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.flashcard-3d {
  width: 100%;
  height: 260px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-front {
  background: linear-gradient(145deg, #131d33, #0d1424);
  border: 1px solid var(--border-highlight);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.card-back {
  background: linear-gradient(145deg, #16223b, #0e172a);
  border: 1px solid rgba(245, 158, 11, 0.4);
  transform: rotateY(180deg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.card-face-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-prompt-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--french-blue-light);
}

.card-answer-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-light);
}

.card-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.card-prompt-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.45;
  text-align: center;
  margin: auto 0;
}

.card-answer-content {
  font-size: 0.95rem;
  color: #e2e8f0;
  line-height: 1.55;
  white-space: pre-line;
  margin: auto 0;
}

.card-front-footer {
  text-align: center;
}

.card-tap-indicator {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.trainer-actions {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.keyboard-hints {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.action-btn-group {
  display: flex;
  gap: 10px;
}

.action-btn-group button {
  flex: 1;
}

.btn-learning {
  background: rgba(225, 29, 72, 0.2);
  border: 1px solid rgba(225, 29, 72, 0.4);
  color: var(--french-red-light);
}

.btn-learning:hover {
  background: rgba(225, 29, 72, 0.35);
}

.btn-flip-cta {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.btn-flip-cta:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-mastered {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.btn-mastered:hover {
  background: rgba(16, 185, 129, 0.35);
}

/* ==========================================================================
   Speed Drill Modal
   ========================================================================== */
.drill-card-area {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.drill-sub-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.drill-word-display {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 16px 28px;
  width: 100%;
  letter-spacing: 0.04em;
}

.drill-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin-top: 6px;
}

.drill-opt-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 14px 16px;
  min-height: 52px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drill-opt-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.drill-opt-btn.correct {
  background: rgba(16, 185, 129, 0.35) !important;
  border-color: #10b981 !important;
  color: #6ee7b7 !important;
}

.drill-opt-btn.wrong {
  background: rgba(225, 29, 72, 0.35) !important;
  border-color: #e11d48 !important;
  color: #fb7185 !important;
}

/* ==========================================================================
   Export TSV Modal
   ========================================================================== */
.modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.export-options {
  display: flex;
  gap: 8px;
}

.export-options .btn.active {
  background: var(--french-blue);
  color: #ffffff;
  border-color: var(--french-blue-light);
}

.export-textarea {
  width: 100%;
  height: 180px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  resize: none;
  outline: none;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 820px) {
  .ipad-app-layout {
    grid-template-columns: 280px 1fr;
  }
  .navbar-center {
    display: none;
  }
}

@media (max-width: 640px) {
  .ipad-app-layout {
    grid-template-columns: 100%;
  }
  .ipad-app-layout.sidebar-collapsed {
    grid-template-columns: 100%;
  }
  .ipad-sidebar {
    position: absolute;
    top: 64px;
    bottom: 0;
    left: 0;
    width: 320px;
    z-index: 90;
    box-shadow: var(--shadow-lg);
  }
}
