/* ===== Atiga Modern Design System ===== */
:root {
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --bg: #f8fafc;
  --page-bg: #f1f5f9;
  --card: #ffffff;
  --card-border: #e2e8f0;
  --text: #0f172a;
  --sub: #475569;
  --muted: #64748b;
  
  /* Header & Footer inspired by mgmpmtksmp-lamteng.blogspot.com (#096a71) */
  --nav-bg: rgba(9, 106, 113, 0.95);
  --nav-text: #ffffff;
  --nav-border: rgba(255, 255, 255, 0.15);
  
  --footer-bg: #096a71;
  --footer-text: rgba(255, 255, 255, 0.88);
  --footer-border: rgba(255, 255, 255, 0.15);
  
  --brand-primary: #096a71;
  --brand-accent: #25aa9e;
  --brand-gradient: linear-gradient(135deg, #096a71 0%, #25aa9e 50%, #10b981 100%);
  --btn-bg: #096a71;
  --btn-hover: #07565c;
  --btn-text: #ffffff;
  
  --teal: #096a71;
  --teal-light: rgba(9, 106, 113, 0.1);
  --indigo-light: rgba(9, 106, 113, 0.08);
  --amber-light: rgba(245, 158, 11, 0.1);
  --rose-light: rgba(244, 63, 94, 0.1);
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 30px -10px rgba(9, 106, 113, 0.18), 0 10px 15px -5px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

[data-theme="dark"] {
  --bg: #0b0f19;
  --page-bg: #0f172a;
  --card: #1e293b;
  --card-border: #334155;
  --text: #f8fafc;
  --sub: #94a3b8;
  --muted: #64748b;
  
  --nav-bg: rgba(7, 86, 92, 0.96);
  --nav-text: #ffffff;
  --nav-border: rgba(255, 255, 255, 0.12);
  
  --footer-bg: #07565c;
  --footer-text: #cbd5e1;
  --footer-border: #1e293b;
  
  --btn-bg: #14b8a6;
  --btn-hover: #0d9488;
  --btn-text: #ffffff;
  
  --teal: #14b8a6;
  --teal-light: rgba(20, 184, 166, 0.15);
  --indigo-light: rgba(20, 184, 166, 0.15);
  --amber-light: rgba(245, 158, 11, 0.15);
  --rose-light: rgba(244, 63, 94, 0.15);
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 30px -10px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: var(--font-family);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Deep Teal Navbar ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--nav-border);
  padding: 14px 0;
  transition: all 0.3s ease;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 20px;
  color: var(--nav-text);
  letter-spacing: -0.02em;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  font-size: 20px;
}

.brand-text {
  color: #ffffff;
  font-weight: 800;
}

/* Navbar Search Component */
.nav-search {
  position: relative;
  flex: 1;
  max-width: 280px;
  margin: 0 16px;
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  gap: 8px;
  transition: all 0.2s ease;
}

.search-box:focus-within {
  background: rgba(255, 255, 255, 0.25);
  border-color: #5eead4;
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.2);
}

.search-ico {
  font-size: 13px;
  opacity: 0.85;
  color: #ffffff;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
}

.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.search-clear-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s ease;
}

.search-clear-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
}

/* Search Dropdown Results */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 280px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 1100;
  padding: 6px;
}

.search-item {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--card-border);
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover,
.search-item.selected {
  background: var(--teal-light);
}

.si-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.si-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.si-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.si-desc {
  font-size: 12px;
  color: var(--sub);
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-item mark {
  background: rgba(94, 234, 212, 0.35);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

.search-empty {
  padding: 14px 10px;
  text-align: center;
  font-size: 13px;
  color: var(--sub);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
  padding: 4px 0;
}

.nav-links a:hover {
  color: #ffffff;
}

.nav-links a.active {
  color: #5eead4;
  font-weight: 700;
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: #5eead4;
  border-radius: 2px;
}

.dark-toggle {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-radius: var(--radius-md);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dark-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* ===== Main & Hero Section ===== */
main {
  min-height: calc(100vh - 160px);
  background: var(--page-bg);
  padding-bottom: 60px;
}

.hero {
  text-align: center;
  padding: 64px 20px 48px;
  max-width: 860px;
  margin: 0 auto;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--teal-light);
  color: var(--teal);
  border: 1px solid rgba(9, 106, 113, 0.2);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
}

[data-theme="dark"] .hero-pill {
  color: #5eead4;
}

.hero h1 {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--text);
}

.gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--sub);
  font-size: 18px;
  max-width: 680px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--btn-bg);
  color: var(--btn-text);
  padding: 13px 28px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 20px -5px rgba(9, 106, 113, 0.35);
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -5px rgba(9, 106, 113, 0.45);
}

.btn-secondary-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--card);
  color: var(--text);
  padding: 13px 24px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  border: 1px solid var(--card-border);
  transition: all 0.2s ease;
}

.btn-secondary-outline:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--teal-light);
}

/* ===== Feature Stats Bar ===== */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-top: 10px;
  box-shadow: var(--shadow-sm);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--teal-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-val {
  font-weight: 800;
  font-size: 16px;
  color: var(--text);
}

.stat-lbl {
  font-size: 12px;
  color: var(--sub);
  font-weight: 500;
}

/* ===== Card Grid System ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  padding-bottom: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(9, 106, 113, 0.4);
}

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

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: var(--teal-light);
  transition: transform 0.2s ease;
}

.card:hover .card-icon {
  transform: scale(1.1);
}

.card-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  background: var(--teal-light);
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

[data-theme="dark"] .card-tag {
  color: #5eead4;
}

.card h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.card p {
  color: var(--sub);
  font-size: 14px;
  line-height: 1.6;
  flex-grow: 1;
}

.card-footer {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
  color: var(--brand-primary);
}

[data-theme="dark"] .card-footer {
  color: #5eead4;
}

/* ===== Content Page Styling ===== */
.page-head {
  background: var(--card);
  border-bottom: 1px solid var(--card-border);
  padding: 32px 0 28px;
  margin-bottom: 24px;
}

.page-head h1 {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-top: 8px;
}

.crumb {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.crumb a {
  color: var(--sub);
  text-decoration: none;
  transition: color 0.2s;
}

.crumb a:hover {
  color: var(--brand-primary);
}

.content-wrap {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  font-size: 16px;
  line-height: 1.75;
}

.content-wrap h2 {
  color: var(--text);
  margin: 28px 0 14px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.content-wrap p {
  margin: 14px 0;
  color: var(--text);
}

/* Callouts & Formulas */
.callout {
  padding: 18px 22px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  border-left: 4px solid var(--brand-primary);
  background: var(--teal-light);
  font-size: 15px;
}

.callout-rumus {
  border-left-color: var(--teal);
  background: var(--teal-light);
}

.callout-catatan {
  border-left-color: #f59e0b;
  background: var(--amber-light);
}

.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px 0;
}

/* CBT & Quiz Styles */
.quiz-start {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 48px 24px;
  box-shadow: var(--shadow);
}

.timer {
  font-size: 18px;
  font-weight: 800;
  color: var(--teal);
  background: var(--teal-light);
  padding: 10px 20px;
  border-radius: 50px;
  display: inline-block;
  margin-bottom: 24px;
}

.question {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.question p {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 14px;
}

.question label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  margin: 8px 0;
  background: var(--page-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 15px;
}

.question label:hover {
  border-color: var(--brand-primary);
  background: var(--teal-light);
}

.question label:has(input:checked) {
  border-color: var(--brand-primary);
  background: var(--teal-light);
  font-weight: 700;
}

.result {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 44px 24px;
  box-shadow: var(--shadow-lg);
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  padding: 13px 30px;
  border-radius: var(--radius-md);
  font-size: 15px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--card-border);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--page-bg);
  border-color: var(--brand-primary);
}

/* ===== Deep Teal Footer (#096a71) ===== */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 28px 0;
  border-top: 1px solid var(--footer-border);
  transition: all 0.3s ease;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.footer-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  width: 100%;
}

.footer-text a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.footer-text a:hover {
  color: #ffffff;
  text-decoration: underline;
  opacity: 0.9;
}

/* ===== Bottom Navigation (mobile) ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--nav-border);
  padding: 8px 4px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(100%);
  transition: transform 0.25s ease;
  visibility: hidden;
}

.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 2px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.bn-ico {
  font-size: 20px;
  line-height: 1;
}

.bn-item.active {
  color: #5eead4;
  font-weight: 700;
}

.bn-item.active .bn-ico {
  transform: scale(1.15);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-search {
    max-width: 180px;
    margin: 0 8px;
  }
  .search-box {
    padding: 5px 10px;
  }
  .search-box input {
    font-size: 12px;
  }
  .hero h1 {
    font-size: 30px;
  }
  .hero p {
    font-size: 16px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .nav-links a[data-nav] {
    display: none;
  }
  .bottom-nav {
    transform: translateY(0);
    visibility: visible;
  }
  main {
    padding-bottom: 80px;
  }
  footer {
    display: none;
  }
}

