/* static/css/layout.css */

html, body{
  width:100%;
  overflow-x:hidden;
}

* { box-sizing: border-box; }

a { color: inherit; text-decoration: none; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
  min-width: 0;
}

/* prevent grid children from forcing horizontal overflow */
.sidebar,
.sidebar-card,
.main,
.page,
.now-playing{
  min-width: 0;
}

/* ─────────────────────────
   Theme toggle
───────────────────────── */

.theme-toggle {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 16px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  color: var(--text);
  cursor: pointer;
}

.theme-toggle-track {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--toggle-track);
  border: 1px solid var(--line);
  position: relative;
}

.theme-toggle-thumb {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--toggle-thumb);
  color: var(--toggle-icon);
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  transition: left 180ms ease, background-color 180ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* icons inside the toggle thumb */
.tt-icon {
  position: absolute;
  font-size: 12px;
  line-height: 1;
  transition: opacity 160ms ease, transform 160ms ease;
}

/* light mode default */
.tt-sun {
  opacity: 1;
  transform: scale(1);
}

.tt-moon {
  opacity: 0;
  transform: scale(0.6);
}

html[data-theme="dark"] .theme-toggle-thumb {
  left: 23px;
}

html[data-theme="dark"] .tt-sun {
  opacity: 0;
  transform: scale(0.6);
}

html[data-theme="dark"] .tt-moon {
  opacity: 1;
  transform: scale(1);
}

.theme-toggle:hover .theme-toggle-track {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.theme-toggle-label {
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 700px) {
  .theme-toggle-label { display: none; }
}

/* ─────────────────────────
   Sidebar
───────────────────────── */

.sidebar {
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar-bg);
}

.sidebar-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 20px 18px;
}

/* Avatar */
.avatar-wrap {
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.avatar {
  width: 190px;
  height: 190px;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid var(--line);
}

/* Name */
.name {
  margin-top: 14px;
  text-align: center;
  font-size: 26px;
  font-weight: 600;
}

/* Tagline */
.tagline {
  margin-top: 4px;
  margin-bottom: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* Social icons */
.social {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.social .icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  transition: transform 120ms ease, background 120ms ease;
}

.social .icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.social .icon:hover {
  background: var(--panel-2);
  transform: translateY(-1px);
}

/* ─────────────────────────
   Navigation
───────────────────────── */

.nav {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link {
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
}

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

.nav-link.active {
  background: var(--panel);
  color: var(--text);
  position: relative;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: var(--text);
  opacity: 0.28;
}

/* ─────────────────────────
   Main content
───────────────────────── */

.main {
  padding: 56px 28px;
}

.page {
  max-width: 980px;
  margin: 0 auto;
}

/* ─────────────────────────
   Now playing
───────────────────────── */

.now-playing{
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width: 0;
}

.np-separator{
  /*width:18px;*/
  /*height:14px;*/
  /*object-fit:contain;*/
  /*margin:0 10px;*/
  /*flex-shrink:0;*/
  /*opacity:.8;*/

  /*position:relative;*/
  /*top:1px;*/

  width:20px;
  height:20px;
  object-fit:contain;
  margin:0;
  flex-shrink:0;
  display:block;
}


.np-label{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  font-size:12px;
  opacity:.65;
}

.np-label-gif{
  width:14px;
  height:14px;
  object-fit:contain;
  flex-shrink: 0;
}

.np-marquee{
  max-width:100%;
  overflow:hidden;
  padding:8px 0;
  background:transparent;
}

.np-track{
  /*display:flex;*/
  /*width:max-content;*/
  /*animation:np-marquee 14s linear infinite;*/

  /*display:inline-flex;*/
  /*align-items:center;*/
  /*gap:8px;*/
  /*padding-right:0;*/
  /*white-space:nowrap;*/
  /*text-decoration:none;*/
  /*color:inherit;*/

  display:flex;
  align-items:center;
  width:max-content;
  animation:np-marquee 14s linear infinite;
  gap:8px;
}

.np-marquee:hover .np-track{
  animation-play-state:paused;
}

.np-content{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding-right:0;
  white-space:nowrap;
  text-decoration:none;
  color:inherit;
}

.np-text{
  font-size:14px;
}

@keyframes np-marquee{
  from{ transform:translateX(0); }
  to{ transform:translateX(-50%); }
}

/* ─────────────────────────
   Responsive
───────────────────────── */

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding-top: 72px; /* reserve space for fixed toggle */
  }

  .main {
    padding: 28px 18px;
    padding-top: 72px; /* reserve space for fixed toggle */
  }

  .page { max-width: 100%; }
}

/* tighter sizing on small phones so it doesn’t feel “zoomed in” */
@media (max-width: 520px){
  .sidebar{
    padding: 16px 14px;
    padding-top: 68px; /* still reserves space for toggle */
  }

  .sidebar-card{
    padding: 14px 14px 16px 14px;
  }

  .avatar{
    width: 150px;
    height: 150px;
  }

  .name{
    font-size: 22px;
    margin-top: 12px;
  }

  .tagline{
    font-size: 13px;
    margin-bottom: 12px;
  }

  .main{
    padding: 18px 14px;
    padding-top: 68px; /* still reserves space for toggle */
  }

  .theme-toggle{
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
  }

  .np-text{
    font-size: 13px;
  }
}
