/* ── Multi-Page Navigation & Distinct Modern Section Styling ── */

/* Floating App Navigation Bar */
.app-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 18, 26, 0.7);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-full);
  padding: 5px;
  margin-bottom: 28px;
  overflow-x: auto;
  scrollbar-width: none;
}

.app-nav::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: #192032;
  color: #fff;
  border-color: rgba(99, 102, 241, 0.4);
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.nav-tab span.nav-icon {
  font-size: 15px;
}

/* App View Containers */
.app-view {
  animation: fadeInView 0.22s ease both;
}

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

/* ── Distinct Modern Subject Sections ── */
.section-switcher-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.section-switch-card {
  padding: 16px 20px;
  border-radius: var(--r-md);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-hairline);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-switch-card:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.section-switch-card[data-active="true"] {
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.5);
}

.section-switch-card[data-subject="Physics"][data-active="true"] {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
  box-shadow: 0 0 0 1px var(--accent-cyan), 0 8px 24px -6px var(--accent-cyan-glow);
}

.section-switch-card[data-subject="Chemistry"][data-active="true"] {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 0 1px var(--accent-emerald), 0 8px 24px -6px var(--accent-emerald-glow);
}

.section-switch-card[data-subject="Mathematics"][data-active="true"] {
  border-color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 1px var(--accent-indigo), 0 8px 24px -6px var(--accent-indigo-glow);
}

.switch-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 19px;
  flex-shrink: 0;
  border: 1px solid var(--border-hairline);
}

.section-switch-card[data-subject="Physics"] .switch-icon {
  background: var(--accent-cyan-soft);
  color: var(--accent-cyan);
}

.section-switch-card[data-subject="Chemistry"] .switch-icon {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
}

.section-switch-card[data-subject="Mathematics"] .switch-icon {
  background: var(--accent-indigo-soft);
  color: var(--accent-indigo);
}

.switch-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.switch-sub {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

/* Level 1: Distinct Section Block (Subject) */
.section-block {
  margin-bottom: 32px;
  border-radius: var(--r-lg);
  padding: 28px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.section-block[data-subject="Physics"] {
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.04) 0%, rgba(15, 18, 26, 0.95) 100%);
  border: 1px solid rgba(6, 182, 212, 0.3);
  box-shadow: 0 12px 36px -12px rgba(6, 182, 212, 0.18);
}

.section-block[data-subject="Chemistry"] {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.04) 0%, rgba(15, 18, 26, 0.95) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 12px 36px -12px rgba(16, 185, 129, 0.18);
}

.section-block[data-subject="Mathematics"] {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.04) 0%, rgba(15, 18, 26, 0.95) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 12px 36px -12px rgba(99, 102, 241, 0.18);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-hairline);
  flex-wrap: wrap;
}

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

.section-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  border: 1px solid var(--border-hairline);
}

.section-block[data-subject="Physics"] .section-icon-box {
  background: var(--accent-cyan-soft);
  border-color: rgba(6, 182, 212, 0.4);
}

.section-block[data-subject="Chemistry"] .section-icon-box {
  background: var(--accent-emerald-soft);
  border-color: rgba(16, 185, 129, 0.4);
}

.section-block[data-subject="Mathematics"] .section-icon-box {
  background: var(--accent-indigo-soft);
  border-color: rgba(99, 102, 241, 0.4);
}

.section-title-wrap h3 {
  font-size: 21px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.section-tagline {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.section-block[data-subject="Physics"] .section-tagline { color: var(--accent-cyan); }
.section-block[data-subject="Chemistry"] .section-tagline { color: var(--accent-emerald); }
.section-block[data-subject="Mathematics"] .section-tagline { color: var(--accent-indigo); }

/* Level 2: Collapsible Subsection Unit Cards */
.subsection-group {
  margin-bottom: 20px;
  background: rgba(10, 13, 20, 0.85);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: all 0.2s ease;
}

.subsection-group:last-child {
  margin-bottom: 0;
}

.subsection-header {
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid transparent;
  transition: all 0.16s ease;
}

.subsection-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.subsection-group.open .subsection-header {
  border-bottom-color: var(--border-hairline);
}

.subsection-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
}

.subsection-desc {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.4;
  margin-top: 3px;
}

.unit-chevron {
  font-size: 14px;
  color: var(--ink-muted);
  transition: transform 0.2s ease;
}

.subsection-group.open .unit-chevron {
  transform: rotate(90deg);
  color: var(--accent-indigo);
}

.subsection-body {
  padding: 18px 20px 22px;
  display: none;
}

.subsection-group.open .subsection-body {
  display: block;
}

/* Level 3: Bite-Sized Topic Micro-Cards */
.sub-subsection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.topic-node-card {
  background: #090c14;
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.topic-node-card:hover {
  background: #111622;
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.5);
}

.topic-node-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.topic-node-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}

.topic-weight-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--r-full);
  white-space: nowrap;
  flex-shrink: 0;
}

.topic-weight-badge.high-weight {
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.topic-weight-badge.core {
  background: var(--accent-indigo-soft);
  color: var(--accent-indigo);
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.topic-weight-badge.scoring {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* Easy to understand concept summary */
.topic-summary-text {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

/* Key formula micro-chip */
.topic-formula-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hairline);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  overflow-x: auto;
  max-width: 100%;
}

.topic-node-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.topic-accuracy-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

.topic-accuracy-label.mastered { color: var(--accent-emerald); font-weight: 600; }
.topic-accuracy-label.weak { color: var(--accent-coral); font-weight: 600; }

.topic-drill-btn {
  background: var(--accent-indigo-soft);
  color: var(--accent-indigo);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 5px 12px;
  border-radius: var(--r-full);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.topic-drill-btn:hover {
  background: var(--accent-indigo);
  color: #fff;
  transform: translateY(-1px);
}

/* ── Breadcrumb Bar in Quiz Mode ── */
.quiz-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-bottom: 14px;
  overflow-x: auto;
  white-space: nowrap;
}

.quiz-breadcrumb span.sep {
  opacity: 0.4;
}

.quiz-breadcrumb strong {
  color: var(--accent-indigo);
  font-weight: 600;
}

/* ── Mock Exam Center Styles ── */
.mock-center-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.mock-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.2s ease;
}

.mock-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.6);
}

.mock-card-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-full);
  margin-bottom: 8px;
}

.mock-card strong {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: block;
  margin-bottom: 6px;
}

.mock-card p {
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.mock-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
}

.mock-meta-row span {
  padding: 3px 8px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hairline);
}

/* ── Formula Vault Styles ── */
.formula-section {
  margin-bottom: 28px;
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.formula-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-md);
  padding: 16px 18px;
}

.formula-card strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 8px;
}

.formula-tex {
  font-size: 15px;
  color: #fff;
  overflow-x: auto;
  padding: 4px 0;
}

@media (max-width: 768px) {
  .section-switcher-grid {
    grid-template-columns: 1fr;
  }
  .mock-center-grid {
    grid-template-columns: 1fr;
  }
  .sub-subsection-grid {
    grid-template-columns: 1fr;
  }
  .app-nav {
    border-radius: var(--r-md);
  }
}
