/* ============================================================
   EduCore — Sidebar & Topbar Stylesheet
   File: css/layout.css
   Purpose: Sidebar navigation, topbar header, user panel.
   ============================================================ */

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100vh; position: fixed; left: 0; top: 0;
  z-index: 100; transition: transform .3s ease;
}

.sidebar-logo {
  padding: 20px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.logo-text        { font-size: 18px; font-weight: 800; letter-spacing: -.5px; }
.logo-text span   { color: var(--accent); }

/* ── NAV SCROLL AREA ──────────────────────────────────────── */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar-nav::-webkit-scrollbar       { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── NAV LABELS ───────────────────────────────────────────── */
.nav-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text3); padding: 12px 12px 6px;
}

/* ── NAV ITEMS ────────────────────────────────────────────── */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text2); font-size: 13.5px; font-weight: 500;
  transition: all .2s; position: relative; user-select: none;
}
.nav-item:hover  { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(79,142,247,.12); color: var(--accent); }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-item svg    { width: 16px; height: 16px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
}
.nav-expand             { margin-left: auto; transition: transform .2s; }
.nav-expand.open        { transform: rotate(90deg); }

/* ── SUB-NAV ──────────────────────────────────────────────── */
.sub-nav            { overflow: hidden; max-height: 0; transition: max-height .3s ease; }
.sub-nav.open       { max-height: 400px; }
.sub-nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 38px; cursor: pointer;
  color: var(--text3); font-size: 13px; font-weight: 500;
  border-radius: var(--radius-sm); transition: all .2s;
}
.sub-nav-item:hover       { color: var(--text); background: var(--surface2); }
.sub-nav-item.active      { color: var(--accent); }
.sub-nav-item::before     { content: '·'; font-size: 18px; line-height: 1; }

/* ── SIDEBAR USER PANEL ───────────────────────────────────── */
.sidebar-user {
  padding: 14px 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.user-info      { flex: 1; min-width: 0; }
.user-name      { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role      { font-size: 11px; color: var(--text3); }

/* ── TOPBAR ───────────────────────────────────────────────── */
.topbar {
  height: var(--header-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 50; flex-shrink: 0;
}
.topbar-breadcrumb       { font-size: 13px; color: var(--text2); }
.topbar-breadcrumb strong{ color: var(--text); font-weight: 600; }
.topbar-spacer           { flex: 1; }
.topbar-search {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 14px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text3); font-size: 13px; width: 220px; cursor: text;
}
.topbar-search svg { width: 14px; height: 14px; }
.topbar-btn {
  width: 36px; height: 36px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2); position: relative; transition: all .2s;
}
.topbar-btn:hover { background: var(--border); color: var(--text); }
.notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; background: var(--danger);
  border-radius: 50%; border: 2px solid var(--surface);
}

/* ── MOBILE SIDEBAR TOGGLE ────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar         { transform: translateX(-100%); }
  .sidebar.open    { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.5); }
}
