/* ============================================================
   AXAM — Offline AI Tutor  |  Design System & Styles
   Demo version — identical to production + demo-specific additions
   ============================================================ */

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  /* Background layers (dark theme) */
  --bg-base:      #0b1120;
  --bg-primary:   #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary:  #334155;
  --bg-hover:     #3b4c66;
  --bg-input:     #1a2538;

  /* Text */
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-inverse:   #0f172a;

  /* Brand — AXAM Blue (from logo orbital) */
  --accent:         #2DA0D9;
  --accent-hover:   #1E8BC3;
  --accent-soft:    rgba(45, 160, 217, 0.12);
  --accent-border:  rgba(45, 160, 217, 0.3);

  /* Brand secondary — AXAM Green (from logo center dot) */
  --brand-green:    #8CC63F;
  --brand-navy:     #1B2A4A;
  --brand-teal:     #4ECDC4;

  /* Semantic */
  --success:    #22c55e;
  --warning:    #f59e0b;
  --error:      #ef4444;
  --info:       #3b82f6;

  /* Borders */
  --border:       #1e293b;
  --border-light: #334155;

  /* Sizing */
  --sidebar-w:  260px;
  --radius:     12px;
  --radius-sm:  8px;
  --radius-xs:  6px;

  /* Fonts — system stack for offline */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
           "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "Fira Code", "Consolas", monospace;

  /* Transitions */
  --transition: 180ms ease;

  /* Demo-specific */
  --demo-orange: #f59e0b;
  --demo-banner-h: 38px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-font-smoothing: antialiased; }
body {
  height: 100%;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  overflow: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-hover); }

/* ── App Layout ─────────────────────────────────────────────── */
#app { height: 100vh; display: flex; flex-direction: column; }

/* ══════════════════════════════════════════════════════════════
   DEMO BANNER
   ══════════════════════════════════════════════════════════════ */
#demo-banner {
  height: var(--demo-banner-h);
  background: linear-gradient(90deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
  border-bottom: 1px solid var(--demo-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
  padding: 0 20px;
}
.demo-banner-badge {
  background: var(--demo-orange);
  color: var(--text-inverse);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 4px;
}
.demo-banner-link {
  color: var(--demo-orange);
  font-weight: 600;
  margin-left: 4px;
}
.demo-banner-link:hover {
  color: #fbbf24;
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════════
   DEMO MODAL
   ══════════════════════════════════════════════════════════════ */
.demo-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.demo-modal-overlay.hidden { display: none; }

.demo-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 36px 32px 28px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  animation: modalSlideUp 0.3s ease;
}
.demo-modal-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.demo-modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.demo-modal-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.demo-modal-body strong {
  color: var(--accent);
}

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

/* Demo footer tag */
.demo-footer-tag {
  color: var(--demo-orange);
  font-weight: 600;
}

/* Main Layout — account for demo banner */
#main-app {
  display: flex; height: calc(100vh - var(--demo-banner-h)); overflow: hidden;
}
#main-app.hidden { display: none; }

/* ── Sidebar ────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  user-select: none;
}

.sidebar-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-logo img { width: 100%; height: 100%; object-fit: contain; }
.sidebar-title {
  font-size: 20px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.sidebar-nav {
  flex: 1; padding: 12px 10px; display: flex;
  flex-direction: column; gap: 2px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  transition: all var(--transition); text-decoration: none;
  border: 1px solid transparent;
}
.nav-item:hover {
  background: var(--bg-secondary); color: var(--text-primary);
  text-decoration: none;
}
.nav-item.active {
  background: var(--accent-soft); color: var(--accent);
  border-color: var(--accent-border);
}
.nav-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }

.sidebar-model-picker {
  padding: 12px 20px; border-top: 1px solid var(--border);
}
.model-picker-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); margin-bottom: 6px; font-weight: 600;
}
.model-select {
  width: 100%; padding: 7px 10px; border-radius: var(--radius-xs);
  border: 1px solid var(--border-light); background: var(--bg-input);
  color: var(--text-primary); font-size: 12px; font-family: var(--font);
  cursor: pointer; transition: border-color var(--transition);
}
.model-select:hover:not(:disabled) { border-color: var(--accent); }
.model-select:disabled { opacity: 0.5; cursor: not-allowed; }
.model-select option:disabled { color: var(--text-muted); }

.model-info {
  margin-top: 6px; font-size: 10px; color: var(--text-muted);
  display: flex; flex-direction: column; gap: 2px;
}
.model-speed {
  color: var(--accent); font-weight: 600;
}
.model-hw {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-muted);
}

/* ── Content Area ───────────────────────────────────────────── */
#content {
  flex: 1; overflow: hidden; display: flex; flex-direction: column;
  background: var(--bg-base);
}

.page { display: none; flex: 1; overflow-y: auto; }
.page.active { display: flex; flex-direction: column; }

.page-header {
  padding: 24px 32px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
  flex-shrink: 0;
}
.page-title {
  font-size: 22px; font-weight: 700; margin-bottom: 4px;
}
.page-subtitle { font-size: 13px; color: var(--text-secondary); }

.page-body { flex: 1; padding: 24px 32px; overflow-y: auto; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
}
.card:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}
.card-clickable { cursor: pointer; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.subject-card {
  text-align: center; padding: 28px 20px;
}
.subject-icon { font-size: 40px; margin-bottom: 12px; }
.subject-name { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.subject-meta { font-size: 12px; color: var(--text-muted); }

.course-card { display: flex; align-items: center; gap: 14px; }
.course-info { flex: 1; }
.course-name { font-size: 14px; font-weight: 600; }
.course-count { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.lecture-card { display: flex; align-items: center; gap: 14px; }
.lecture-info { flex: 1; min-width: 0; }
.lecture-title {
  font-size: 14px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lecture-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.lecture-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; border: 1px solid transparent;
  transition: all var(--transition); white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: var(--text-inverse);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  background: var(--bg-tertiary); color: var(--text-primary);
  border-color: var(--border-light);
}
.btn-secondary:hover { background: var(--bg-hover); }
.btn-outline {
  background: transparent; color: var(--accent);
  border-color: var(--accent-border);
}
.btn-outline:hover { background: var(--accent-soft); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  border-radius: var(--radius-sm);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Inputs ─────────────────────────────────────────────────── */
.input-group { position: relative; }
.input {
  width: 100%; padding: 10px 14px;
  background: var(--bg-input); color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 14px; outline: none;
  transition: border-color var(--transition);
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-muted); }

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

textarea.input { resize: vertical; min-height: 80px; }

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 20px; flex-wrap: wrap;
}
.breadcrumb-item { cursor: pointer; color: var(--accent); }
.breadcrumb-item:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--text-muted); }
.breadcrumb-current { color: var(--text-primary); font-weight: 600; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-success { background: rgba(34,197,94,0.12); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.12); color: var(--warning); }
.badge-error { background: rgba(239,68,68,0.12); color: var(--error); }

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 2px; padding: 4px;
  background: var(--bg-secondary); border-radius: var(--radius-sm);
  width: fit-content;
}
.tab-btn {
  padding: 7px 18px; border-radius: var(--radius-xs);
  font-size: 13px; font-weight: 500; border: none;
  background: transparent; color: var(--text-secondary);
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { background: var(--accent); color: var(--text-inverse); }

/* ── Toast / Snackbar ───────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 2000; pointer-events: none;
}
.toast {
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  display: flex; align-items: center; gap: 10px;
}
.toast-success { background: var(--success); color: white; }
.toast-error { background: var(--error); color: white; }
.toast-info { background: var(--info); color: white; }

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

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 48px 24px;
  color: var(--text-muted); text-align: center;
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-text { font-size: 15px; margin-bottom: 8px; }
.empty-hint { font-size: 13px; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   HOME PAGE
   ══════════════════════════════════════════════════════════════ */
.home-hero {
  text-align: center; padding: 48px 24px 32px;
}
.home-logo {
  margin: 0 auto 12px;
  width: 140px; height: 140px;
}
.home-logo img { width: 100%; height: 100%; object-fit: contain; }
.home-tagline {
  font-size: 16px; color: var(--text-secondary); max-width: 460px;
  margin: 0 auto 32px;
}

.home-search {
  max-width: 560px; margin: 0 auto 48px; position: relative;
}
.home-search .input {
  padding: 14px 20px 14px 48px; font-size: 16px;
  border-radius: var(--radius); background: var(--bg-secondary);
}
.home-search .search-icon { left: 18px; font-size: 20px; }

.feature-cards {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; max-width: 780px; margin: 0 auto 48px;
}
.feature-card {
  text-align: center; padding: 32px 20px;
  cursor: pointer;
}
.feature-icon { font-size: 36px; margin-bottom: 12px; }
.feature-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.feature-desc { font-size: 13px; color: var(--text-secondary); }

/* ══════════════════════════════════════════════════════════════
   CHAT PAGE
   ══════════════════════════════════════════════════════════════ */
#page-chat { display: none; }
#page-chat.active { display: flex; flex-direction: column; }

.chat-container { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 24px 32px;
  display: flex; flex-direction: column; gap: 16px;
}

.chat-welcome {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  color: var(--text-muted);
}
.chat-welcome-icon { width: 64px; height: 64px; opacity: 0.6; margin: 0 auto; }
.chat-welcome-icon img { width: 100%; height: 100%; object-fit: contain; }
.chat-welcome-text { font-size: 16px; }
.chat-suggestions {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  max-width: 600px;
}
.chat-suggestion {
  padding: 8px 16px; border-radius: 20px;
  background: var(--bg-secondary); border: 1px solid var(--border-light);
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
  transition: all var(--transition);
}
.chat-suggestion:hover {
  border-color: var(--accent-border); color: var(--accent);
  background: var(--accent-soft);
}

.message { display: flex; gap: 12px; max-width: 85%; }
.message-user { align-self: flex-end; flex-direction: row-reverse; }
.message-assistant { align-self: flex-start; }

.message-avatar {
  width: 32px; height: 32px; border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.message-user .message-avatar { background: var(--accent); color: white; }
.message-assistant .message-avatar {
  background: var(--bg-tertiary); padding: 4px;
}
.message-assistant .message-avatar img {
  width: 100%; height: 100%; object-fit: contain;
}

.message-bubble {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 14px; line-height: 1.65;
}
.message-user .message-bubble {
  background: var(--accent); color: var(--text-inverse);
  border-bottom-right-radius: 4px;
}
.message-assistant .message-bubble {
  background: var(--bg-secondary); color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-bottom-left-radius: 4px;
}

.message-sources {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 12px; color: var(--text-muted);
}
.message-sources a { font-size: 12px; }

.typing-indicator {
  display: flex; gap: 4px; align-items: center; padding: 8px 16px;
}
.typing-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

.chat-input-area {
  padding: 16px 32px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}
.chat-input-row { display: flex; gap: 10px; align-items: flex-end; }
.chat-input {
  flex: 1; padding: 12px 16px;
  background: var(--bg-input); color: var(--text-primary);
  border: 1px solid var(--border-light); border-radius: var(--radius);
  font-size: 14px; outline: none; resize: none;
  min-height: 44px; max-height: 150px;
  transition: border-color var(--transition);
}
.chat-input:focus { border-color: var(--accent); }
.chat-send-btn {
  width: 44px; height: 44px; padding: 0;
  background: var(--accent); border: none; border-radius: var(--radius-sm);
  color: white; font-size: 18px; display: flex;
  align-items: center; justify-content: center;
  transition: background var(--transition);
}
.chat-send-btn:hover { background: var(--accent-hover); }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════
   BROWSE PAGE
   ══════════════════════════════════════════════════════════════ */
.browse-search {
  max-width: 400px; margin-bottom: 20px;
}

/* ══════════════════════════════════════════════════════════════
   EXAM PAGE
   ══════════════════════════════════════════════════════════════ */
.exam-setup {
  max-width: 560px; margin: 0 auto;
}
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
}

.exam-quiz { max-width: 720px; margin: 0 auto; }

.question-card {
  background: var(--bg-secondary); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
}
.question-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.question-number {
  font-size: 13px; font-weight: 600; color: var(--accent);
}
.question-difficulty { font-size: 11px; }
.question-text {
  font-size: 15px; font-weight: 500; margin-bottom: 20px; line-height: 1.5;
}

.option-list { display: flex; flex-direction: column; gap: 8px; }
.option-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--bg-primary); border: 1px solid var(--border);
  cursor: pointer; transition: all var(--transition);
  font-size: 14px;
}
.option-item:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.option-item.selected { border-color: var(--accent); background: var(--accent-soft); }
.option-item.correct { border-color: var(--success); background: rgba(34,197,94,0.08); }
.option-item.incorrect { border-color: var(--error); background: rgba(239,68,68,0.08); }

.option-radio {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border-light); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.option-item.selected .option-radio {
  border-color: var(--accent);
}
.option-item.selected .option-radio::after {
  content: ''; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent);
}

.explanation-box {
  margin-top: 12px; padding: 14px 16px;
  background: var(--bg-primary); border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  font-size: 13px; color: var(--text-secondary); line-height: 1.6;
}

.exam-progress {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px;
}
.progress-bar {
  flex: 1; height: 6px; background: var(--bg-tertiary);
  border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--accent);
  border-radius: 3px; transition: width 0.3s ease;
}
.progress-text { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }

.exam-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 16px;
}

/* Results */
.results-summary {
  text-align: center; padding: 32px;
  background: var(--bg-secondary); border-radius: var(--radius);
  margin-bottom: 24px;
}
.results-score {
  font-size: 56px; font-weight: 800; margin-bottom: 8px;
}
.results-score.pass { color: var(--success); }
.results-score.fail { color: var(--error); }
.results-label { font-size: 14px; color: var(--text-secondary); }

/* ── Lecture Detail Panel ───────────────────────────────────── */
.lecture-detail {
  max-width: 680px;
}
.lecture-detail-title {
  font-size: 20px; font-weight: 700; margin-bottom: 12px;
}
.lecture-detail-meta {
  display: flex; gap: 20px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.detail-meta-item {
  font-size: 13px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
}
.lecture-detail-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding-top: 20px; border-top: 1px solid var(--border-light);
}

/* ── Utility ────────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Responsive (for smaller windows) ───────────────────────── */
@media (max-width: 768px) {
  #sidebar { width: 64px; min-width: 64px; }
  .sidebar-title, .nav-item span:last-child, .sidebar-footer, .sidebar-model-picker { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-icon { margin: 0; }
  .page-body { padding: 16px; }
  .feature-cards { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  #demo-banner { font-size: 11px; gap: 8px; }
  #demo-banner span:not(.demo-banner-badge) { display: none; }
}
