:root {
  --primary: #d9532f; /* Arizona Terracotta */
  --primary-hover: #bd4322;
  --primary-light: #fdf2ee;
  --secondary: #0d9488; /* Desert Turquoise */
  --secondary-light: #f0fdfa;
  --accent-gold: #f59e0b;
  --accent-gold-light: #fffbeb;
  --success: #10b981;
  --success-light: #ecfdf5;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-elevated: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #94a3b8;
  
  --border: #e2e8f0;
  --border-focus: #cbd5e1;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.09);
  --shadow-coach: 0 8px 30px rgba(217, 83, 47, 0.15);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.25;
}

/* ========================================================
   HEADER & NAVIGATION
======================================================== */
.app-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-badge {
  background: linear-gradient(135deg, var(--primary), #ea580c);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(217, 83, 47, 0.3);
}

.brand-title {
  font-size: 1.25rem;
  color: var(--text-main);
  font-weight: 800;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.progress-bar-btn {
  background: var(--secondary);
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
  transition: all 0.2s ease;
}

.progress-bar-btn:hover {
  background: #0f766e;
  transform: translateY(-1px);
}

/* ========================================================
   SLIDE-OUT PROGRESS DRAWER (Side Panel)
======================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  z-index: 90;
  transition: opacity 0.3s ease;
}

.progress-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 90vw;
  background: var(--bg-surface);
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
  z-index: 100;
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

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

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

.drawer-title-wrap h3 {
  font-size: 1.15rem;
  margin: 0;
}

.drawer-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex-grow: 1;
}

.drawer-bar-section {
  background: var(--bg-elevated);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.drawer-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.drawer-bar-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.drawer-bar-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--secondary);
}

.drawer-progress-container {
  height: 12px;
  background: var(--border);
  border-radius: 9999px;
  overflow: hidden;
}

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

/* Awesome Badge Target Card */
.drawer-badge-target {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 2px dashed #f59e0b;
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.drawer-badge-target.unlocked {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 2px solid #10b981;
}

.badge-target-icon {
  font-size: 2rem;
  line-height: 1;
}

.badge-target-info strong {
  display: block;
  font-size: 0.95rem;
  color: #92400e;
}

.drawer-badge-target.unlocked .badge-target-info strong {
  color: #065f46;
}

.badge-target-info p {
  font-size: 0.82rem;
  color: #78350f;
  margin: 0;
}

.drawer-history-section h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.drawer-module-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Callout on Welcome Page */
.awesome-badge-callout {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 2px solid #fbbf24;
  border-radius: 9999px;
  padding: 0.65rem 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.callout-badge-icon {
  font-size: 1.5rem;
}

.callout-badge-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: #92400e;
}

.callout-badge-text strong {
  color: #b45309;
}

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

.stat-pill {
  background: var(--bg-elevated);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-val {
  color: var(--primary);
  font-weight: 800;
}

.icon-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--border);
}

/* ========================================================
   MAIN CONTENT & VIEWS
======================================================== */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

/* ========================================================
   STUDY VIEW LAYOUT
======================================================== */
.study-layout {
  display: block;
  max-width: 780px;
  margin: 0 auto;
}

.study-layout.single-column {
  display: block;
  max-width: 780px;
  margin: 0 auto;
}

.arena-content.centered {
  max-width: 780px;
  margin: 0 auto;
}

/* Module Sidebar */
.sidebar-modules {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
}

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

.sidebar-header h3 {
  font-size: 1.05rem;
}

.badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
}

.module-list {
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.module-group-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  transition: border-color 0.2s;
}

.module-group-card.active {
  border-color: var(--primary);
}

.module-group-header {
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.module-group-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.module-group-lessons {
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lesson-item-btn {
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
  width: 100%;
}

.lesson-item-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
}

.lesson-item-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.lesson-status-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* Main Arena */
.arena-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.lesson-meta-bar {
  background: var(--bg-surface);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.meta-module-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lesson-heading {
  font-size: 1.5rem;
  color: var(--text-main);
  margin-top: 0.2rem;
}

.meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

.progress-bar-container {
  width: 160px;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 9999px;
  overflow: hidden;
}

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

.counter-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ========================================================
   CARDS: READING, QUESTION, COACH
======================================================== */
.study-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 1.75rem;
  position: relative;
  transition: all 0.25s ease;
}

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

/* Road Sign & Scenario Illustration */
.lesson-media-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  min-height: 140px;
}

.lesson-sign-img {
  max-height: 140px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.12));
  transition: transform 0.2s ease;
}

.lesson-sign-img:hover {
  transform: scale(1.03);
}

.badge-reading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-gold-light);
  color: #92400e;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid #fde68a;
}

.badge-question {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--secondary-light);
  color: #0f766e;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid #99f6e4;
}

.attempt-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
}

.reading-icon {
  font-size: 1.15rem;
}

.speak-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s;
}

.speak-btn:hover {
  background: var(--border);
}

.reading-title {
  font-size: 1.35rem;
  margin-bottom: 0.85rem;
  color: var(--text-main);
}

.reading-body {
  font-size: 1.02rem;
  color: #334155;
  margin-bottom: 1.25rem;
  white-space: pre-line;
  line-height: 1.7;
}

.key-rule-callout {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-left: 4px solid var(--accent-gold);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.why-matters-box {
  background: var(--secondary-light);
  border-left: 4px solid var(--secondary);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.callout-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.key-rule-callout strong,
.why-matters-box strong {
  display: block;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.2rem;
}

.key-rule-callout p,
.why-matters-box p {
  font-size: 0.95rem;
  font-weight: 500;
}

.card-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* ========================================================
   QUESTION CARD & OPTIONS
======================================================== */
.question-prompt {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.option-item {
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all 0.2s ease;
  user-select: none;
}

.option-item:hover:not(.disabled) {
  border-color: var(--primary);
  background: var(--bg-surface);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.option-letter {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.2s;
}

.option-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-main);
  flex-grow: 1;
  padding-top: 0.15rem;
}

/* Option States */
.option-item.correct {
  border-color: var(--success) !important;
  background: var(--success-light) !important;
}

.option-item.correct .option-letter {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.option-item.incorrect {
  border-color: var(--danger) !important;
  background: var(--danger-light) !important;
}

.option-item.incorrect .option-letter {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.option-item.disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

/* Result Banner */
.result-banner {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  animation: slideDown 0.3s ease;
}

.result-banner.success {
  background: var(--success-light);
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.result-banner.coach-needed {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.banner-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.banner-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.banner-text {
  font-size: 0.95rem;
}

/* ========================================================
   COACH DASH WORKSHOP (AI Mentor Panel)
======================================================== */
.coach-card {
  border: 2px solid var(--primary);
  background: linear-gradient(180deg, #ffffff, #fffcfb);
  box-shadow: var(--shadow-coach);
  animation: slideDown 0.35s ease;
}

.coach-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #fee2e2;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.coach-avatar-wrap {
  position: relative;
}

.coach-avatar {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #ea580c, #c2410c);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
}

.coach-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background: #22c55e;
  border: 2px solid #fff;
  border-radius: 9999px;
}

.coach-info {
  flex-grow: 1;
}

.coach-name-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.coach-name {
  font-size: 1.2rem;
  color: var(--text-main);
}

.engine-badge {
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid #fecaca;
}

.coach-role {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.coach-bubble {
  background: #fff5f2;
  border-left: 4px solid var(--primary);
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  color: #1e293b;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.coach-chat-history {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.chat-bubble {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  max-width: 85%;
}

.chat-bubble.student {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble.coach {
  align-self: flex-start;
  background: var(--bg-elevated);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

.coach-chat-input-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.coach-chat-input-row input {
  flex-grow: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.coach-chat-input-row input:focus {
  outline: none;
  border-color: var(--primary);
}

.coach-retry-action {
  background: #f8fafc;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.retry-hint-pill {
  font-size: 0.88rem;
  color: #334155;
}

/* ========================================================
   ARENA FOOTER NAVIGATION
======================================================== */
.arena-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
}

.lock-note {
  font-size: 0.85rem;
  color: #b91c1c;
  font-weight: 700;
  background: #fef2f2;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid #fecaca;
  animation: pulse 2s infinite;
}

/* ========================================================
   BUTTONS & CONTROLS
======================================================== */
.action-btn {
  border: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.action-btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(217, 83, 47, 0.25);
}

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

.action-btn.primary:disabled {
  background: var(--text-sub);
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.action-btn.secondary {
  background: var(--secondary);
  color: #fff;
}

.action-btn.secondary:hover {
  background: #0f766e;
}

.action-btn.outline {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
}

.action-btn.outline:hover {
  background: var(--bg-elevated);
}

.action-btn.danger {
  background: var(--danger);
  color: #fff;
}

.action-btn.large {
  padding: 0.85rem 1.85rem;
  font-size: 1.1rem;
}

.action-btn.text-only {
  background: transparent;
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
}

.action-btn.text-only:hover {
  color: var(--danger);
}

/* ========================================================
   EXAM SIMULATOR VIEW
======================================================== */
.exam-container {
  max-width: 800px;
  margin: 1.5rem auto;
}

.exam-intro-card,
.exam-active-card,
.exam-results-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 2.5rem;
  text-align: center;
}

.exam-rules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 2rem 0;
}

.rule-box {
  background: var(--bg-elevated);
  padding: 1.25rem;
  border-radius: var(--radius-md);
}

.rule-box .icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

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

.score-pill {
  font-size: 0.85rem;
  font-weight: 700;
  margin-left: 0.75rem;
  color: var(--text-muted);
}

.exam-result-header {
  margin-bottom: 2rem;
}

.result-big-icon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.exam-stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-elevated);
  padding: 1.25rem;
  border-radius: var(--radius-md);
}

.stat-card .label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.stat-card .val {
  font-size: 1.8rem;
  font-weight: 800;
}

.stat-card .val.pass {
  color: var(--success);
}

.stat-card .val.fail {
  color: var(--danger);
}

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

/* ========================================================
   ANALYTICS & PARENT DASHBOARD
======================================================== */
.analytics-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.metric-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.metric-val {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0.25rem 0;
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--text-sub);
}

.analytics-detail-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

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

.analytics-table th {
  background: var(--bg-elevated);
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.coach-log-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.coach-log-item {
  background: var(--bg-elevated);
  border-left: 4px solid var(--primary);
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.empty-log-note {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* ========================================================
   MODAL OVERLAY
======================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: zoomIn 0.2s ease;
}

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

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.form-group input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.form-group small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.status-box {
  background: var(--bg-elevated);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
}

.danger-zone {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.danger-zone h4 {
  color: var(--danger);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.danger-zone p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-elevated);
}

/* ========================================================
   UTILITY CLASSES & ANIMATIONS
======================================================== */
.hidden {
  display: none !important;
}

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

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ========================================================
   WELCOME HERO SCREEN (Zurelda's Clean Landing)
======================================================== */
.welcome-container {
  max-width: 800px;
  margin: 2.5rem auto;
  text-align: center;
}

.welcome-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3.5rem 2.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.welcome-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--secondary), var(--primary), #ea580c);
}

.welcome-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #ea580c, #c2410c);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.75rem;
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.3);
  margin-bottom: 1.25rem;
  animation: bounce 2s infinite;
}

.welcome-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 1rem;
}

.welcome-title {
  font-size: 2.1rem;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  max-width: 650px;
}

.welcome-desc {
  font-size: 1.15rem;
  color: #334155;
  line-height: 1.75;
  max-width: 640px;
  margin-bottom: 2.25rem;
}

.welcome-action-wrap {
  margin-bottom: 2.5rem;
}

.welcome-start-btn {
  font-size: 1.2rem;
  padding: 1.1rem 2.75rem;
  border-radius: 9999px;
  box-shadow: 0 6px 20px rgba(217, 83, 47, 0.35);
  transition: all 0.25s ease;
}

.welcome-start-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 28px rgba(217, 83, 47, 0.45);
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.feat-icon {
  font-size: 1.6rem;
}

/* Badge Modal */
.badge-modal-card {
  max-width: 440px;
  text-align: center;
  padding: 2.5rem 2rem;
}

.badge-big-icon {
  font-size: 4.5rem;
  margin-bottom: 0.75rem;
  animation: pulse 1.5s infinite;
}

.badge-unlocked-tag {
  background: var(--accent-gold-light);
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  display: inline-block;
  margin-bottom: 0.75rem;
  border: 1px solid #fde68a;
}

.badge-modal-body h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.badge-modal-body p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .study-layout {
    grid-template-columns: 1fr;
  }
  .sidebar-modules {
    max-height: 250px;
  }
  .analytics-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .welcome-features {
    grid-template-columns: repeat(2, 1fr);
  }
}

