/* ============================================================================
   STYLESHEET PORTAL PERSIAPAN UAS SEMESTER 5 - UNIVERSITAS TERBUKA
   Mahasiswa: M. RIDUAN (NIM: 053660074) | S1 Sistem Informasi - UT Banjarmasin
   Desain: Minimalis Modern, Mobile-First, Ergonomis, Dual-Theme (Light & Dark)
   ============================================================================ */

[v-cloak] {
  display: none !important;
}

/* ----------------------------------------------------------------------------
   1. THEME COLOR TOKENS (LIGHT & DARK MODE)
   ---------------------------------------------------------------------------- */
:root {
  /* Brand Accents */
  --ut-blue-dark: #0f2942;
  --ut-blue: #2563eb;
  --ut-blue-light: #3b82f6;
  --ut-gold: #d97706;
  --ut-gold-soft: #fef3c7;

  /* Surfaces & Text (Light Mode - Clean Minimalist) */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  /* Status Colors */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;

  /* Elevations */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08);

  /* Geometry */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --app-font-scale: 1;
}

/* DARK MODE THEME TOKENS */
body.dark-mode {
  --ut-blue-dark: #1d4ed8;
  --ut-blue: #3b82f6;
  --ut-blue-light: #60a5fa;
  --ut-gold: #fbbf24;
  --ut-gold-soft: rgba(245, 158, 11, 0.14);

  --bg-main: #090d16;
  --bg-card: #111827;
  --bg-subtle: #1a2234;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #222f46;
  --border-focus: #60a5fa;

  --success: #34d399;
  --success-bg: rgba(16, 185, 129, 0.14);
  --danger: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.14);
  --warning: #fbbf24;
  --warning-bg: rgba(245, 158, 11, 0.14);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.65);
}

html {
  font-size: calc(15px * var(--app-font-scale, 1));
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 100vh;
}

/* ----------------------------------------------------------------------------
   2. TOPBAR HEADER (MINIMALIST & STICKY)
   ---------------------------------------------------------------------------- */
.topbar {
  background: var(--bg-card);
  color: var(--text-main);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

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

.ut-badge-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--ut-blue);
  color: #ffffff;
  font-weight: 900;
  font-size: 17px;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-title h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.25;
}

.brand-title p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.student-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
}

.student-pill strong {
  color: var(--text-main);
}

.font-size-ctrls {
  display: inline-flex;
  gap: 4px;
}

/* THEME TOGGLE BUTTON (DARK / LIGHT SWITCH) */
.theme-toggle-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  min-height: 36px;
}

.theme-toggle-btn:hover {
  border-color: var(--ut-blue-light);
  transform: translateY(-1px);
}

.theme-toggle-icon {
  font-size: 1rem;
  line-height: 1;
}

/* ----------------------------------------------------------------------------
   3. DESKTOP NAVIGATION TABS
   ---------------------------------------------------------------------------- */
.main-nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.15s ease;
  border-radius: 6px 6px 0 0;
}

.nav-tab:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.nav-tab.active {
  color: var(--ut-blue-light);
  border-bottom-color: var(--ut-blue-light);
  font-weight: 700;
}

/* ----------------------------------------------------------------------------
   4. MAIN CONTAINER & SLEEK COURSE SELECTOR
   ---------------------------------------------------------------------------- */
.container {
  max-width: 1280px;
  margin: 18px auto 40px;
  padding: 0 20px;
}

/* Sleek Horizontal Pill Bar for Courses */
.course-selector-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 14px;
  margin-bottom: 18px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.course-selector-bar::-webkit-scrollbar {
  display: none;
}

.course-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 7px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex: 0 0 auto;
  color: var(--text-muted);
}

.course-chip:hover {
  border-color: var(--ut-blue-light);
  color: var(--text-main);
}

.course-chip.active {
  background: var(--ut-blue);
  border-color: var(--ut-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.course-chip.active .course-chip-code {
  color: rgba(255, 255, 255, 0.8);
}

.course-chip.active .course-chip-name {
  color: #ffffff;
}

.course-chip.active .course-chip-icon {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.course-chip-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ut-blue-light);
  flex-shrink: 0;
}

.course-chip-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.course-chip-code {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ut-blue-light);
}

.course-chip-name {
  font-size: 0.85rem;
  font-weight: 600;
}

/* ----------------------------------------------------------------------------
   5. CARDS & HERO BANNER (MINIMALIST)
   ---------------------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.hero-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.hero-badge {
  display: inline-block;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--ut-blue-light);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
}

.hero-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.3;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 820px;
}

/* STATS KPI GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 2px;
}

.stat-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
}

.stat-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.data-kv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  padding: 8px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-muted);
}

.data-kv-row strong {
  color: var(--text-main);
}

.exam-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.exam-table th,
.exam-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.exam-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  background: var(--bg-subtle);
}

.mastery-banner {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.mastery-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.mastery-metric-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-lbl {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
}

.minimal-details {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  padding: 10px 14px;
}

.minimal-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.86rem;
  list-style: none;
  color: var(--text-main);
}

.minimal-summary::-webkit-details-marker {
  display: none;
}

.summary-action-text {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ut-blue-light);
}

.legend-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-green {
  background: var(--success);
}

.dot-red {
  background: var(--danger);
}

.dot-yellow {
  background: var(--warning);
}

.dot-gray {
  background: var(--border-color);
}

/* COURSE PROGRESS GRID ON DASHBOARD */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.course-progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ----------------------------------------------------------------------------
   6. BUTTONS & INTERACTIVE CONTROLS
   ---------------------------------------------------------------------------- */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  min-height: 38px;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--ut-blue);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--ut-blue-light);
}

.btn-gold {
  background: var(--ut-gold);
  color: #ffffff;
}

.btn-gold:hover:not(:disabled) {
  opacity: 0.9;
}

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

.btn-outline:hover:not(:disabled) {
  border-color: var(--ut-blue-light);
  color: var(--ut-blue-light);
  background: var(--bg-subtle);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}

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

.btn-icon {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  font-weight: 700;
  border-radius: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  min-height: 32px;
}

.mobile-study-bar {
  display: none;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

/* ----------------------------------------------------------------------------
   7. MODE SWITCH BAR & FILTER TOOLBAR
   ---------------------------------------------------------------------------- */
.mode-switch-bar {
  display: flex;
  gap: 6px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.mode-switch-bar::-webkit-scrollbar {
  display: none;
}

.mode-pill {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  text-align: center;
}

.mode-pill.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.filter-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.search-input:focus {
  border-color: var(--border-focus);
}

.kb-chip-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  scrollbar-width: none;
}

.kb-chip-bar::-webkit-scrollbar {
  display: none;
}

.kb-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.kb-chip.active {
  background: var(--ut-blue-light);
  border-color: var(--ut-blue-light);
  color: #ffffff;
}

/* ----------------------------------------------------------------------------
   8. QUIZ & CAT SIMULATION EXPERIENCE (ERGONOMIC)
   ---------------------------------------------------------------------------- */
.cat-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

/* SLEEK QUIZ PROGRESS BAR */
.quiz-progress-track {
  width: 100%;
  height: 4px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  margin-bottom: 14px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--ut-blue-light);
  border-radius: var(--radius-full);
  transition: width 0.25s ease;
}

.question-box {
  font-size: 1.04rem;
  line-height: 1.7;
  white-space: pre-line;
  margin-bottom: 18px;
  padding: 18px 20px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.option-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all 0.15s ease;
  min-height: 52px;
}

.option-btn:hover {
  border-color: var(--ut-blue-light);
  background: var(--bg-subtle);
}

.option-btn:active {
  transform: scale(0.99);
}

.option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.option-btn.selected {
  border-color: var(--ut-blue);
  background: rgba(37, 99, 235, 0.08);
}

.option-btn.selected .option-letter {
  background: var(--ut-blue);
  color: #ffffff;
  border-color: var(--ut-blue);
}

.option-btn.correct {
  border-color: var(--success);
  background: var(--success-bg);
}

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

.option-btn.wrong {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.option-btn.wrong .option-letter {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}

/* EXPLANATION CARD */
.explanation-card {
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 14px;
  font-size: 0.92rem;
  line-height: 1.6;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.explanation-card.correct-card {
  border-color: var(--success);
  background: var(--success-bg);
}

.explanation-card.wrong-card {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.explanation-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.explanation-status-pill {
  font-weight: 700;
  font-size: 0.86rem;
}

.status-correct {
  color: var(--success);
}

.status-wrong {
  color: var(--danger);
}

.explanation-meta {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ----------------------------------------------------------------------------
   9. QUESTION NAVIGATOR NUMBER GRID
   ---------------------------------------------------------------------------- */
.num-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.num-btn {
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.num-btn:active {
  transform: scale(0.92);
}

.num-btn.current {
  border-color: var(--ut-blue-light);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
  background: var(--bg-card);
}

.num-btn.answered {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.num-btn.flagged {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--warning);
}

/* ----------------------------------------------------------------------------
   10. FLASHCARDS & STUDY MODULES (LENGKAP DENGAN PENJELASAN & PEMBAHASAN)
   ---------------------------------------------------------------------------- */
.modul-view-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.modul-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.module-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.easy-understand-box {
  background: var(--ut-gold-soft);
  border: 1px solid var(--warning);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.easy-understand-title {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--ut-gold);
  margin-bottom: 6px;
}

.easy-understand-text {
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--text-main);
}

.core-formula-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--ut-blue-light);
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font-size: 0.91rem;
  line-height: 1.6;
}

.section-sub-label {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

.kb-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.kb-breakdown-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.kb-breakdown-title {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--ut-blue-light);
  margin-bottom: 6px;
}

.kb-breakdown-body {
  font-size: 0.89rem;
  line-height: 1.6;
  color: var(--text-main);
  white-space: pre-line;
}

.modul-key-list {
  padding-left: 20px;
  font-size: 0.91rem;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modul-latihan-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.modul-latihan-answer {
  background: var(--success-bg);
  border: 1px solid var(--success);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 8px;
}

.modul-discussions-section {
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
  margin-top: 6px;
}

.modul-discussions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
}

.modul-discussions-body {
  margin-top: 12px;
}

.modul-discussion-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modul-discussion-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.modul-discussion-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.modul-discussion-question {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 10px;
  color: var(--text-main);
  white-space: pre-line;
}

.modul-discussion-key {
  background: var(--success-bg);
  border: 1px solid var(--success);
  color: var(--text-main);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.modul-discussion-key strong {
  color: var(--success);
}

.modul-discussion-explanation {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--ut-blue-light);
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-main);
}

.flashcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.flashcard-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
}

.flashcard-item:hover {
  border-color: var(--ut-blue-light);
}

.flashcard-item.flipped {
  background: var(--bg-subtle);
  border-color: var(--ut-blue-light);
}

.essay-textarea {
  width: 100%;
  min-height: 160px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease;
}

.essay-textarea:focus {
  border-color: var(--border-focus);
}

/* ----------------------------------------------------------------------------
   11. MOBILE BOTTOM APP BAR & FLOATING ACTION DOCK
   ---------------------------------------------------------------------------- */
.mobile-bottom-bar {
  display: none;
}

.mobile-quiz-dock {
  display: none;
}

/* MOBILE BOTTOM SHEET DRAWER */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.mobile-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 82vh;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  border-radius: 20px 20px 0 0;
  padding: 14px 18px calc(24px + env(safe-area-inset-bottom, 0));
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3);
}

.mobile-drawer-overlay.active .mobile-drawer-sheet {
  transform: translateY(0);
}

.drawer-handle-bar {
  width: 44px;
  height: 5px;
  background: var(--border-color);
  border-radius: 999px;
  margin: 0 auto 14px;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.drawer-header h4 {
  font-size: 1.05rem;
  font-weight: 700;
}

.drawer-close-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}

.drawer-stats-bar {
  display: flex;
  gap: 12px;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-radius: 8px;
  margin-bottom: 14px;
}

/* ----------------------------------------------------------------------------
   12. RESPONSIVE MOBILE OPTIMIZATION (< 860px) - FOKUS SOAL & PEMBAHASAN
   ---------------------------------------------------------------------------- */
@media (max-width: 860px) {
  body {
    padding-bottom: 72px;
  }

  .container {
    padding: 8px 12px 85px;
    margin: 4px auto;
    max-width: 100%;
  }

  /* 1. HIDE ALL DESKTOP CLUTTER ON MOBILE */
  .desktop-practice-controls,
  .desktop-quiz-actions,
  .course-selector-bar,
  .desktop-only-badge,
  .hero-banner,
  .student-pill,
  .cat-layout .card:last-child {
    display: none !important;
  }

  /* 2. MAIN PRACTICE CARD: BORDERLESS & CLEAN */
  .practice-main-card {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
  }

  /* 3. SLEEK COMPACT 1-LINE MOBILE STUDY BAR */
  .mobile-study-bar {
    display: flex !important;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
  }

  .mobile-select-course,
  .mobile-select-module {
    flex: 1;
    height: 38px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 600;
    outline: none;
    max-width: 50%;
    text-overflow: ellipsis;
    box-shadow: var(--shadow-sm);
  }

  /* 4. COMPACT TOPBAR */
  .topbar {
    padding: 10px 14px;
    gap: 8px;
  }

  .brand-wrap {
    gap: 8px;
  }

  .ut-badge-logo {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 8px;
  }

  .brand-title h1 {
    font-size: 0.94rem;
  }

  .brand-title p {
    display: none;
  }

  .theme-toggle-label {
    font-size: 0.75rem;
  }

  .theme-toggle-btn {
    padding: 5px 10px;
    min-height: 32px;
  }

  /* 5. QUESTION CARD & OPTIONS FOCUS */
  .cat-layout {
    grid-template-columns: 1fr !important;
  }

  .question-box {
    padding: 16px;
    font-size: 1.04rem;
    line-height: 1.65;
    border-radius: 12px;
    margin-bottom: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
  }

  .options-list {
    gap: 10px;
    margin-bottom: 14px;
  }

  .option-btn {
    padding: 13px 16px;
    font-size: 0.94rem;
    min-height: 50px;
    border-radius: 12px;
    gap: 12px;
    background: var(--bg-card);
  }

  .option-letter {
    width: 26px;
    height: 26px;
    font-size: 0.82rem;
  }

  /* 6. FOCUSED EXPLANATION CARD */
  .explanation-card {
    border-radius: 12px;
    padding: 16px;
    margin-top: 10px;
    margin-bottom: 14px;
    font-size: 0.92rem;
    line-height: 1.65;
  }

  /* 7. FLOATING MOBILE QUIZ DOCK */
  .mobile-quiz-dock {
    display: flex;
    position: sticky;
    bottom: 64px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 6px 8px;
    margin-top: 14px;
    margin-bottom: 6px;
    box-shadow: var(--shadow-lg);
    z-index: 950;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .mobile-quiz-dock .btn {
    padding: 9px 10px;
    font-size: 0.82rem;
    flex: 1;
    min-height: 40px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
  }

  /* 8. HIDE DESKTOP NAV; SHOW MOBILE BOTTOM DOCK */
  .main-nav {
    display: none;
  }

  .mobile-bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .mob-tab {
    background: none;
    border: none;
    border-top: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px;
    flex: 1;
    height: 100%;
    transition: all 0.15s ease;
  }

  .mob-tab-code {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    opacity: 0.75;
    line-height: 1;
  }

  .mob-tab.active {
    color: var(--ut-blue-light);
    border-top-color: var(--ut-blue-light);
  }

  .mob-tab.active .mob-tab-code {
    opacity: 1;
    color: var(--ut-blue-light);
  }

  .mob-tab.active .mob-tab-label {
    color: var(--ut-blue-light);
    font-weight: 800;
  }

  .filter-toolbar {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .modul-view-toolbar > div:first-child {
    display: none;
  }

  .modul-toolbar-actions {
    width: 100%;
  }

  .modul-toolbar-actions .search-input {
    flex: 1;
    min-width: 0 !important;
  }

  .module-card {
    padding: 14px;
    border-radius: 12px;
  }

  .kb-breakdown-grid {
    grid-template-columns: 1fr;
  }

  .modul-discussion-item {
    padding: 12px;
  }
}

/* CONFETTI CANVAS */
#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}
