/* =======================================================
   assets/css/sidebar.css (FULL)
   - Sidebar + nav + auth-group only
   - Mobile drawer behavior included
   - ✅ Mobile-only fix: auth buttons lifted up
   - ✅ NEW: Active state = RED icon + RED name (no underline)
   - ✅ ADD: Desktop fixed sidebar (true sticky behavior)
   ======================================================= */

:root{
  --sidebar-width: 240px;
  --topbar-height: 80px;

  /* app width (from style.css) */
  --app-max-width: 1000px;

  /* mobile elements */
  --mobile-nav-height: 64px;
  --mobile-player-height: 72px;

  --text-dark: #1F2937;
  --text-gray: #6B7280;

  /* ✅ active color */
  --accent-red: #E50914;
}

/* =======================================================
   DESKTOP SIDEBAR (BASE)
   ======================================================= */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: #FFFFFF;
  padding: 30px 20px;

  /* keep existing look */
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));

  display: flex;
  flex-direction: column;
  border-right: 1px solid #E5E7EB;
  overflow-y: auto;

  align-self: flex-start;
}

/* =======================================================
   ✅ REAL FIX: DESKTOP = FIXED (always visible, not scrolling)
   - aligned to centered app-wrapper width
   - avoids "sticky not working" due to scroll containers
   ======================================================= */
@media (min-width: 901px){

  .sidebar{
    position: fixed !important;
    top: var(--topbar-height) !important;
    height: calc(100vh - var(--topbar-height)) !important;
    overflow-y: auto !important;
    z-index: 1200;

    /* ✅ align to centered container:
       left = max(0, 50% - appMax/2)
    */
    left: max(0px, calc(50% - (var(--app-max-width) / 2))) !important;
  }

  /* ✅ prevent overlap: push main-content to the right */
  .main-content{
    margin-left: var(--sidebar-width) !important;
  }
}

/* =======================================================
   NAV MENU
   ======================================================= */
.nav-menu {
  list-style: none;
  margin-bottom: 20px;
  padding: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  text-decoration: none;
  color: var(--text-gray);
  font-size: 0.9rem;
  border-radius: 6px;
  transition: 0.2s;
  margin-bottom: 4px;
}

/* icon sizes */
.nav-link svg {
  width: 22px !important;
  height: 25px !important;
  margin-right: 8px !important;
}

/* ✅ default SVG strokes */
.nav-link svg path,
.nav-link svg circle,
.nav-link svg rect,
.nav-link svg line,
.nav-link svg polyline,
.nav-link svg polygon {
  stroke: #7E808F;
  transition: stroke .15s ease, fill .15s ease;
}

/* =======================================================
   ✅ ACTIVE STATE (RED ICON + RED NAME)
   ======================================================= */
.nav-link:hover {
  background: #F3F4F6;
  color: var(--text-dark);
  font-weight: 600;
}

.nav-link.active {
  background: #F3F4F6;
  color: var(--accent-red) !important;
  font-weight: 700;
}

.nav-link.active svg path,
.nav-link.active svg circle,
.nav-link.active svg rect,
.nav-link.active svg line,
.nav-link.active svg polyline,
.nav-link.active svg polygon {
  stroke: var(--accent-red) !important;
}

/* =======================================================
   AUTH GROUP (DESKTOP DEFAULT)
   ======================================================= */
.auth-group {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-auth {
  display: block;
  width: 100%;
  text-align: center;
  padding: 8px;
  border: 1px solid #E5E7EB;
  border-radius: 50px;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.9rem;
}

.btn-auth:hover {
  background: #F3F4F6;
}

/* =======================================================
   MOBILE SIDEBAR DRAWER
   ======================================================= */
@media (max-width: 900px){

  .sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    height: calc(100vh - var(--topbar-height));
    width: 82%;
    max-width: 320px;
    min-width: 0;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    z-index: 1300;
    border-right: 1px solid #E5E7EB;
    box-shadow: 8px 0 20px rgba(0,0,0,0.10);
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  /* SAFE SPACE */
  #sidebar{
    padding-bottom: calc(
      var(--mobile-player-height) +
      var(--mobile-nav-height) +
      28px +
      env(safe-area-inset-bottom, 0px)
    ) !important;
  }

  /* MOVE AUTH BUTTONS UP */
  .auth-group{
    margin-bottom: calc(
      var(--mobile-player-height) +
      var(--mobile-nav-height) +
      16px +
      env(safe-area-inset-bottom, 0px)
    ) !important;
  }

  /* ✅ cancel desktop push on mobile */
  .main-content{
    margin-left: 0 !important;
  }
}

/* =========================================
   FLUSH EDGE FULL (CSS ONLY) — RECENT/FAVORITES
   Works even if IDs differ, basta naa .fav-item / .recent-item
   ========================================= */

.sidebar .fav-item,
.sidebar .recent-item{
  /* extend beyond sidebar padding (20px) */
  width: calc(100% + 40px) !important;
  margin-left: -20px !important;
  margin-right: -20px !important;

  /* clean row feel */
  padding: 10px 20px !important;
  border-radius: 0 !important;

  /* optional divider */
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.sidebar .fav-item:hover,
.sidebar .recent-item:hover{
  background: rgba(0,0,0,0.04);
}

