/* ============================================================
   Unggulify Learn - Main Stylesheet
   ============================================================ */

/* ─── CSS Variables (Light Theme) ──────────────────────────── */
:root {
  --primary:        #4f46e5;
  --primary-dark:   #4338ca;
  --primary-light:  #eef2ff;
  --secondary:      #06b6d4;
  --success:        #16a34a;
  --success-light:  #dcfce7;
  --danger:         #dc2626;
  --danger-light:   #fef2f2;
  --warning:        #d97706;
  --warning-light:  #fffbeb;
  --info:           #0284c7;
  --info-light:     #e0f2fe;

  --bg:             #f8fafc;
  --bg-card:        #ffffff;
  --bg-hover:       #f1f5f9;
  --border:         #e2e8f0;
  --border-strong:  #cbd5e1;

  --text:           #0f172a;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;

  --nav-height:     64px;
  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
  --shadow:         0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.12);
  --transition:     .2s ease;
}

/* ─── Dark Theme ─────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:             #0f172a;
  --bg-card:        #1e293b;
  --bg-hover:       #334155;
  --border:         #334155;
  --border-strong:  #475569;
  --text:           #f1f5f9;
  --text-muted:     #94a3b8;
  --text-light:     #64748b;
  --primary-light:  #1e1b4b;
  --success-light:  #14532d;
  --danger-light:   #7f1d1d;
  --warning-light:  #78350f;
  --info-light:     #0c4a6e;
}

/* ─── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main.main-content { flex: 1; padding-top: var(--nav-height); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ─── Container ─────────────────────────────────────────────── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 20px; }
.container-xs { width: 100%; max-width: 480px; margin: 0 auto; padding: 0 20px; }

/* ─── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-height);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), box-shadow var(--transition);
}
[data-theme="dark"] .navbar { background: rgba(15,23,42,.92); }
.navbar.scrolled { box-shadow: var(--shadow); }

.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-height); gap: 24px;
}

.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.brand-icon { font-size: 26px; }
.brand-name { font-size: 18px; font-weight: 700; color: var(--text); }

.nav-links {
  display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center;
}
.nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  transition: all var(--transition); text-decoration: none;
}
.nav-link:hover, .nav-link.active {
  background: var(--primary-light); color: var(--primary);
  text-decoration: none;
}

.navbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.btn-icon {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; transition: all var(--transition); color: var(--text);
}
.btn-icon:hover { background: var(--bg-hover); border-color: var(--border-strong); }

/* User Menu Dropdown */
.user-menu-wrap { position: relative; }
.user-avatar-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 5px; border-radius: 32px;
  border: 1px solid var(--border); background: var(--bg-card);
  cursor: pointer; transition: all var(--transition);
  font-size: 14px; font-weight: 500; color: var(--text);
}
.user-avatar-btn:hover { border-color: var(--primary); }
.avatar-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.avatar-placeholder {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.user-name-short { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 220px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all var(--transition); z-index: 100;
}
.user-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.dropdown-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.dropdown-email { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; font-size: 14px; color: var(--text);
  transition: background var(--transition); text-decoration: none;
}
.dropdown-item:hover { background: var(--bg-hover); text-decoration: none; }
.dropdown-item.text-danger { color: var(--danger); }
.dropdown-item.upgrade-link { color: var(--warning); font-weight: 600; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  width: 38px; height: 38px; padding: 8px;
  background: none; border: none;
}
.hamburger span {
  display: block; height: 2px; background: var(--text);
  border-radius: 2px; transition: all .3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 998;
}

/* ─── Nav More Dropdown (Desktop "Lainnya") ─────────────── */
.nav-more-wrap { position: relative; }
.nav-more-btn {
  background: none; border: none; cursor: pointer;
  font-family: inherit; letter-spacing: .04em;
}
.nav-more-btn.active { background: var(--primary-light); color: var(--primary); }
.nav-more-panel {
  position: absolute; top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  min-width: 200px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 200;
  opacity: 0; visibility: hidden; transform: translateX(-50%) translateY(-6px);
  transition: all .18s;
}
.nav-more-wrap:hover .nav-more-panel,
.nav-more-panel.open {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-more-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 14px; color: var(--text);
  text-decoration: none; transition: background .15s;
}
.nav-more-item:hover, .nav-more-item.active {
  background: var(--primary-light); color: var(--primary);
}

/* ─── Notifikasi Bell ─────────────────────────────────────── */
.notif-wrap { position: relative; }
.notif-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; transition: all .15s;
  padding: 0;
}
.notif-btn:hover { background: var(--bg-hover); border-color: var(--primary); }
.notif-badge {
  position: absolute; top: -3px; right: -3px;
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: 99px; display: none; align-items: center;
  justify-content: center; padding: 0 3px; line-height: 1;
  border: 1.5px solid var(--bg-card);
}
.notif-badge.show { display: flex; }
.notif-panel {
  display: none; position: absolute; top: calc(100% + 8px);
  right: -8px; width: 320px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  z-index: 9999; max-height: 440px; flex-direction: column; overflow: hidden;
}
.notif-panel.open { display: flex; }
.notif-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.notif-read-all {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--primary); font-weight: 600;
}
.notif-list { overflow-y: auto; flex: 1; max-height: 340px; }
.notif-empty { text-align: center; padding: 28px; color: var(--text-muted); font-size: 13px; }
.notif-panel-footer {
  padding: 10px 16px; border-top: 1px solid var(--border);
  text-align: center; font-size: 12px;
}
.notif-panel-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* ─── nav-label — sembunyikan teks di layar kecil ────────── */
.nav-label { display: inline; }
.d-desktop { display: inline; }

/* ─── Responsive Navbar ───────────────────────────────────── */
@media (max-width: 960px) {
  /* Kurangi gap navbar-actions */
  .navbar-actions { gap: 6px; }
  .nav-label { display: none; }          /* Hanya ikon di nav utama */
  .user-name-short { display: none; }
  .notif-panel { right: -60px; width: 290px; }
  .nav-more-panel { display: none; }    /* Hanya avatar */
  .user-avatar-btn { padding: 3px; }
  .nav-link { padding: 7px 10px; font-size: 13px; }
}



/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; white-space: nowrap; line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(79,70,229,.3); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,.4); }
.btn-secondary { background: var(--bg-hover); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.card-subtitle { font-size: 13px; color: var(--text-muted); }

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
}
.badge-admin { background: #1e1b4b; color: #a5b4fc; }
.badge-team  { background: #14532d; color: #86efac; }
.badge-pro   { background: #78350f; color: #fcd34d; }
.badge-free  { background: var(--bg-hover); color: var(--text-muted); }

/* ─── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 6px; color: var(--text);
}
.form-control {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--bg-card); outline: none;
  transition: border var(--transition), box-shadow var(--transition);
  appearance: none; -webkit-appearance: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: 13px 16px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 18px; border: 1px solid transparent;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: var(--success-light); border-color: #bbf7d0; color: #166534; }
.alert-danger   { background: var(--danger-light);  border-color: #fecaca; color: var(--danger); }
.alert-warning  { background: var(--warning-light); border-color: #fde68a; color: #92400e; }
.alert-info     { background: var(--info-light);    border-color: #bae6fd; color: #075985; }

/* ─── Toast ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
  max-width: 340px;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: flex-start; gap: 12px;
  animation: toastIn .3s ease;
  font-size: 14px;
}
.toast.removing { animation: toastOut .3s ease forwards; }
.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--danger);  }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info    { border-left: 4px solid var(--info);    }
.toast-icon  { font-size: 18px; flex-shrink: 0; }
.toast-body  { flex: 1; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-msg   { color: var(--text-muted); font-size: 13px; line-height: 1.4; }
.toast-close { background: none; border: none; color: var(--text-muted); font-size: 18px; padding: 0; cursor: pointer; flex-shrink: 0; }
@keyframes toastIn  { from { opacity:0; transform: translateX(100%); } to { opacity:1; transform: translateX(0); } }
@keyframes toastOut { from { opacity:1; transform: translateX(0); }  to { opacity:0; transform: translateX(100%); } }

/* ─── Section / Page ──────────────────────────────────────────── */
.page-header {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.page-title { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.page-subtitle { font-size: 14px; color: var(--text-muted); }
.section { padding: 64px 0; }
.section-title { font-size: 28px; font-weight: 800; text-align: center; margin-bottom: 12px; }
.section-subtitle { text-align: center; color: var(--text-muted); max-width: 560px; margin: 0 auto 48px; }

/* ─── Grid Utilities ─────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ─── Loading Spinner ────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 360px; margin: 0 auto 20px; }

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; visibility: hidden; transition: all .25s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-card); border-radius: var(--radius-lg);
  width: 100%; max-width: 500px; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  transform: scale(.95); transition: transform .25s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 22px;
  color: var(--text-muted); cursor: pointer; padding: 0;
}
.modal-body  { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ─── Table ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: var(--bg-card); }
thead { background: var(--bg-hover); }
th, td { padding: 12px 16px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }

/* ─── Auth Pages ─────────────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - var(--nav-height));
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}
.auth-title { font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text-muted); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.btn-google {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all var(--transition); color: var(--text); font-family: inherit;
}
.btn-google:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.google-icon { width: 20px; height: 20px; }

/* ─── Footer ─────────────────────────────────────────────────── */
.footer {
  background: var(--bg-card); border-top: 1px solid var(--border);
  padding: 48px 0 24px; margin-top: auto;
}
.footer-grid {
  display: grid; grid-template-columns: 1fr 2fr;
  gap: 40px; margin-bottom: 40px;
}
.footer-logo { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.footer-tagline { font-size: 13px; color: var(--text-muted); line-height: 1.6; max-width: 240px; }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-col h4 { font-size: 13px; font-weight: 700; margin-bottom: 12px; color: var(--text); text-transform: uppercase; letter-spacing: .05em; }
.footer-col a { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; transition: color var(--transition); }
.footer-col a:hover { color: var(--primary); text-decoration: none; }
.footer-bottom {
  padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-muted); flex-wrap: wrap; gap: 10px;
}

/* ─── Landing Page ────────────────────────────────────────────── */
.hero {
  padding: 100px 0 80px;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg) 60%);
  text-align: center;
}
.hero-title {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900; line-height: 1.15;
  max-width: 760px; margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--text-muted); max-width: 560px; margin: 0 auto 36px;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 40px; justify-content: center; flex-wrap: wrap;
  margin-top: 56px;
}
.hero-stat { text-align: center; }
.hero-stat-number { font-size: 28px; font-weight: 800; color: var(--primary); }
.hero-stat-label  { font-size: 13px; color: var(--text-muted); }

/* Feature Cards */
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  transition: all var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.feature-icon { font-size: 36px; margin-bottom: 16px; }
.feature-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.feature-desc { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* Pricing Cards */
.pricing-card {
  background: var(--bg-card); border: 2px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  text-align: center; transition: all var(--transition); position: relative;
}
.pricing-card.featured { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.pricing-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff;
  padding: 4px 16px; border-radius: 99px; font-size: 12px; font-weight: 700;
}
.pricing-name  { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.pricing-price { font-size: 32px; font-weight: 900; color: var(--primary); }
.pricing-price sup { font-size: 16px; vertical-align: top; margin-top: 6px; }
.pricing-period { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.pricing-features { text-align: left; margin-bottom: 28px; }
.pricing-features li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-features li.check::before { content: '✅'; flex-shrink: 0; }
.pricing-features li.cross::before { content: '❌'; flex-shrink: 0; }

/* ─── Ads ────────────────────────────────────────────────────── */
.ad-unit { margin: 16px 0; text-align: center; }
.ad-unit img { max-width: 100%; border-radius: var(--radius-sm); }

/* ─── Blurred/Hidden (Bank Soal limit) ──────────────────────── */
.content-blurred {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
  position: relative;
}
.upgrade-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(248,250,252,.7);
  border-radius: var(--radius);
  flex-direction: column; gap: 10px;
  text-align: center; padding: 20px;
}
[data-theme="dark"] .upgrade-overlay { background: rgba(15,23,42,.7); }

/* ─── Floating Action Bar ────────────────────────────────────── */
.fab-bar {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 99px; padding: 10px 20px;
  box-shadow: var(--shadow-lg);
  display: flex; gap: 10px; align-items: center;
  z-index: 100; animation: fabIn .3s ease;
  flex-wrap: wrap; justify-content: center;
}
@keyframes fabIn { from { opacity:0; transform: translateX(-50%) translateY(20px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }

/* ─── Question Card ──────────────────────────────────────────── */
.question-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
  transition: box-shadow var(--transition);
}
.question-card:hover { box-shadow: var(--shadow); }
.question-number { font-size: 12px; font-weight: 700; color: var(--primary); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .08em; }
.question-text { font-size: 15px; line-height: 1.7; margin-bottom: 16px; }
.options-list { display: flex; flex-direction: column; gap: 8px; }
.option-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); font-size: 14px;
  cursor: pointer; transition: all var(--transition);
}
.option-item:hover { border-color: var(--primary); background: var(--primary-light); }
.option-item.correct { border-color: var(--success); background: var(--success-light); color: #166534; }
.option-item.wrong   { border-color: var(--danger); background: var(--danger-light); }
.option-key {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-hover); display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 700;
  flex-shrink: 0; color: var(--text-muted);
}
.option-item.correct .option-key { background: var(--success); color: #fff; }
.explanation {
  margin-top: 14px; padding: 12px 14px;
  background: var(--info-light); border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.6; color: #075985;
  border-left: 4px solid var(--info);
}
[data-theme="dark"] .explanation { color: #bae6fd; }

/* ─── Admin Sidebar ──────────────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - var(--nav-height)); }
.admin-sidebar {
  background: var(--bg-card); border-right: 1px solid var(--border);
  padding: 24px 16px; position: sticky; top: var(--nav-height); height: calc(100vh - var(--nav-height)); overflow-y: auto;
}
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  transition: all var(--transition); text-decoration: none; margin-bottom: 2px;
}
.admin-nav-item:hover, .admin-nav-item.active { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.admin-content { padding: 32px; }

/* ─── Stats Card (Admin) ─────────────────────────────────────── */
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; align-items: center; gap: 16px;
}
.stat-icon { font-size: 36px; flex-shrink: 0; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ─── Profile Grid (responsive) ──────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hamburger { display: flex; }

  /* ── Fix Bug 2: Hamburger menu full-screen, tidak terpotong ── */
  .nav-links {
    position: fixed;
    /* top tepat di bawah navbar */
    top: var(--nav-height);
    left: 0;
    right: 0;
    /* Gunakan 100dvh agar aman di mobile browser dengan address bar */
    height: calc(100dvh - var(--nav-height));
    /* Fallback untuk browser lama yang belum support dvh */
    height: calc(100vh - var(--nav-height));
    width: 100%;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 16px;
    gap: 4px;
    z-index: 999;
    /* Scroll di dalam menu jika konten panjang */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    transition: transform .3s ease;
    /* Pastikan tidak ada clipping dari parent */
    box-sizing: border-box;
  }
  .nav-links.open { transform: translateX(0); }
  /* Saat hamburger terbuka: tampilkan label teks penuh */
  .nav-links.open .nav-label { display: inline !important; }
  .nav-links.open .nav-link { font-size: 15px; padding: 12px 20px; gap: 10px; }
  .nav-overlay.show { display: block; }
  .nav-link {
    width: 100%;
    padding: 13px 16px;
    font-size: 15px;
    border-radius: var(--radius-sm);
    box-sizing: border-box;
  }

  /* ── Fix Bug 3: Profile grid kolaps ke 1 kolom di mobile ── */
  .profile-grid { grid-template-columns: 1fr; }

  .user-name-short { display: none; }
  .notif-panel { right: -60px; width: 290px; }
  .nav-more-panel { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { padding: 60px 0 50px; }
  .hero-stats { gap: 24px; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .auth-card { padding: 28px 20px; }
  .fab-bar { bottom: 16px; left: 16px; right: 16px; transform: none; border-radius: var(--radius-lg); }

  /* Toast lebih kecil di mobile */
  #toast-container { bottom: 16px; right: 12px; left: 12px; max-width: 100%; }
}

@media (max-width: 480px) {
  .footer-links { grid-template-columns: 1fr; }
  .modal { border-radius: var(--radius) var(--radius) 0 0; position: fixed; bottom: 0; margin: 0; max-height: 85vh; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  /* Halaman auth lebih nyaman di layar kecil */
  .auth-wrap { padding: 20px 12px; }
  .auth-card { padding: 24px 16px; }
  /* Container tidak overflow */
  .container, .container-sm, .container-xs { padding: 0 12px; }
}

/* ─── Bank Soal Options Toggle ──────────────────────────── */
.options-block {
  transition: opacity .2s ease;
}
.options-block[style*="none"] {
  display: none;
}
