/* Veridyne Learning Portal — app layout & page styles */

.app-shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  gap: 20px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  height: calc(100vh - 40px);
  overflow-y: auto;
}

.main-col { min-width: 0; }
.main-content { min-width: 0; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--bone-70);
  font-size: 0.92em;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
  min-height: 42px;
}
.nav-link:hover { background: var(--bone-08); color: var(--bone); }
.nav-link.active {
  background: var(--ember-soft);
  border-color: rgba(180, 99, 42, 0.35);
  color: var(--ember-bright);
}

.mobile-header { display: none; }
.bottom-nav { display: none; }

/* ---------- Mobile sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(10, 15, 19, 0.6);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: min(440px, 100%);
  margin: 10px;
  margin-bottom: max(10px, env(safe-area-inset-bottom));
  padding: 18px;
  max-height: 80vh;
  overflow-y: auto;
}

/* ---------- Page scaffolding ---------- */
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: clamp(1.5em, 3vw, 1.95em); margin-bottom: 6px; }
.page-head p { color: var(--bone-70); max-width: 640px; }

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

.glass-card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
  transition: transform 0.18s ease, border-color 0.2s ease, background 0.2s ease;
}
.glass-card.clickable { cursor: pointer; }
.glass-card.clickable:hover {
  transform: translateY(-3px);
  border-color: rgba(180, 99, 42, 0.4);
  background: var(--glass-bg-raised);
}

.quick-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  color: var(--bone);
  text-align: left;
  transition: transform 0.15s ease, border-color 0.2s ease;
  min-height: 44px;
}
.quick-card:hover { transform: translateY(-2px); border-color: rgba(180, 99, 42, 0.45); }
.quick-card .qc-title { font-weight: 600; font-size: 0.95em; }
.quick-card .qc-sub { font-size: 0.78em; color: var(--bone-50); }

/* ---------- Module detail ---------- */
.module-prose p { margin-bottom: 12px; color: var(--bone-70); line-height: 1.65; }
.module-prose p:last-child { margin-bottom: 0; }

.concept-row {
  display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(229, 221, 208, 0.07);
  font-size: 0.92em;
}
.concept-row:last-child { border-bottom: none; }
.concept-row dt { font-weight: 600; color: var(--ember-bright); }
.concept-row dd { margin: 0; color: var(--bone-70); }

.gotcha-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; font-size: 0.92em; color: var(--bone-70);
  border-bottom: 1px solid rgba(229, 221, 208, 0.07);
}
.gotcha-item:last-child { border-bottom: none; }

/* ---------- Diagram viewer ---------- */
.diagram-scroll { overflow-x: auto; border-radius: var(--radius-md); }
.diagram-scroll svg { display: block; min-width: 560px; width: 100%; height: auto; }

.diagram-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.step-dot {
  width: 10px; height: 10px; border-radius: 99px; border: none; padding: 0;
  background: var(--bone-12); cursor: pointer; transition: all 0.2s ease;
}
.step-dot.done { background: var(--bone-30); }
.step-dot.current { background: var(--ember-bright); width: 22px; }

/* ---------- Quiz ---------- */
.quiz-option {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%; text-align: left;
  padding: 14px 16px; border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--bone);
  cursor: pointer; font-size: 0.95em;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  min-height: 48px;
}
.quiz-option:hover:not(:disabled) { border-color: var(--bone-30); background: var(--glass-bg-raised); }
.quiz-option:disabled { cursor: default; }
.quiz-option.selected { border-color: var(--ember-bright); background: var(--ember-soft); }
.quiz-option.correct { border-color: var(--ok); background: oklch(0.72 0.12 155 / 0.12); }
.quiz-option.wrong { border-color: var(--bad); background: oklch(0.65 0.14 25 / 0.12); }

.option-key {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(16, 23, 29, 0.5); border: 1px solid var(--glass-border);
  font-size: 0.8em; font-weight: 600;
}

/* ---------- Tables ---------- */
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.88em; }
.compare-table th, .compare-table td {
  padding: 12px 14px; text-align: left; vertical-align: top;
  border-bottom: 1px solid rgba(229, 221, 208, 0.08);
}
.compare-table th { color: var(--ember-bright); font-weight: 600; white-space: nowrap; }
.compare-table td:first-child { font-weight: 600; color: var(--bone); white-space: nowrap; }
.compare-table td { color: var(--bone-70); }
.table-scroll { overflow-x: auto; }

/* ---------- Filters ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .sidebar { display: none; }
  .mobile-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    position: sticky; top: 10px; z-index: 50;
    margin-bottom: 14px;
  }
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 10px; right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 60;
    padding: 6px;
    border-radius: 20px;
  }
  .main-content { padding-bottom: 92px; }
  .concept-row { grid-template-columns: 1fr; gap: 2px; }
  .concept-row dt { font-size: 0.95em; }
}

.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px; border: none; border-radius: 14px;
  background: transparent; color: var(--bone-50);
  font-size: 0.62em; font-weight: 600; letter-spacing: 0.02em;
  cursor: pointer; min-height: 50px; justify-content: center;
}
.bottom-nav-item.active { color: var(--ember-bright); background: var(--ember-soft); }

@media (min-width: 981px) and (max-width: 1180px) {
  .app-shell { grid-template-columns: 220px 1fr; }
}
