/* ==========================================================================
   UNMUSIC — responsive.css
   Desktop → Tablet (sidebar mengecil) → Mobile (bottom nav + compact player)
   ========================================================================== */

/* ---------- LAPTOP KECIL ---------- */
@media (max-width: 1180px) {
  :root {
    --sidebar-w: 220px;
  }
  .lyricsview__body {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: var(--sp-6);
  }
  .featured {
    grid-template-columns: 230px minmax(0, 1fr);
  }
}

/* ---------- TABLET: sidebar jadi rail ikon ---------- */
@media (max-width: 1024px) {
  :root {
    --sidebar-w: 78px;
  }
  .brand {
    justify-content: center;
    padding: 0;
  }
  .brand__text,
  .nav__item span,
  .sidebar__head h2,
  .sidebar__footer,
  .playlist-list,
  .playlist-list__empty {
    display: none;
  }
  .sidebar {
    padding: var(--sp-5) 10px;
    align-items: center;
    gap: var(--sp-5);
  }
  .nav {
    width: 100%;
  }
  .nav__item {
    justify-content: center;
    padding: 12px 0;
  }
  .nav__item svg {
    width: 22px;
    height: 22px;
  }
  .nav__item.is-active::before {
    display: none;
  }
  .sidebar__section {
    flex: none;
    border-top: 1px solid var(--line);
    padding-top: var(--sp-4);
    width: 100%;
    align-items: center;
  }
  .sidebar__head {
    justify-content: center;
    padding: 0;
  }
  .view__inner {
    padding: var(--sp-5) var(--sp-5) 80px;
    gap: var(--sp-6);
  }
  .player {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 46%) minmax(0, 0.8fr);
  }
  .volume__bar {
    width: 64px;
  }
  .lyricsview__side h2,
  .lyricsview__side p {
    display: block;
  }
}

/* ---------- TABLET SEMPIT ---------- */
@media (max-width: 900px) {
  .featured {
    grid-template-columns: 180px minmax(0, 1fr);
    padding: var(--sp-5);
  }
  .grid-rows {
    grid-template-columns: 1fr;
  }
  .lyricsview__body {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0 var(--sp-5);
  }
  .lyricsview__side {
    display: none;
  }
  .lyricsview__scroll {
    padding: 12vh 0 26vh;
  }
  .lyric-line {
    text-align: center;
    transform-origin: center;
  }
  .lyrics {
    /* Skala dari tengah: ruang cadangan dibagi ke dua sisi. */
    padding-right: 3%;
    padding-left: 3%;
  }
}

/* ==========================================================================
   MOBILE — sidebar → bottom nav, player → compact
   ========================================================================== */
@media (max-width: 760px) {
  :root {
    --player-h: 62px;
    --botnav-h: 62px;
    --topbar-h: 60px;
  }

  .app {
    inset: 0 0 calc(var(--player-h) + var(--botnav-h)) 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--topbar-h) minmax(0, 1fr);
    grid-template-areas: "topbar" "main";
  }
  .sidebar {
    display: none;
  }

  .topbar {
    padding: 0 var(--sp-4);
    gap: var(--sp-2);
  }
  .topbar__nav {
    display: none;
  }
  .searchbar {
    max-width: none;
  }
  .searchbar__kbd {
    display: none;
  }
  .topbar__actions {
    display: flex;
  }

  .view__inner {
    padding: var(--sp-4) var(--sp-4) 60px;
    gap: var(--sp-6);
  }
  .greeting__title,
  .view__title {
    font-size: 1.65rem;
  }
  .block__head h2 {
    font-size: 1.22rem;
  }

  /* featured jadi stack */
  .featured {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-4);
    padding: var(--sp-4);
    min-height: 0;
  }
  .featured__art {
    width: 60%;
    max-width: 210px;
  }
  .hscroll {
    grid-auto-columns: 144px;
    gap: var(--sp-3);
    margin: 0 calc(var(--sp-4) * -1);
    padding: 0 var(--sp-4) 6px;
  }
  .mood-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--sp-3);
    padding: 7px 4px;
  }
  .row__dur {
    display: none;
  }
  .row__ctl {
    opacity: 1;
  }
  .row__ctl .icon-btn--heart {
    display: none;
  }

  /* ----- COMPACT MOBILE PLAYER ----- */
  .player {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: var(--sp-2);
    padding: 0 10px 0 8px;
    bottom: var(--botnav-h);
    border-top: 1px solid var(--line);
  }
  .player__progress-mobile {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: -1px;
    height: 2px;
    background: rgba(255, 255, 255, 0.12);
  }
  .player__progress-mobile span {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.25s linear;
  }
  .player__left {
    grid-column: 1;
    gap: 10px;
  }
  .player__art {
    width: 46px;
    height: 46px;
  }
  .player__art-expand {
    display: none;
  }
  .player__left .icon-btn--heart {
    display: none;
  }
  .player__center,
  .player__right {
    display: none;
  }
  .player {
    align-items: center;
  }
  .player__left {
    grid-row: 1;
  }
  .player__mobile-play {
    display: grid;
    place-items: center;
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--text);
    color: #0a0a0c;
  }
  .player__mobile-play svg {
    width: 22px;
    height: 22px;
  }
  body[data-playing="true"] .player__mobile-play .ico-play {
    display: none;
  }
  body[data-playing="true"] .player__mobile-play .ico-pause {
    display: block;
  }
  .player__mobile-lyrics {
    display: grid;
    place-items: center;
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--text-2);
  }

  /* ----- BOTTOM NAV ----- */
  .botnav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--botnav-h);
    z-index: 61;
    border-top: 1px solid var(--line);
    background: rgba(8, 8, 11, 0.96);
    backdrop-filter: blur(24px);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .botnav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-3);
  }
  .botnav__item svg {
    width: 21px;
    height: 21px;
  }
  .botnav__item.is-active {
    color: var(--text);
  }
  .botnav__item.is-active svg {
    color: var(--accent);
  }

  /* ----- FULL PLAYER ----- */
  .fullplayer__body {
    justify-content: flex-start;
    gap: var(--sp-4);
    padding: var(--sp-2) var(--sp-5) var(--sp-6);
  }
  .fullplayer__artwrap {
    width: min(320px, 74vw);
    margin: var(--sp-2) auto var(--sp-2);
  }
  .fullplayer__disc {
    display: none;
  }
  .fullplayer__titles h2 {
    font-size: 1.3rem;
    white-space: normal;
  }
  .controls--full {
    gap: var(--sp-5);
  }
  .play-btn--lg {
    width: 68px;
    height: 68px;
  }

  /* ----- LYRICS ----- */
  .lyricsview__top {
    padding: var(--sp-3) var(--sp-4);
  }
  .lyricsview__body {
    padding: 0 var(--sp-4);
  }
  .lyricsview__scroll {
    padding: 10vh 0 24vh;
  }
  .lyric-line {
    font-size: 1.3rem;
    padding: 7px 10px;
  }
  .lyricsview__mini {
    padding: var(--sp-3) var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom));
  }
  .icon-btn__label {
    display: none;
  }

  .queue {
    width: 100%;
    max-width: none;
    top: auto;
    height: 82vh;
    border-left: 0;
    border-top: 1px solid var(--line-strong);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform: translateY(102%);
  }
  .toasts {
    bottom: calc(var(--player-h) + var(--botnav-h) + 12px);
    left: 12px;
    right: 12px;
    translate: 0 0;
    align-items: stretch;
  }
  .toast {
    max-width: 100%;
    width: 100%;
  }
  /* Di layar sempit, tombol aksi turun ke bawah teks. */
  .toast:has(.toast__action) {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px 14px;
  }
  .toast__action {
    align-self: stretch;
    padding: 9px 12px;
  }
  .detail-head {
    grid-template-columns: minmax(0, 1fr);
  }
  .detail-head__art {
    width: 56%;
    max-width: 190px;
  }
  .modal__panel {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .hscroll {
    grid-auto-columns: 132px;
  }
  .mood-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .greeting__title,
  .view__title {
    font-size: 1.45rem;
  }
}

/* Desktop lebar: tampilkan label tombol lirik */
@media (min-width: 1400px) {
  #btn-lyrics {
    width: auto;
    padding: 0 14px;
  }
  #btn-lyrics .icon-btn__label {
    display: inline;
    font-size: var(--text-sm);
    font-weight: 500;
  }
  #lv-back {
    width: auto;
    padding: 0 14px;
  }
  #lv-back .icon-btn__label {
    display: inline;
    font-size: var(--text-sm);
  }
}

/* Layar sangat pendek: kurangi padding lirik */
@media (max-height: 640px) {
  .lyricsview__scroll {
    padding: 8vh 0 20vh;
  }
  .fullplayer__artwrap {
    width: min(260px, 46vh);
  }
}
