/* ============================================================
   HEADSTART — SHARED SIDEBAR STYLES
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@700;800&family=Inter:wght@300;400;500;600&display=swap');

/* Shell */
.dashboard-shell { display: flex; min-height: 100vh; overflow: hidden; height: 100vh; }

/* ── Sidebar ── */
.learn-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 0 24px 24px 0;
  display: flex;
  flex-direction: column;
  padding: 32px 0 28px;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 200;
  box-shadow: 4px 0 24px rgba(0,0,0,0.04);
  transition: width 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* Logo */
.sidebar-logo {
  padding: 0 20px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-logo-text {
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: #111;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.sidebar-logo-text span { color: #00c67a; }

/* Logo image */
.sidebar-logo-link {
  display: flex;
  align-items: center;
  overflow: hidden;
  scale: 150%;
  min-width: 100px;
  padding: 0 28px;
  width: 100%;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.15s;
}
.sidebar-logo-link:hover { background: #f5f5f5; }
.sidebar-logo-img {
  height: 22px;
  width: auto;
  display: block;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
  max-width: 160px;
  transition: opacity 0.2s, max-width 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* Collapse button */
.sidebar-collapse-btn {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #f5f5f5;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #888; flex-shrink: 0;
  transition: all 0.18s;
}
.sidebar-collapse-btn svg { transition: transform 0.25s cubic-bezier(0.4,0,0.2,1); }
.sidebar-collapse-btn:hover { background: #ebebeb; color: #111; }

/* Collapsed state */
.learn-sidebar.collapsed { width: 68px; }
.learn-sidebar.collapsed .sidebar-logo-text,
.learn-sidebar.collapsed .sidebar-profile-info,
.learn-sidebar.collapsed .sidebar-nav-item span:not(.sidebar-nav-icon) { display: none; }
.learn-sidebar.collapsed .sidebar-logo { padding: 0 0 28px; justify-content: center; }
.learn-sidebar.collapsed .sidebar-collapse-btn { margin: 0 auto; }
.learn-sidebar.collapsed .sidebar-nav { padding: 0 10px; }
.learn-sidebar.collapsed .sidebar-bottom { padding: 0 10px; }
.learn-sidebar.collapsed .sidebar-nav-item { justify-content: center; padding: 12px; }
.learn-sidebar.collapsed .sidebar-nav-item.active::before { display: none; }
.learn-sidebar.collapsed .sidebar-divider { margin: 10px 12px; }
.learn-sidebar.collapsed .sidebar-profile { padding: 0 0 16px; justify-content: center; }

/* Nav */
.sidebar-nav {
  flex: 1; display: flex; flex-direction: column;
  gap: 2px; padding: 0 16px;
}
.sidebar-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px;
  font-family: 'Inter', sans-serif; font-size: 13.5px; font-weight: 500;
  color: #888; text-decoration: none; cursor: pointer;
  transition: all 0.18s; position: relative;
  border: none; background: none; width: 100%; text-align: left;
}
.sidebar-nav-item:hover { background: #f5f5f5; color: #111; }
.sidebar-nav-item.active { background: #f5f5f5; color: #111; font-weight: 700; }
.sidebar-nav-item.active::before {
  content: ''; position: absolute;
  left: -16px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px;
  background: #f97316; border-radius: 0 4px 4px 0;
}
.sidebar-nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.6; }
.sidebar-nav-item.active .sidebar-nav-icon,
.sidebar-nav-item:hover .sidebar-nav-icon { opacity: 1; }

/* Divider */
.sidebar-divider { height: 1px; background: rgba(0,0,0,0.06); margin: 12px 16px; }

/* Bottom */
.sidebar-bottom { padding: 0 16px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-logout-item:hover { color: #e53935 !important; background: rgba(229,57,53,0.06) !important; }
.sidebar-signup-item { color: #00c67a !important; font-weight: 700 !important; }
.sidebar-signup-item:hover { background: rgba(0,198,122,0.08) !important; }

/* Profile */
.sidebar-profile { display: flex; align-items: center; gap: 10px; padding: 0 20px 20px; }
.sidebar-profile-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(145deg,#1a6bff,#0a3ecc);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Poppins',sans-serif; font-size: 13px; font-weight: 700;
  color: #fff; flex-shrink: 0;
}
.sidebar-profile-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sidebar-profile-name {
  font-family: 'Poppins',sans-serif; font-size: 13px; font-weight: 700;
  color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-profile-streak { font-family: 'Inter',sans-serif; font-size: 11px; color: #f97316; font-weight: 600; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .learn-sidebar { width: 64px; padding: 24px 0 20px; }
  .sidebar-logo { padding: 0 0 28px; justify-content: center; }
  .sidebar-logo-text,
  .sidebar-nav-item span:not(.sidebar-nav-icon),
  .sidebar-profile-info { display: none; }
  .sidebar-nav { padding: 0 8px; }
  .sidebar-nav-item { justify-content: center; padding: 12px; }
  .sidebar-nav-item.active::before { display: none; }
  .sidebar-bottom { padding: 0 8px; }
  .sidebar-profile { padding: 0 0 16px; justify-content: center; }
}

/* ── Mobile: sidebar becomes a slide-in drawer ── */
@media (max-width: 600px) {
  /* Hide the icon-only sidebar — replaced by drawer */
  .learn-sidebar {
    width: 260px !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s;
    z-index: 400;
    border-radius: 0 24px 24px 0;
    /* restore full labels */
    padding: 28px 0 24px;
  }
  .learn-sidebar.mobile-open {
    transform: translateX(0);
  }
  /* Show full labels inside the drawer */
  .learn-sidebar .sidebar-logo-text,
  .learn-sidebar .sidebar-nav-item span:not(.sidebar-nav-icon),
  .learn-sidebar .sidebar-profile-info { display: flex !important; }
  .learn-sidebar .sidebar-logo { padding: 0 20px 32px; justify-content: space-between; }
  .learn-sidebar .sidebar-nav { padding: 0 16px; }
  .learn-sidebar .sidebar-nav-item { justify-content: flex-start; padding: 11px 14px; }
  .learn-sidebar .sidebar-nav-item.active::before { display: block; }
  .learn-sidebar .sidebar-bottom { padding: 0 16px; }
  .learn-sidebar .sidebar-profile { padding: 0 20px 20px; justify-content: flex-start; }

  /* Drawer backdrop */
  .mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 399;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .mobile-nav-backdrop.visible {
    opacity: 1;
    pointer-events: all;
  }

  /* Mobile top bar */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 300;
    flex-shrink: 0;
  }
  .mobile-topbar-logo {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    color: #111;
    letter-spacing: -0.02em;
    text-decoration: none;
  }
  .mobile-topbar-logo span { color: #00c67a; }
  .mobile-hamburger {
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.09);
    background: #f5f5f5;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #555;
    transition: background 0.15s;
  }
  .mobile-hamburger:hover { background: #ebebeb; color: #111; }
}

/* ── Offset page content to account for fixed sidebar ── */
/* .sidebar-page-offset  →  use on any non-dashboard page wrapper  */
/* .learn-main           →  used on the learn/dashboard page        */
.sidebar-page-offset,
.learn-main {
  margin-left: 220px;
  transition: margin-left 0.25s cubic-bezier(0.4,0,0.2,1);
}
.sidebar-page-offset.sidebar-collapsed,
.learn-main.sidebar-collapsed {
  margin-left: 68px;
}

/* ── Page content area (used when sidebar wraps arbitrary pages) ── */
.sidebar-page-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  height: 100vh;
}

@media (max-width: 900px) {
  .sidebar-page-offset, .learn-main { margin-left: 64px; }
  .sidebar-page-content { height: auto; overflow-y: visible; }
}
@media (max-width: 600px) {
  .sidebar-page-offset, .learn-main { margin-left: 0 !important; }
  .sidebar-page-content { margin-left: 0; }
}

/* Hide mobile topbar above 600px */
.mobile-topbar { display: none; }
.mobile-nav-backdrop { display: none; }