﻿/* ==========================================================================
   GRAMMAR MASTER - DESIGN SYSTEM & CORE STYLES
   Autor: Rubén Muñoz Valadés - Docente de Formación Profesional para el Empleo
   ========================================================================== */

:root {
  /* Brand Color Palette (Rubén Muñoz Identity: Crimson / Burgundy / Slate) */
  --primary: #991b1b;
  --primary-hover: #b91c1c;
  --primary-light: #fef2f2;
  --primary-glow: rgba(153, 27, 27, 0.15);
  --secondary: #1e293b;
  --accent: #d97706;
  --accent-light: #fef3c7;
  
  /* UI Surface Colors (Light Mode Default) */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #f1f5f9;
  --bg-input: #f8fafc;
  
  /* Text & Typography */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-inverse: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  
  /* Semantic Status Colors */
  --success: #15803d;
  --success-bg: #dcfce7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --info: #1d4ed8;
  --info-bg: #dbeafe;
  
  /* Sizing & Radius */
  --sidebar-width: 320px;
  --header-height: 72px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Font Family & Base Size */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-base: 16px;
  --line-height-base: 1.6;
}

/* Dark Mode Theme */
[data-theme="dark"] {
  --primary: #ef4444;
  --primary-hover: #f87171;
  --primary-light: #450a0a;
  --primary-glow: rgba(239, 68, 68, 0.2);
  --secondary: #0f172a;
  --accent: #f59e0b;
  --accent-light: #451a03;
  
  --bg-app: #090d16;
  --bg-surface: #0f172a;
  --bg-card: #131d31;
  --bg-elevated: #1e293b;
  --bg-input: #1e293b;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  --border: #1e293b;
  --border-strong: #334155;
  
  --success: #22c55e;
  --success-bg: #052e16;
  --danger: #ef4444;
  --danger-bg: #450a0a;
  --warning: #f59e0b;
  --warning-bg: #451a03;
  --info: #38bdf8;
  --info-bg: #082f49;
  
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Font Size Modifiers */
[data-font-size="large"] {
  --font-base: 18px;
}
[data-font-size="xlarge"] {
  --font-base: 20px;
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: var(--line-height-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-left-cluster {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-btn {
  display: none;
  font-size: 1.5rem;
  color: var(--text-main);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.brand-logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-main-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.brand-sub-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-search-bar {
  flex: 1;
  max-width: 420px;
  margin: 0 1.5rem;
  position: relative;
}

.search-input-field {
  width: 100%;
  padding: 0.6rem 2.5rem 0.6rem 1rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-main);
  transition: var(--transition);
}

.search-input-field:focus {
  border-color: var(--primary);
  background-color: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-shortcut-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  pointer-events: none;
}

.header-tools-cluster {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}

.header-action-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* App Main Layout Structure */
.app-layout-body {
  display: flex;
  flex: 1;
  position: relative;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform 0.3s ease;
}

.sidebar-nav-container {
  padding: 1.25rem 0.75rem;
}

.sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  padding: 0.75rem 0.75rem 0.35rem;
  margin-top: 0.5rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  transition: var(--transition);
  margin-bottom: 2px;
}

.sidebar-link:hover, .active-nav-item {
  background-color: var(--primary-light);
  color: var(--primary);
}

.sidebar-level-group {
  margin-bottom: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-surface);
}

.sidebar-level-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg-elevated);
  cursor: pointer;
  user-select: none;
}

.level-pill {
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.level-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 700;
}

.level-progress-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.level-chevron {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.level-collapsed .sidebar-level-body {
  display: none;
}
.level-collapsed .level-chevron {
  transform: rotate(-90deg);
}

.sidebar-unit-group {
  padding: 0.4rem 0.5rem;
  border-top: 1px solid var(--border);
}

.unit-title-bar {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
}

.unit-lessons-list {
  list-style: none;
}

.nav-lesson-item {
  margin: 1px 0;
}

.nav-subitem-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-main);
  transition: var(--transition);
}

.nav-subitem-link:hover, .nav-subitem-link.active-nav-item {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.lesson-status-icon {
  font-size: 0.8rem;
  width: 16px;
  text-align: center;
  color: var(--success);
}

.lesson-code-tag {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-elevated);
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.lesson-nav-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* ==========================================================================
   MAIN CONTENT VIEW & COMPONENT CARDS (PART 2)
   ========================================================================== */

.app-main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Dashboard View */
.dashboard-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dashboard-hero-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: flex;
  gap: 2rem;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.dashboard-hero-card::after {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: var(--primary-glow);
  border-radius: 50%;
  pointer-events: none;
}

.hero-text-content {
  flex: 1;
}

.author-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.author-avatar-chip {
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.hero-description {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 650px;
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--primary);
  color: #fff;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px var(--primary-glow);
  transition: var(--transition);
}

.btn-primary-action:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--primary-glow);
}

.btn-secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition);
}

.btn-secondary-action:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.hero-stats-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-width: 200px;
}

.overall-progress-circle-box {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 6px solid var(--primary);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.progress-number {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
}

.progress-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.hero-mini-stats {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.stats-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-card-icon {
  font-size: 1.75rem;
}

.stat-card-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
}

.stat-card-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.srs-reminder-banner {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.srs-reminder-icon {
  font-size: 2rem;
}

.srs-reminder-info {
  flex: 1;
}

.srs-reminder-info h4 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
}

.btn-srs-action {
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
}

.section-heading {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 1rem;
}

.levels-roadmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.level-roadmap-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: var(--transition);
}

.level-roadmap-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.level-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 0.75rem;
}

.level-badge {
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 3px 8px;
  border-radius: 4px;
}

.level-cefr-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 0.35rem;
}

.level-percentage {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.level-card-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.level-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
}

.level-progress-bar-container {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 0.5rem 0;
}

.level-progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.level-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.level-start-link {
  color: var(--primary);
}

.labs-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.lab-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: var(--transition);
}

.lab-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.lab-icon {
  font-size: 2rem;
}

.lab-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
}

.lab-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}
/* ==========================================================================
   LESSON COMPONENTS, DRILLS, FLASHCARDS & EXERCISES (PART 3)
   ========================================================================== */

.lesson-view-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.lesson-breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lesson-breadcrumbs a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.active-crumb {
  color: var(--text-main);
  font-weight: 700;
}

.lesson-hero-header {
  border-bottom: 2px solid var(--border);
  padding-bottom: 1.5rem;
}

.lesson-tags-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.lesson-level-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}

.lesson-code-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.completed-pill {
  background: var(--success-bg);
  color: var(--success);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}

.lesson-main-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.lesson-main-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Didactic Blocks Common Design */
.didactic-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.block-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.block-icon {
  font-size: 1.6rem;
}

.block-header h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.sub-block-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 1rem;
}

.section-helper-text {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Objectives */
.objectives-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.objectives-list li {
  position: relative;
  padding-left: 1.75rem;
  font-size: 1rem;
}

.objectives-list li::before {
  content: "🎯";
  position: absolute;
  left: 0;
  font-size: 0.9rem;
}

/* Tables */
.table-responsive-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.grammar-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.grammar-table th {
  background: var(--bg-elevated);
  padding: 0.85rem 1rem;
  font-weight: 800;
  color: var(--text-main);
  border-bottom: 2px solid var(--border);
}

.grammar-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.grammar-table tr:hover td {
  background: var(--bg-elevated);
}

.highlight-code {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.highlight-code-neg {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* Phonetics & Mistakes Boxes */
.phonetics-box {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid var(--border);
}

.phonetics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.phonetic-card {
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.phonetic-card h5 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
}

.ipa-pill {
  font-family: monospace;
  font-size: 0.85rem;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  width: fit-content;
  margin-top: 0.25rem;
}

.mistakes-warning-box {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.mistakes-warning-box .block-header h4 {
  color: var(--danger);
  font-weight: 800;
}

.mistakes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.mistake-item {
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.mistake-comparison {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.wrong-pill {
  background: #fee2e2;
  color: #991b1b;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  text-decoration: line-through;
}

.right-pill {
  background: #dcfce7;
  color: #15803d;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 800;
}

.arrow-sep {
  font-weight: 800;
  color: var(--text-muted);
}

/* Examples Grid */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.example-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: var(--transition);
}

.example-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.example-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.example-tag {
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--primary);
}

.example-number {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
}

.example-en-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 1.05rem;
}

.example-es-line {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Audio Buttons */
.audio-play-btn, .mini-audio-btn, .card-audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  transition: var(--transition);
}

.audio-play-btn:hover, .mini-audio-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.05);
}

.speaking {
  animation: pulse-glow 1s infinite alternate;
}

@keyframes pulse-glow {
  from { box-shadow: 0 0 0 0 rgba(153, 27, 27, 0.4); }
  to { box-shadow: 0 0 0 8px rgba(153, 27, 27, 0); }
}

/* Dialogue & Story */
.dialogue-lines-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.dialogue-line-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.speaker-tag {
  min-width: 80px;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  text-align: center;
}

.dialogue-speech-box {
  background: var(--bg-elevated);
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  flex: 1;
}

.story-content-box {
  background: var(--bg-elevated);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.story-english-text {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.btn-toggle-translation {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: underline;
  margin-bottom: 0.5rem;
}

.story-spanish-text {
  display: none;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.5rem;
}

.visible-text {
  display: block;
}

.story-q-item {
  background: var(--bg-elevated);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
}

.story-opt-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin: 0.35rem 0.35rem 0.35rem 0;
  transition: var(--transition);
}

.story-opt-btn:hover {
  border-color: var(--primary);
}

/* Drills */
.drills-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.drill-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.drill-header h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}

.drill-instruction {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.drill-item-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-drill-repeat {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-completed {
  background: var(--success);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-reveal-solution {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
}

.drill-solution-popup {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--success-bg);
  color: var(--success);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
}

/* Flashcards 3D Card Flip */
.flashcards-deck-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  perspective: 1000px;
}

.flashcard-card {
  width: 100%;
  max-width: 500px;
  min-height: 250px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.flashcard-card.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.card-front {
  background: var(--bg-card);
}

.card-back {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
  transform: rotateY(180deg);
  border-color: var(--primary);
}

.card-side-indicator {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.card-main-text {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--text-main);
  margin: 1rem 0;
}

.card-tap-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-example-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.flashcard-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.fc-buttons-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-fc-rate {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  transition: var(--transition);
}

.rate-1 { background: #dc2626; }
.rate-2 { background: #ea580c; }
.rate-3 { background: #2563eb; }
.rate-4 { background: #16a34a; }
.btn-fc-rate:hover { transform: translateY(-2px); filter: brightness(1.1); }

/* Exercises */
.exercise-widget-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.exercise-widget-card h4 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.ex-prompt {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.mc-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.mc-option-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-weight: 600;
  text-align: left;
  transition: var(--transition);
}

.mc-option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.mc-option-btn.correct, .story-opt-btn.correct, .btn-micro-quiz.correct {
  background: #dcfce7 !important;
  color: #15803d !important;
  border-color: #15803d !important;
  font-weight: 800;
}

.mc-option-btn.incorrect, .story-opt-btn.incorrect, .btn-micro-quiz.incorrect {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border-color: #991b1b !important;
}

.fib-input, .text-exercise-input, .gym-input {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  color: var(--text-main);
  font-weight: 600;
}

.input-correct {
  border-color: var(--success) !important;
  background-color: var(--success-bg) !important;
}

.input-incorrect {
  border-color: var(--danger) !important;
  background-color: var(--danger-bg) !important;
}

.btn-check-input {
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
}

.exercise-feedback {
  margin-top: 0.6rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.feedback-correct {
  background: var(--success-bg);
  border: 1px solid var(--success);
  color: var(--success);
}

.feedback-incorrect {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: var(--danger);
}

/* Word Scramble Interactive */
.word-target {
  min-height: 50px;
  background: var(--bg-card);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.word-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.word-chip {
  background: var(--bg-card);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.word-chip:hover {
  background: var(--primary);
  color: #fff;
}

.chip-placed {
  background: var(--primary);
  color: #fff;
}

/* Master Test */
.test-question-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.test-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.test-option-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
}

.test-option-label:hover {
  border-color: var(--primary);
}

.btn-submit-test {
  width: 100%;
  background: var(--primary);
  color: #fff;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.test-result-modal-box {
  background: var(--bg-card);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  margin-top: 1.5rem;
}

.score-display {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--primary);
  margin: 0.75rem 0;
}

.btn-mark-completed {
  background: var(--success);
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  padding: 1rem 2rem;
  border-radius: var(--radius-md);
  width: 100%;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.2);
}

.btn-completed-active {
  background: var(--secondary);
}

.lesson-nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-nav-prev, .btn-nav-next, .btn-nav-gym, .btn-nav-speed {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
}

.btn-nav-next {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Labs, Gym & Search Modal */
.gym-rounds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.gym-round-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 1rem;
}

.search-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 650px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.search-results-list {
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-result-item {
  background: var(--bg-elevated);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.search-result-item:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}

/* Study Mode Distraction-Free Layout */
body.study-mode-active .app-sidebar {
  display: none !important;
}

body.study-mode-active .app-main-content {
  max-width: 900px;
  margin: 0 auto;
  font-size: 1.15rem;
}

/* Footer */
.app-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: auto;
}

.footer-author-text {
  font-weight: 800;
  color: var(--primary);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
