/* ===========================================
   SIDEBAR COMPONENT STYLES
   
   The sidebar is the left navigation panel.
   Contains icons for Home, Search, Library, Playlists, etc.
   Can expand/collapse using the hamburger menu toggle.
   =========================================== */

/* SIDEBAR CONTAINER
   Uses flexbox column to stack nav items vertically.
   The width is controlled by --sidebar-width variable in global.css */
.body-left.sidebar {
  background: var(--panel, #0b0b0b);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 10px 0;
  gap: 12px;
  overflow: hidden;              /* Hide content that exceeds width */
  border-right: 1px solid rgba(255, 255, 255, 0.05);  /* Matches topbar border style */
  border-radius: 0;              /* No rounded corners - prevents floating look */
  grid-row: 2 / 3;               /* Span from row 2 (after topbar) to row 3 (before player) */
  height: 100%;                  /* Fill the entire grid cell height */
}

/* HAMBURGER BUTTON (toggle sidebar expand/collapse)
   Three horizontal lines icon that toggles sidebar width */
.hamburger {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 12px 0;
  padding-left: 22px;
  font-size: 24px;
  color: #eee;
  cursor: pointer;
  border-radius: 0;
  transition: none;
}

.hamburger:hover {
  box-shadow: none;
  transform: none;
}

/* NAVIGATION CONTAINER
   Vertical list of nav items (icons + optional text labels) */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 25px;                     /* Space between nav items */
  margin-top: 10px;
  width: 100%;
}

/* NAV ITEM (icon + label)
   Each clickable item in the sidebar */
.sidebar-nav .side-icon {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 96%;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  /* Multiple transitions for smooth hover effects */
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease,
    border-color 0.25s ease;
}

/* Hover effect - slide slightly right */
.sidebar-nav .side-icon:hover {
  transform: translateX(4px);
}

/* SVG ICON in nav item */
.sidebar-nav .icon {
  flex-shrink: 0;            /* Don't shrink when sidebar is narrow */
  width: 40px;
  height: 40px;
  padding: 5px;
  color: white;
}


/* TEXT LABEL next to icon
   Hidden by default, shown when sidebar is expanded */
.sidebar-span {
  display: none;             /* Hidden in collapsed state */
  color: white;
  font-size: 16px;
}

/* ===========================================
   EXPANDED SIDEBAR STATE
   
   When #menuToggle checkbox is checked (hamburger clicked),
   these styles apply to expand the sidebar.
   Uses CSS sibling selector (~) to target elements after the checkbox.
   =========================================== */

/* Expand sidebar width when toggle is checked */
#menuToggle:checked ~ .grid-container {
  --sidebar-width: 220px;    /* Wider sidebar - change this value to adjust */
}

/* Show text labels when expanded */
#menuToggle:checked ~ .grid-container .sidebar-span {
  display: inline-block;
}

/* Add bottom border to nav items when expanded */
#menuToggle:checked ~ .grid-container .sidebar-nav .side-icon {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Hover effect with purple glow when expanded */
#menuToggle:checked ~ .grid-container .sidebar-nav .side-icon:hover {
  border-color: #a833e7;
  box-shadow: 0 0 8px rgba(168, 51, 231, 0.4);
}

/* ===========================================
   RESPONSIVE BREAKPOINTS - Sidebar
   =========================================== */

/* TABLET STYLES (≤768px) - Compact sidebar */
@media (max-width: 768px) {
  .body-left.sidebar {
    padding: 8px 0;
  }
  
  /* Smaller icons */
  .sidebar-nav .icon {
    width: 32px;
    height: 32px;
  }
  
  .sidebar-nav .side-icon {
    padding: 4px 8px;
  }
}

/* MOBILE STYLES (≤480px)
   Show compact icon-only sidebar on phones.
   Icons are smaller to fit in the narrow 50px width. */
@media (max-width: 480px) {
  .body-left.sidebar {
    display: flex;           /* Keep sidebar visible */
    padding: 5px 0;
    gap: 8px;
  }
  
  /* Hide hamburger menu toggle on mobile (no expand feature) */
  .hamburger {
    display: none;
  }
  
  /* Smaller icons on mobile */
  .sidebar-nav .icon {
    width: 28px;
    height: 28px;
    padding: 3px;
  }
  
  /* Tighter nav item spacing */
  .sidebar-nav {
    gap: 15px;
    margin-top: 5px;
  }
  
  .sidebar-nav .side-icon {
    padding: 4px 6px;
    justify-content: center;  /* Center icons in compact mode */
  }
}



