/* ============================================
   beatz — app shell / layout
   ============================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr var(--nowplaying-h);
  height: 100vh;
  width: 100vw;
}

/* ---------- Sidebar ---------- */
.sidebar {
  grid-row: 1 / 2;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  background: var(--yellow);
  border-radius: var(--squircle);
  flex-shrink: 0;
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 9px;
  background: var(--bg);
  clip-path: polygon(0 0, 45% 0, 100% 50%, 45% 100%, 0 100%, 30% 50%);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.02em;
}

.nav-group { display: flex; flex-direction: column; gap: 2px; }

.nav-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grey-dim);
  padding: 0 8px;
  margin-bottom: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--grey);
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-link:hover { color: var(--text); background: var(--surface-raised); }

.nav-link.active {
  color: var(--bg);
  background: var(--yellow);
}

.nav-link .icon { width: 20px; height: 20px; flex-shrink: 0; }

.playlist-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.playlist-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--grey);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.playlist-link:hover { color: var(--text); background: var(--surface-raised); }
.playlist-link.active { color: var(--yellow); }

.playlist-link img {
  width: 28px; height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ---------- Main ---------- */
.main {
  grid-row: 1 / 2;
  overflow-y: auto;
  padding: 28px 36px 48px;
  background:
    radial-gradient(ellipse 900px 400px at top left, rgba(255,199,0,0.06), transparent 60%),
    var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  width: 360px;
  max-width: 45vw;
}

.search-box input {
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  width: 100%;
  outline: none;
}

.search-box input::placeholder { color: var(--grey-dim); }
.search-box svg { width: 16px; height: 16px; color: var(--grey); flex-shrink: 0; }

.avatar {
  width: 36px; height: 36px;
  border-radius: var(--squircle);
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  flex-shrink: 0;
}

/* ---------- Now playing bar ---------- */
.nowplaying {
  grid-column: 1 / 3;
  grid-row: 2 / 3;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr minmax(0, 2fr) 1fr;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}

/* ---------- Bottom nav (mobile) ---------- */
.bottomnav {
  display: none;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr var(--nowplaying-h) 74px;
  }
  .sidebar { display: none; }
  .main { grid-column: 1 / 2; padding: 20px 16px 32px; }
  .nowplaying { grid-column: 1 / 2; grid-row: 2 / 3; }
  .bottomnav {
    display: flex;
    grid-column: 1 / 2;
    grid-row: 3 / 4;
    background: var(--surface);
    border-top: 1px solid var(--line);
    justify-content: space-around;
    align-items: center;
    padding: 0 6px;
  }
  .bottomnav button {
    background: none; border: none; color: var(--grey);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px;
    font-size: 10px; font-weight: 600;
    padding: 7px 16px;
    border-radius: 16px;
    transition: background-color 0.15s ease, color 0.15s ease;
  }
  .bottomnav button.active {
    color: var(--bg);
    background: var(--yellow);
  }
  .bottomnav svg { width: 22px; height: 22px; }
  .search-box { width: 100%; max-width: none; }
}
