/* sidebar.css — Collapsible left sidebar navigation for XStream Player */

/* ── SIDEBAR ──────────────────────────────────────────────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 499;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.sidebar-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  z-index: 500;
  background: #0a0b12;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.16,1,0.3,1);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar.open {
  transform: translateX(0);
}

/* Sidebar header — logo + close */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 1rem;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: #e8eaf0;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: #00FF41;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo svg {
  width: 18px;
  height: 18px;
  stroke: #000;
  fill: none;
}

.sidebar-brand-name {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.sidebar-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7080;
  transition: all 0.2s;
}

.sidebar-close:hover {
  background: rgba(255,255,255,0.06);
  color: #e8eaf0;
}

.sidebar-close svg {
  width: 18px;
  height: 18px;
}

/* Sidebar nav items */
.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 10px;
  text-decoration: none;
  color: #8b8fa0;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.18s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-item:hover {
  background: rgba(255,255,255,0.05);
  color: #c8cad4;
}

.sidebar-item.active {
  background: rgba(0,255,65,0.12);
  color: #00FF41;
}

.sidebar-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke-width: 1.8;
}

.sidebar-item.active svg {
  stroke: #00FF41;
}

/* ── HAMBURGER TOGGLE ──────────────────────────────────────────────────── */
.sidebar-toggle {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 450;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(13,15,22,0.9);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #8b8fa0;
  transition: all 0.2s;
}

.sidebar-toggle:hover {
  background: rgba(20,20,32,0.95);
  color: #e8eaf0;
  border-color: rgba(255,255,255,0.12);
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
}

/* When sidebar is open, hide the toggle */
.sidebar.open ~ .sidebar-toggle {
  opacity: 0;
  pointer-events: none;
}

/* ── LAYOUT SHIFT (desktop — push content) ──────────────────────────── */
@media (min-width: 901px) {
  .sidebar-overlay {
    display: none !important;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .navbar {
    padding-left: calc(260px + 2rem);
  }

  body.sidebar-open .app-layout {
    margin-left: 260px;
  }

  body.sidebar-open .player-bar {
    left: 260px;
  }

  body.sidebar-open .sidebar-toggle {
    left: 276px;
  }
}

/* ── MOBILE — overlay mode ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    width: 280px;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }

  .sidebar-toggle {
    top: 12px;
    left: 12px;
  }
}
