/* shared/shell.css — MEA Study
   Kerangka bersama untuk semua halaman di bawah /home/*:
   sidebar collapsible (desktop) + bottom nav (mobile) + permukaan
   glass minimalis (ala Fluent Design / Notion), memakai token warna
   dari study.css — tidak mendefinisikan palet baru. */

:root {
  --shell-sidebar-w: 220px;
  --shell-sidebar-w-collapsed: 64px;
  --shell-topbar-h: 56px;
  --shell-bottomnav-h: 60px;

  --glass-bg: rgba(22, 22, 22, 0.55);      /* selaras --mea-surface + alpha, sama seperti Hub/Landing/Auth */
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 16px;
}

/* ── Topbar brand (logo + "MEA STUDY") ──────────────────────── */
.topbar-brandlink {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.topbar-brandlink .brand-logo {
  height: 22px;
  width: auto;
  display: block;
}
.topbar-brandlink .brand-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--text);
  line-height: 1;
}

/* ── Topbar notification bell ────────────────────────────────── */
.topbar-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: transparent;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.topbar-bell:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.topbar-bell .bell-dot {
  position: absolute;
  top: 6px; right: 7px;
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--red);
  border: 1.5px solid var(--bg);
  display: none;
}
.topbar-bell.has-unread .bell-dot { display: block; }

/* ── Topbar user (avatar + display name) ─────────────────────── */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-dim); border: 1px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--accent);
  overflow: hidden; flex-shrink: 0;
  background-size: cover; background-position: center;
}
.topbar-username {
  font-size: 13px; font-weight: 600; color: var(--text);
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 480px) {
  .topbar-username { display: none; }
}

/* ── Shell layout ─────────────────────────────────────────────── */
.shell {
  display: flex;
  min-height: 100vh;
  padding-top: var(--shell-topbar-h);
}

/* ── Sidebar (desktop) ───────────────────────────────────────── */
.shell-sidebar {
  position: fixed;
  top: var(--shell-topbar-h);
  left: 0;
  bottom: 0;
  width: var(--shell-sidebar-w);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 16px 10px;
  gap: 2px;
  transition: width .18s ease;
  z-index: 20;
}
.shell.is-collapsed .shell-sidebar { width: var(--shell-sidebar-w-collapsed); }

.shell-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  transition: background .15s ease, color .15s ease, transform .1s ease;
}
.shell-nav-item:not(.is-disabled):hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.shell-nav-item:not(.is-disabled):active {
  transform: scale(0.97);
  background: rgba(255,255,255,0.12);
}
.shell-nav-item.is-active {
  background: var(--accent-dim, rgba(0,212,255,0.1));
  color: var(--accent);
}
.shell-nav-item.is-active:hover {
  background: var(--accent-dim, rgba(0,212,255,0.14));
  color: var(--accent);
}
.shell-nav-item.is-active:active {
  transform: scale(0.97);
}
.shell-nav-item .icon { flex-shrink: 0; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.shell-nav-item .label { transition: opacity .15s ease; }
.shell.is-collapsed .shell-nav-item .label { opacity: 0; width: 0; }

.shell-nav-item.is-disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}
.shell-nav-item .soon-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--text-3);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 2px 6px;
  flex-shrink: 0;
}
.shell.is-collapsed .soon-badge { display: none; }

.shell-collapse-btn {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-3);
  cursor: pointer;
  font-size: 12px;
}
.shell-collapse-btn:hover { color: var(--text-2); background: rgba(255,255,255,0.04); }

/* ── Main content area ───────────────────────────────────────── */
.shell-main {
  flex: 1;
  margin-left: var(--shell-sidebar-w);
  margin-top: -16px;
  transition: margin-left .18s ease;
  padding: 0 24px 40px;
  min-width: 0;
}
.shell.is-collapsed .shell-main { margin-left: var(--shell-sidebar-w-collapsed); }

/* ── Glass surface — dipakai untuk kartu statistik, panel, dll ─ */
.glass-surface {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

/* ── Mobile: sidebar off, bottom nav on ─────────────────────── */
.shell-bottomnav {
  display: none;
}

@media (max-width: 860px) {
  .shell-sidebar { display: none; }
  .shell-main { margin-left: 0; padding: 20px 16px calc(var(--shell-bottomnav-h) + 24px); }

  .shell-bottomnav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: var(--shell-bottomnav-h);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-top: 1px solid var(--glass-border);
    z-index: 30;
  }
  .shell-bottomnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-3);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: color .15s ease, transform .1s ease;
  }
  .shell-bottomnav-item .icon { width: 20px; height: 20px; }
  .shell-bottomnav-item.is-active { color: var(--accent); }
  .shell-bottomnav-item:not(.is-disabled):active { transform: scale(0.92); }
  .shell-bottomnav-item.is-disabled { opacity: 0.4; pointer-events: none; }
}

@media (prefers-reduced-motion: reduce) {
  .shell-sidebar, .shell-main, .shell-nav-item .label { transition: none; }
}
