/* =========================================================
   RESET
========================================================= */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;

  background: #121212;
  color: #ffffff;
}


/* =========================================================
   VARIABLES
========================================================= */

:root {
  --background: #121212;
  --surface: #181818;
  --surface-light: #222222;
  --surface-hover: #292929;

  --text-primary: #ffffff;
  --text-secondary: #a7a7a7;

  --accent: #ffffff;

  --border: rgba(255, 255, 255, 0.08);

  --sidebar-width: 230px;
  --player-height: 90px;
}


/* =========================================================
   APP LAYOUT
========================================================= */

.app {
  display: flex;
  min-height: 100vh;
  padding-bottom: var(--player-height);
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: var(--player-height);

  width: var(--sidebar-width);

  padding: 24px 14px;

  background: #0d0d0d;

  border-right: 1px solid var(--border);

  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 0 12px 30px;

  font-size: 20px;
  font-weight: 700;
}

.brand-icon,
.player-artwork {
  display: flex;
  align-items: center;
  justify-content: center;

  background: #292929;

  color: #ffffff;
}

.brand-icon {
  width: 34px;
  height: 34px;

  border-radius: 8px;

  font-size: 20px;
}

.navigation {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;

  width: 100%;

  padding: 12px;

  border: 0;
  border-radius: 8px;

  background: transparent;
  color: var(--text-secondary);

  font-size: 14px;
  font-weight: 600;

  text-align: left;

  cursor: pointer;

  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--surface-light);
  color: var(--text-primary);
}

.nav-icon {
  width: 22px;

  font-size: 18px;
  text-align: center;
}


/* =========================================================
   MAIN
========================================================= */

.main {
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);

  min-width: 0;
}

.header {
  position: sticky;
  top: 0;

  display: flex;
  align-items: center;

  height: 72px;

  padding: 0 32px;

  background: rgba(18, 18, 18, 0.96);

  backdrop-filter: blur(12px);

  border-bottom: 1px solid var(--border);

  z-index: 10;
}

.mobile-brand {
  display: none;
}


/* =========================================================
   SEARCH
========================================================= */

.search-container {
  position: relative;

  width: min(600px, 100%);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;

  transform: translateY(-50%);

  color: var(--text-secondary);

  font-size: 22px;

  pointer-events: none;
}

#searchInput {
  width: 100%;

  padding: 11px 42px;

  border: 0;
  border-radius: 22px;

  outline: none;

  background: #242424;
  color: var(--text-primary);

  font-size: 14px;
}

#searchInput::placeholder {
  color: #888888;
}

#searchInput:focus {
  background: #2b2b2b;
}

.clear-search {
  position: absolute;
  right: 8px;
  top: 50%;

  width: 28px;
  height: 28px;

  transform: translateY(-50%);

  border: 0;
  border-radius: 50%;

  background: transparent;
  color: #aaa;

  font-size: 20px;

  cursor: pointer;
}

.clear-search:hover {
  background: #3a3a3a;
  color: #fff;
}

.hidden {
  display: none !important;
}


/* =========================================================
   CONTENT
========================================================= */

.content {
  padding: 32px;

  max-width: 1500px;
}


/* =========================================================
   PAGE HEADER
========================================================= */

.page-header {
  margin-bottom: 28px;
}

.page-title {
  margin: 0;

  font-size: 30px;
  line-height: 1.2;
}

.page-subtitle {
  margin: 7px 0 0;

  color: var(--text-secondary);

  font-size: 14px;
}


/* =========================================================
   SECTION
========================================================= */

.section {
  margin-bottom: 42px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 16px;
}

.section-title {
  margin: 0;

  font-size: 20px;
}

.section-action {
  border: 0;

  background: transparent;
  color: var(--text-secondary);

  font-size: 13px;
  font-weight: 600;

  cursor: pointer;
}

.section-action:hover {
  color: #fff;
}


/* =========================================================
   ALBUM GRID
========================================================= */

.album-grid {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fill,
      minmax(165px, 1fr)
    );

  gap: 22px;
}

.album-card {
  min-width: 0;

  padding: 12px;

  border-radius: 10px;

  background: transparent;

  cursor: pointer;

  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.album-card:hover {
  background: var(--surface-light);

  transform: translateY(-2px);
}

.album-art {
  position: relative;

  width: 100%;

  aspect-ratio: 1;

  margin-bottom: 12px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 8px;

  background:
    linear-gradient(
      135deg,
      #292929,
      #171717
    );

  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.3);

  font-size: 42px;
  color: #777;

  overflow: hidden;
}

.album-art img {
  width: 100%;
  height: 100%;

  object-fit: cover;
}

.album-name {
  margin-bottom: 5px;

  overflow: hidden;

  color: #fff;

  font-size: 14px;
  font-weight: 600;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-artist {
  overflow: hidden;

  color: var(--text-secondary);

  font-size: 13px;

  text-overflow: ellipsis;
  white-space: nowrap;
}


/* =========================================================
   SONG LIST
========================================================= */

.song-list {
  width: 100%;
}

.song-row {
  display: grid;

  grid-template-columns:
    44px
    minmax(0, 1fr)
    minmax(160px, 0.5fr)
    60px;

  align-items: center;

  min-height: 58px;

  padding: 6px 10px;

  border-radius: 7px;

  cursor: pointer;

  transition:
    background 0.12s ease;
}

.song-row:hover {
  background: var(--surface-hover);
}

.song-row.playing {
  background: #252525;
}

.song-number {
  color: var(--text-secondary);

  font-size: 13px;

  text-align: center;
}

.song-main {
  min-width: 0;

  display: flex;
  align-items: center;

  gap: 12px;
}

.song-art {
  width: 40px;
  height: 40px;

  flex: 0 0 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 5px;

  background: #292929;

  color: #777;
}

.song-info {
  min-width: 0;
}

.song-title {
  overflow: hidden;

  color: #fff;

  font-size: 14px;
  font-weight: 500;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-album {
  margin-top: 3px;

  overflow: hidden;

  color: var(--text-secondary);

  font-size: 12px;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-artist {
  overflow: hidden;

  color: var(--text-secondary);

  font-size: 13px;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-duration {
  color: var(--text-secondary);

  font-size: 12px;

  text-align: right;
}


/* =========================================================
   ARTIST GRID
========================================================= */

.artist-grid {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fill,
      minmax(180px, 1fr)
    );

  gap: 16px;
}

.artist-card {
  display: flex;
  align-items: center;

  gap: 14px;

  padding: 14px;

  border-radius: 10px;

  background: var(--surface);

  cursor: pointer;

  transition: background 0.15s ease;
}

.artist-card:hover {
  background: var(--surface-hover);
}

.artist-avatar {
  width: 52px;
  height: 52px;

  flex: 0 0 52px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #292929;

  color: #aaa;

  font-size: 21px;
}

.artist-name {
  overflow: hidden;

  font-size: 14px;
  font-weight: 600;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.artist-count {
  margin-top: 4px;

  color: var(--text-secondary);

  font-size: 12px;
}


/* =========================================================
   BACK BUTTON
========================================================= */

.back-button {
  display: inline-flex;
  align-items: center;

  gap: 7px;

  margin-bottom: 20px;

  padding: 8px 12px;

  border: 0;
  border-radius: 6px;

  background: var(--surface-light);
  color: var(--text-secondary);

  font-size: 13px;
  font-weight: 600;

  cursor: pointer;
}

.back-button:hover {
  color: #fff;
  background: var(--surface-hover);
}


/* =========================================================
   EMPTY / ERROR / LOADING
========================================================= */

.empty-state,
.loading-state,
.error-state {
  padding: 70px 20px;

  color: var(--text-secondary);

  text-align: center;
}

.empty-state-icon {
  margin-bottom: 12px;

  font-size: 40px;
  opacity: 0.5;
}

.empty-state-title {
  margin-bottom: 6px;

  color: #fff;

  font-size: 17px;
  font-weight: 600;
}

.empty-state-text {
  font-size: 13px;
}


/* =========================================================
   PLAYER
========================================================= */

.player {
  position: fixed;

  left: 0;
  right: 0;
  bottom: 0;

  height: var(--player-height);

  display: grid;

  grid-template-columns:
    minmax(220px, 1fr)
    minmax(350px, 2fr)
    minmax(180px, 1fr);

  align-items: center;

  padding: 10px 20px;

  background: #181818;

  border-top: 1px solid var(--border);

  z-index: 100;
}

.player-song {
  min-width: 0;

  display: flex;
  align-items: center;

  gap: 12px;
}

.player-artwork {
  width: 56px;
  height: 56px;

  flex: 0 0 56px;

  border-radius: 5px;

  font-size: 22px;
}

.player-song-info {
  min-width: 0;
}

.player-title {
  overflow: hidden;

  color: #fff;

  font-size: 13px;
  font-weight: 600;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-artist {
  margin-top: 5px;

  overflow: hidden;

  color: var(--text-secondary);

  font-size: 12px;

  text-overflow: ellipsis;
  white-space: nowrap;
}


/* =========================================================
   PLAYER CONTROLS
========================================================= */

.player-controls {
  width: 100%;

  max-width: 650px;

  margin: 0 auto;
}

.transport-controls {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 16px;

  margin-bottom: 5px;
}

.player-button,
.play-button {
  border: 0;

  background: transparent;

  color: #fff;

  cursor: pointer;
}

.player-button {
  font-size: 21px;

  opacity: 0.75;
}

.player-button:hover {
  opacity: 1;
}

.play-button {
  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #fff;
  color: #000;

  font-size: 13px;
}

.play-button:hover {
  transform: scale(1.05);
}


/* =========================================================
   PROGRESS
========================================================= */

.progress-container {
  display: flex;
  align-items: center;

  gap: 8px;
}

.time {
  width: 34px;

  color: var(--text-secondary);

  font-size: 10px;

  text-align: center;
}

.progress {
  flex: 1;

  min-width: 0;

  cursor: pointer;
}


/* =========================================================
   RANGE INPUTS
========================================================= */

input[type="range"] {
  appearance: none;

  height: 4px;

  border-radius: 4px;

  background: #555;

  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;

  width: 12px;
  height: 12px;

  border-radius: 50%;

  background: #fff;

  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;

  border: 0;
  border-radius: 50%;

  background: #fff;

  cursor: pointer;
}


/* =========================================================
   VOLUME
========================================================= */

.volume-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;

  gap: 8px;
}

.volume-icon {
  font-size: 13px;
}

.volume {
  width: 100px;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 900px) {

  :root {
    --player-height: 115px;
  }

  .sidebar {
    display: none;
  }

  .main {
    width: 100%;
    margin-left: 0;
  }

  .header {
    height: 62px;

    padding: 8px 16px;

    gap: 12px;
  }

  .mobile-brand {
    display: flex;
    align-items: center;

    gap: 7px;

    flex: 0 0 auto;

    font-size: 16px;
    font-weight: 700;
  }

  .mobile-brand .brand-icon {
    width: 28px;
    height: 28px;

    font-size: 16px;
  }

  .search-container {
    flex: 1;
  }

  .content {
    padding: 24px 16px;
  }

  .page-title {
    font-size: 25px;
  }

  .album-grid {
    grid-template-columns:
      repeat(
        auto-fill,
        minmax(135px, 1fr)
      );

    gap: 12px;
  }

  .album-card {
    padding: 8px;
  }

  .song-row {
    grid-template-columns:
      32px
      minmax(0, 1fr)
      48px;

    padding: 6px 4px;
  }

  .song-artist {
    display: none;
  }

  .player {
    height: var(--player-height);

    display: grid;

    grid-template-columns: 1fr auto;

    grid-template-rows: auto auto;

    padding: 8px 12px;
  }

  .player-song {
    grid-column: 1;
    grid-row: 1;
  }

  .player-artwork {
    width: 42px;
    height: 42px;

    flex-basis: 42px;
  }

  .player-controls {
    grid-column: 1 / -1;
    grid-row: 2;

    max-width: none;
  }

  .volume-container {
    grid-column: 2;
    grid-row: 1;
  }

  .volume {
    width: 70px;
  }

  .volume-icon {
    display: none;
  }
}


@media (max-width: 560px) {

  .mobile-brand span {
    display: none;
  }

  .header {
    padding: 8px 12px;
  }

  .content {
    padding: 20px 12px;
  }

  .album-grid {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );
  }

  .artist-grid {
    grid-template-columns: 1fr;
  }

  .song-number {
    display: none;
  }

  .song-row {
    grid-template-columns:
      minmax(0, 1fr)
      45px;
  }

  .song-main {
    gap: 10px;
  }

  .song-art {
    width: 42px;
    height: 42px;

    flex-basis: 42px;
  }

  .song-duration {
    font-size: 11px;
  }

  .volume {
    display: none;
  }
}