#container {
    display: flex;
    min-height: 100vh;
}

aside {
  width: 200px;
  background-color: var(--sb-bg);
  color: var(--sb-text);
  padding: 1em;
  /* REMOVE this line: padding-top: 3.5em; */
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  transform: translateX(-100%);
  transition: transform 0.4s ease;
  z-index: 1000;
}

aside.visible {
    transform: translateX(0);
}

aside nav ul {
    list-style: none;
    padding: 0;
}

aside nav ul li {
    font-family: sportsFont;
    padding: 10px;
    cursor: pointer;
}

aside nav ul li:hover,
aside nav ul li.active {
  background-color: var(--sb-active);
}

main {
    flex-grow: 1;
    padding: 20px;
    background-color: #000000;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    z-index: 500; /* Behind sidebar but above main content */
    opacity: 0; /* Instead of display:none */
    pointer-events: none; /* Prevent clicks unless visible */
    transition: opacity 0.3s ease; /* This is the key line */
}

#overlay.visible {
    opacity: 1;
    pointer-events: all; /* Allow clicking to close when visible */
}

#content-wrapper {
    transition: filter 0.3s ease; /* Make the blur smooth */
}

#content-wrapper.blurred {
    filter: blur(4px); /* Adjust blur strength here */
}

#container > * { min-width: 0; }

main, #main-content { min-width: 0; }

:root{
  --sb-w: 300px;
  --sb-bg: rgba(15, 15, 18, 0.6);            /* frosted */
  --sb-border: rgba(255,255,255,.18);
  --sb-hover: rgba(255,255,255,.10);
  --sb-active: rgba(255,255,255,.14);
  --sb-text: #f5f7ff;
  --sb-muted: #c7c9d3;
  --brand-grad: linear-gradient(90deg, var(--brand-left,#42e591), var(--brand-right,#46a4a6));
}

/* SIDEBAR CONTAINER */
.sidebar{
  position: fixed;
  inset: 0 auto 0 0;
  width: min(85vw, var(--sb-w));
  transform: translateX(-100%);
  transition: transform .25s ease;
  background: var(--sb-bg);
  color: var(--sb-text);
  backdrop-filter: blur(18px) saturate(110%);
  -webkit-backdrop-filter: blur(18px) saturate(110%);
  border-right: 1px solid var(--sb-border);
  box-shadow: 0 0 40px rgba(0,0,0,.35);
  display: grid;
  grid-template-rows: auto 1fr auto;
  z-index: 1200;
}

/* when visible – your JS already toggles .visible */
.sidebar.visible{ transform: translateX(0); }

/* HEADER */
.sb-header{
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sb-border);
}
.sb-logo{
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand-grad);
  color: #0b0d10; font-weight: 800;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.sb-title{
  font-family: sportsFont; letter-spacing:.4px;
  font-size: 1.1rem;
}

/* NAV */
.sb-nav{
  padding: 0;
  overflow: auto;
}
.sb-nav a{
  --icon: "";
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;

  padding: 10px 12px;
  margin: 6px 0;
  border-radius: 14px;
  color: var(--sb-text);
  text-decoration: none;
  position: relative;
  border: 1px solid transparent;
  background: transparent;
  transition: background .15s ease, transform .12s ease, border-color .15s ease;
}

/* small left accent bar */
.sb-nav a::before{
  content: "";
  position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 3px;
  background: transparent;
  transition: background .2s ease;
}

/* “icons” using font/emoji for now (you can swap to lucide-react later) */
.sb-nav a::after{
  content: attr(data-icon);
  /* replace with an actual icon set later; for now we’ll style via pseudo */
  opacity: 0; /* hidden placeholder; we’ll show emoji instead: */
}
.sb-nav a[data-icon="home"]::before{ background: transparent; }

/* Use an emoji as the icon column quickly */
.sb-nav a::marker{ display:none; }
.sb-nav a > .emoji{ font-size: 1.15rem; }

/* Hover / active */
.sb-nav a:hover{
  background: var(--sb-hover);
  border-color: var(--sb-border);
  transform: translateY(-1px);
}
.sb-nav a.active{
  background: var(--sb-active);
  border-color: var(--sb-border);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 6px 18px rgba(0,0,0,.22);
}
.sb-nav a.active::before{ background: var(--brand-grad); }

/* subtle separators */
.sb-nav .sep{
  height: 1px; margin: 10px 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent);
}

/* Accessibility niceties */
@media (prefers-reduced-motion: reduce){
  .sidebar, .sb-nav a{ transition: none !important; }
}
.sb-nav a:focus-visible{
  outline: 2px solid #fff; outline-offset: 2px; border-radius: 14px;
}

.sb-nav a {
  white-space: nowrap;     /* keep text on one line */
  overflow: hidden;        /* hide overflow just in case */
  text-overflow: ellipsis; /* optional: add "..." if text is too long */
}

/* === FORCE PERMANENT DARK / GLASS SIDEBAR === */
:root,
html[data-theme="dark"],
html[data-theme="light"],
body.dark,
body.light {
  /* sidebar tokens */
  --sb-bg: rgba(15,15,18,0.60) !important;   /* translucent */
  --sb-border: rgba(255,255,255,0.18) !important;
  --sb-hover: rgba(255,255,255,0.10) !important;
  --sb-active: rgba(255,255,255,0.14) !important;
  --sb-text: #f5f7ff !important;
  --sb-muted: #c7c9d3 !important;
}

/* belt & suspenders: ensure blur is on */
.sidebar {
  background: var(--sb-bg) !important;
  backdrop-filter: blur(20px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(120%) !important;
}

/* ---- Mobile sidebar fixes ---- */
@media (max-width: 640px){
  /* Give the drawer most of the viewport so text has room */
  .sidebar{
    width: 85vw;
    max-width: 350px;
    overflow-x: hidden;
  }

  /* Let link text wrap instead of showing H..., N..., etc. */
  .sidebar a{
    display: block;
    width: 100%;
    max-width: 100%;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important; /* or unset */
    line-height: 1.25;
  }
  body {
    overflow-x: hidden;
  }
}
