/* ==============================================================
# Script: css/styles.css
# Purpose: Styling for FastAPI Interactive Tutorial Application (Two-Column Light Theme, Voice Narration & Interview Q&A Bank)
# Author: Praful Kumar
# Created On: 11/09/2026
#
# Modification History:
# - 11/09/2026 : Solved mobile viewport overflow at 375px/390px (compact responsive header, auto-expanding search, zero horizontal scroll).
# - 11/09/2026 : Engineered complete mobile-first responsiveness (two-row docked audio bar, zero-bleed header, touch targets, compact drawer).
#
# Reload / Change Triggers:
# - Reload Triggered 11 : 11/09/2026
# - Reload Triggered 10 : 11/09/2026
# - Reload Triggered 9 : 11/09/2026
# - Reload Triggered 8 : 11/09/2026
# - Reload Triggered 7 : 11/09/2026
# - Reload Triggered 6 : 11/09/2026
# - Reload Triggered 5 : 11/09/2026
# - Reload Triggered 4 : 11/09/2026
# - Reload Triggered 3 : 11/09/2026
# - Reload Triggered 2 : 11/09/2026
# - Reload Triggered 1 : 11/09/2026
#
# Notes:
# - Zero-dependency Vanilla CSS3 with modern CSS custom properties.
# ============================================================== */

:root {
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  
  /* User-Mandated Light Blue Header & Footer */
  --bg-header-footer: #e0f2fe;
  --border-header-footer: #bae6fd;
  --text-header-title: #0369a1;
  --text-header-sub: #0284c7;

  /* Typography & Core Accents */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --accent-primary: #0284c7;
  --accent-primary-hover: #0369a1;
  --accent-light: #e0f2fe;
  --accent-border: #7dd3fc;
  
  --brand-fastapi: #009688;
  --brand-fastapi-light: #e6fffa;
  --brand-fastapi-dark: #00796b;

  --code-bg: #0b1120;
  --code-header: #0f172a;
  --code-border: #1e293b;
  --code-text: #e2e8f0;

  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --header-height: 72px;
  --sidebar-width: 320px;
  
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==============================================================
   HEADER (Light Blue Theme)
   ============================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-header-footer);
  border-bottom: 1px solid var(--border-header-footer);
  height: var(--header-height);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

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

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #009688 0%, #0284c7 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 150, 136, 0.25);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-header-title);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  background: #0284c7;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.brand-text p {
  font-size: 0.78rem;
  color: var(--text-header-sub);
  font-weight: 600;
  margin-top: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-container {
  position: relative;
  width: 280px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-header-footer);
  border-radius: var(--radius-full);
  padding: 8px 36px 8px 34px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
}

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.search-shortcut {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-header-title);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}

/* ==============================================================
   LAYOUT (Two-Column Container)
   ============================================================== */
.app-container {
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex: 1;
  position: relative;
}

/* ==============================================================
   LEFT SIDEBAR (Sticky Navigation with Accordion Submenus)
   ============================================================== */
.app-sidebar {
  width: var(--sidebar-width);
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  padding: 24px 16px;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.app-sidebar::-webkit-scrollbar {
  width: 5px;
}
.app-sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.sidebar-heading {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-left: 8px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-group {
  display: flex;
  flex-direction: column;
}

.nav-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  transition: background-color 0.15s ease;
}

.nav-item-header:hover {
  background-color: var(--bg-surface-elevated);
}

.nav-link-main {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.88rem;
  flex: 1;
  padding: 4px 0;
}

.nav-link-main .module-num {
  background: var(--bg-surface-elevated);
  color: var(--accent-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* Sub-Menu Toggle Button */
.submenu-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  transition: all 0.2s ease;
}

.submenu-toggle-btn:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.submenu-toggle-btn .chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* By Default: Sub-Menu Closed */
.submenu {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-left: 20px;
  padding-left: 12px;
  border-left: 2px solid var(--border-color);
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              margin 0.2s ease;
}

/* Expanded Sub-Menu */
.nav-group.expanded .submenu {
  max-height: 800px;
  opacity: 1;
  margin-top: 4px;
  margin-bottom: 6px;
}

.nav-group.expanded .submenu-toggle-btn .chevron {
  transform: rotate(90deg);
  color: var(--accent-primary);
}

.submenu-item {
  margin: 2px 0;
}

.submenu-link {
  display: block;
  padding: 6px 10px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.submenu-link:hover {
  color: var(--accent-primary);
  background-color: var(--accent-light);
  font-weight: 600;
  padding-left: 12px;
}

.submenu-link.active {
  color: var(--accent-primary);
  background-color: var(--accent-light);
  font-weight: 700;
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ==============================================================
   RIGHT COLUMN (Main Documentation Canvas)
   ============================================================== */
.app-content {
  flex: 1;
  min-width: 0;
  padding: 36px 48px 60px 48px;
  max-width: 1040px;
  margin: 0 auto;
}

.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.breadcrumb-bar a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb-bar a:hover {
  text-decoration: underline;
}

/* Hero Banner (Streamlined, Professional) */
.hero-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid var(--border-header-footer);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin-bottom: 40px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.hero-badge {
  display: inline-block;
  background: #0284c7;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
}

.hero-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.hero-desc {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 840px;
  margin-bottom: 20px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-chip {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-header-footer);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.stat-chip span.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--brand-fastapi);
}

/* ==============================================================
   TUTORIAL SECTIONS & SUBSECTIONS (Clean Doc Flow)
   ============================================================== */
.tutorial-section {
  padding-top: 16px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 40px;
}

.tutorial-section:last-of-type {
  border-bottom: none;
}

.section-header {
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-number {
  background: linear-gradient(135deg, #0284c7 0%, #009688 100%);
  color: #ffffff;
  padding: 4px 12px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.section-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

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

.tutorial-subsection {
  margin-top: 32px;
}

.subsection-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.subsection-title::before {
  content: "#";
  color: var(--brand-fastapi);
  font-weight: 900;
  opacity: 0.8;
}

/* Clean, seamless content flow (no stacked cards) */
.content-block {
  margin-bottom: 24px;
}

.content-block p {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.75;
  margin-bottom: 16px;
}

.content-block p:last-child {
  margin-bottom: 0;
}

/* Standard Lists */
.content-block ul {
  margin: 14px 0 20px 24px;
  padding: 0;
}

.content-block ul li {
  margin-bottom: 8px;
  line-height: 1.7;
  color: var(--text-secondary);
  font-size: 0.96rem;
}

.content-block ul li strong {
  color: var(--text-primary);
}

.content-block ol {
  margin: 14px 0 20px 24px;
  padding: 0;
}

.content-block ol li {
  margin-bottom: 8px;
  line-height: 1.7;
  color: var(--text-secondary);
  font-size: 0.96rem;
}

/* ==============================================================
   PROFESSIONAL BULLET POINTS (Replaces Clunky Feature Cards)
   ============================================================== */
.bullet-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.96rem;
  color: var(--text-secondary);
  line-height: 1.65;
  padding: 6px 0;
}

.bullet-emoji {
  font-size: 1.25rem;
  line-height: 1.3;
  flex-shrink: 0;
  margin-top: 1px;
}

.bullet-body {
  flex: 1;
}

.bullet-body strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Inline code tag */
code {
  font-family: var(--font-mono);
  background-color: #f1f5f9;
  color: #0369a1;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 0.88em;
  border: 1px solid #e2e8f0;
}

/* ==============================================================
   CALLOUT ALERTS (Subtle, High-End Style)
   ============================================================== */
.callout {
  border-left: 3px solid var(--accent-primary);
  background-color: #f0f9ff;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px;
  margin: 20px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.callout-icon {
  font-size: 1.2rem;
  line-height: 1.3;
  flex-shrink: 0;
}

.callout-body h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-header-title);
  margin-bottom: 4px;
}

.callout-body p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0 !important;
  line-height: 1.6;
}

.callout-success {
  border-left-color: #10b981;
  background-color: #f0fdf4;
}
.callout-success .callout-body h4 { color: #047857; }

.callout-warning {
  border-left-color: #f59e0b;
  background-color: #fffbeb;
}
.callout-warning .callout-body h4 { color: #b45309; }

/* ==============================================================
   CODE BLOCKS (Dark High-Contrast Developer Theme)
   ============================================================== */
.code-wrapper {
  background-color: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-md);
  margin: 20px 0;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.code-header {
  background-color: var(--code-header);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--code-border);
}

.code-lang {
  color: #94a3b8;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copy-btn {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #334155;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: #1e293b;
  color: #ffffff;
  border-color: #64748b;
}

.copy-btn.copied {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
}

.code-wrapper pre {
  padding: 16px;
  overflow-x: auto;
  line-height: 1.6;
}

.code-wrapper pre code {
  background: transparent;
  color: var(--code-text);
  padding: 0;
  border: none;
  font-size: 0.86rem;
  font-family: var(--font-mono);
}

/* ==============================================================
   COMPARISON TABLE (Minimalist & Clean)
   ============================================================== */
.table-container {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #ffffff;
}

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

.comparison-table th {
  background-color: #f8fafc;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
}

.comparison-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  line-height: 1.5;
}

.comparison-table tr:hover td {
  background-color: var(--bg-surface-elevated);
}

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

.comparison-table .highlight-fastapi {
  background-color: #f0fdfa;
  color: #0f766e;
  font-weight: 600;
}

/* ==============================================================
   FOOTER (Light Blue Theme & Author Details)
   ============================================================== */
.app-footer {
  background-color: var(--bg-header-footer);
  border-top: 1px solid var(--border-header-footer);
  padding: 32px 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.footer-author {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.footer-heart {
  color: #ef4444;
  display: inline-block;
  animation: heartPulse 1.8s infinite;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.footer-links-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-header-footer);
  transition: all 0.2s ease;
}

.footer-link:hover {
  background: #ffffff;
  color: var(--accent-primary-hover);
  border-color: var(--accent-primary);
}

.footer-tech-stack {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.7);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-header-footer);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copyright {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

/* ==============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================== */
@media (max-width: 1024px) {
  .search-container { width: 220px; }
  .app-content { padding: 32px 24px; }
}

@media (max-width: 900px) {
  html, body {
    overflow-x: hidden;
  }

  .app-header {
    height: 56px;
  }

  .header-inner {
    padding: 0 12px;
    gap: 8px;
  }

  .brand-wrapper {
    gap: 8px;
    min-width: 0;
    flex: 1;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }

  .brand-text {
    min-width: 0;
  }

  .brand-text h1 {
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
  }

  .brand-badge {
    display: none !important;
  }

  .brand-text p {
    display: none !important;
  }

  .header-actions {
    gap: 6px;
    flex-shrink: 0;
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
  }

  .search-shortcut {
    display: none !important;
  }

  .search-container {
    width: 105px;
    transition: width 0.2s ease;
  }

  .search-container:focus-within {
    width: 140px;
  }

  .search-input {
    padding: 5px 8px 5px 26px;
    font-size: 0.74rem;
  }

  .search-icon {
    left: 7px;
    width: 12px;
    height: 12px;
  }

  .app-sidebar {
    position: fixed;
    left: -100%;
    top: 56px;
    z-index: 99;
    width: 285px;
    max-width: 85vw;
    height: calc(100vh - 56px);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xl);
    padding: 16px 12px 60px 12px;
  }

  .app-sidebar.mobile-open {
    left: 0;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    top: 56px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 98;
  }

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

  .app-content {
    padding: 16px 12px 80px 12px;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .hero-title {
    font-size: 1.45rem;
    line-height: 1.25;
  }

  .hero-description {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .hero-stats {
    gap: 6px;
  }

  .stat-chip {
    font-size: 0.72rem;
    padding: 3px 8px;
  }

  .subsection-header {
    gap: 8px;
    margin-bottom: 8px;
  }

  .subsection-title {
    font-size: 1rem;
    line-height: 1.35;
  }

  .voice-read-btn {
    padding: 4px 9px;
    font-size: 0.74rem;
  }

  .qa-card {
    padding: 14px 12px;
    margin-bottom: 14px;
  }

  .qa-question {
    font-size: 0.95rem;
  }

  .callout-card {
    padding: 12px;
  }

  .code-wrapper {
    max-width: 100%;
    overflow: hidden;
  }

  .code-wrapper pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .code-wrapper pre code {
    font-size: 0.78rem;
  }

  .code-header {
    padding: 6px 10px;
  }

  .table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 12px 0;
  }
}

/* ==============================================================
   INTERVIEW QUESTIONS & SCENARIOS (MODULE 09)
   ============================================================== */
.qa-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.qa-card:hover {
  border-color: #cbd5e1;
  border-left-color: var(--accent-primary-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.qa-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.qa-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.qa-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.qa-badge.scenario { background: #d97706; }
.qa-badge.pitfall { background: #dc2626; }
.qa-badge.strategy { background: #059669; }

.qa-question {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0;
}

.qa-level-tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.qa-level-tag.junior { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.qa-level-tag.mid { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; }
.qa-level-tag.senior { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.qa-level-tag.staff { background: #fdf2f8; color: #9d174d; border-color: #fbcfe8; }

.qa-answer {
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.65;
}

.qa-answer p {
  margin-bottom: 12px;
}

.qa-answer p:last-child {
  margin-bottom: 0;
}

.qa-answer ul, .qa-answer ol {
  margin: 10px 0 14px 20px;
}

.qa-answer li {
  margin-bottom: 6px;
}

.qa-key-takeaway {
  background: #f8fafc;
  border-left: 3px solid var(--accent-primary);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 14px 0;
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* ==============================================================
   VOICE NARRATION & AUDIO PLAYER
   ============================================================== */
.voice-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0284c7;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}

.voice-read-btn:hover {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
}

.voice-read-btn.is-active-playing {
  background: #0284c7;
  border-color: #0369a1;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.voice-read-btn.is-active-playing .voice-icon {
  animation: pulseIcon 1.2s infinite;
}

@keyframes pulseIcon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

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

/* Floating Voice Player Bar */
.voice-player-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: calc(100% - 48px);
  max-width: 680px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid #bfdbfe;
  box-shadow: 0 16px 36px rgba(2, 132, 199, 0.16), 0 4px 12px rgba(15, 23, 42, 0.08);
  border-radius: 40px;
  padding: 10px 20px;
  animation: slideUpPlayer 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpPlayer {
  from {
    transform: translate(-50%, 40px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.voice-player-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.voice-player-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

/* Equalizer sound bars */
.voice-pulse-indicator {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
  flex-shrink: 0;
}

.voice-pulse-indicator .bar {
  width: 3px;
  background: #0284c7;
  border-radius: 2px;
  height: 6px;
  transition: height 0.2s ease;
}

.voice-pulse-indicator.is-playing .bar-1 { animation: audioWave 0.8s ease-in-out infinite alternate; }
.voice-pulse-indicator.is-playing .bar-2 { animation: audioWave 1.1s ease-in-out 0.2s infinite alternate; }
.voice-pulse-indicator.is-playing .bar-3 { animation: audioWave 0.9s ease-in-out 0.4s infinite alternate; }
.voice-pulse-indicator.is-playing .bar-4 { animation: audioWave 1.2s ease-in-out 0.1s infinite alternate; }

@keyframes audioWave {
  0% { height: 4px; }
  100% { height: 18px; }
}

.voice-text-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.voice-status-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #0284c7;
  letter-spacing: 0.05em;
}

.voice-section-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.voice-control-btn {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.voice-control-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: var(--accent-primary);
  transform: scale(1.05);
}

.voice-control-btn.voice-btn-toggle {
  background: #0284c7;
  border-color: #0369a1;
  color: #ffffff;
  width: 40px;
  height: 40px;
}

.voice-control-btn.voice-btn-toggle:hover {
  background: #0369a1;
}

.voice-speed-btn {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  color: #0f766e;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.voice-speed-btn:hover {
  background: #ccfbf1;
  border-color: #5eead4;
}

/* Voice Gender Toggle Button */
.voice-gender-btn {
  background: #fdf4ff;
  border: 1px solid #f0abfc;
  color: #a21caf;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.voice-gender-btn:hover {
  background: #fae8ff;
  border-color: #e879f9;
  transform: translateY(-1px);
}

.voice-gender-btn.is-man {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.voice-gender-btn.is-man:hover {
  background: #dbeafe;
  border-color: #60a5fa;
}

/* ==============================================================
   REAL-TIME TEXT HIGHLIGHTING (Synchronized with Audio Speech)
   ============================================================== */
.speech-active-highlight {
  background-color: #fef08a !important; /* Luminous soft yellow */
  color: #0f172a !important;
  border-radius: 4px;
  box-shadow: 0 0 0 4px #fef08a, 0 4px 14px rgba(234, 179, 8, 0.25) !important;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  z-index: 10;
}

.speech-active-highlight * {
  color: #0f172a !important;
}

.qa-card.speech-active-highlight {
  border-color: #eab308 !important;
  background-color: #fffbeb !important;
  box-shadow: 0 0 0 3px #fef08a, var(--shadow-md) !important;
}

/* ==============================================================
   FLOATING TEXT SELECTION QUICK-PLAY POPOVER
   ============================================================== */
.speech-selection-popover {
  position: absolute;
  z-index: 99999;
  transform: translate(-50%, -100%);
  margin-top: -10px;
  pointer-events: auto;
  animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translate(-50%, -85%); }
  to { opacity: 1; transform: translate(-50%, -100%); }
}

.speech-read-selection-btn {
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #334155;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}

.speech-read-selection-btn:hover {
  background: #0284c7;
  border-color: #38bdf8;
  transform: scale(1.05);
}

.speech-read-selection-btn svg {
  fill: currentColor;
}

/* Readable elements click cue */
.clickable-speech-target {
  cursor: pointer;
  transition: outline 0.15s ease;
}

.clickable-speech-target:hover {
  outline: 1.5px dashed #38bdf8;
  outline-offset: 2px;
  border-radius: 3px;
}

/* ==============================================================
   SUBSECTION HEADER & SECTION-LEVEL START BUTTONS
   ============================================================== */
.subsection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.subsection-header .subsection-title {
  margin-bottom: 0;
}

.voice-control-btn.voice-btn-nav {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 640px) {
  .voice-player-bar {
    width: calc(100% - 16px);
    bottom: 8px;
    padding: 8px 12px;
    border-radius: 16px;
  }

  .voice-player-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .voice-player-info {
    justify-content: space-between;
    width: 100%;
    gap: 8px;
  }

  .voice-section-title {
    max-width: calc(100vw - 110px);
    font-size: 0.8rem;
    font-weight: 600;
  }

  .voice-player-controls {
    justify-content: space-between;
    width: 100%;
    gap: 4px;
  }

  .voice-control-btn {
    width: 32px;
    height: 32px;
  }

  .voice-control-btn.voice-btn-toggle {
    width: 36px;
    height: 36px;
  }

  .voice-gender-btn,
  .voice-speed-btn {
    font-size: 0.72rem;
    padding: 3px 8px;
  }
}
