@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap");

:root {
  --black: #000;
  --surface: #121212;
  --surface-elevated: #1f1f1f;
  --surface-hover: #2a2a2a;
  --muted: #b3b3b3;
  --green: #1ed760;
  --player-height: 92px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--black);
}

body {
  background: var(--black);
  color: #fff;
  font-family: "Roboto", Arial, sans-serif;
  min-width: 280px;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.container {
  display: flex;
  gap: 8px;
  min-height: 100vh;
  padding: 8px;
}

/* Sidebar */
.left {
  display: flex;
  flex: 0 0 280px;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.home,
.library {
  background: var(--surface);
  border-radius: 8px;
  margin: 0;
  padding: 20px;
}

.home {
  min-height: 160px;
}

.logo {
  align-items: center;
  display: flex;
  gap: 8px;
}

.logo img {
  height: 32px;
  width: 32px;
}

.logo span {
  font-size: 20px;
  font-weight: 700;
}

.home ul {
  display: grid;
  gap: 18px;
  list-style: none;
  margin-top: 28px;
}

.home ul li {
  align-items: center;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 15px;
  font-weight: 700;
  gap: 18px;
  transition: color 0.2s ease;
}

.home ul li:hover {
  color: #fff;
}

.home ul li img {
  height: 24px;
  width: 24px;
}

.library {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.heading {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
}

.heading img {
  height: 24px;
  width: 24px;
}

.heading h2 {
  font-size: 15px;
}

.songList {
  flex: 1;
  min-height: 160px;
  overflow-y: auto;
}

.songList ul {
  list-style: none;
}

.songList ul li {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  margin: 3px 0;
  min-width: 0;
  padding: 10px 8px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.songList ul li:hover {
  background: var(--surface-hover);
}

.songList ul li > img {
  flex: 0 0 20px;
  height: 20px;
  width: 20px;
}

.info {
  flex: 1;
  min-width: 0;
}

.info div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-title {
  font-size: 13px;
}

.song-artist {
  color: #888;
  font-size: 11px;
  margin-top: 4px;
}

.playnow {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.playnow span {
  font-size: 11px;
}

.playnow img {
  height: 18px;
  width: 18px;
}

.songList li.active {
  background: rgba(30, 215, 96, 0.1);
  border-color: var(--green);
}

.songList li.active .song-title {
  color: var(--green);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding-top: 18px;
}

.footer a {
  color: #888;
  font-size: 10px;
  text-decoration: none;
}

.footer a:hover {
  color: #fff;
}

.close {
  display: none;
}

/* Main content */
.right {
  background: var(--surface);
  border-radius: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding-bottom: calc(var(--player-height) + 20px);
}

.header {
  align-items: center;
  background: rgba(18, 18, 18, 0.96);
  display: flex;
  justify-content: space-between;
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.nav {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 12px;
}

.nav svg {
  background: #090909;
  border-radius: 50%;
  height: 32px;
  padding: 5px;
  width: 32px;
}

.menu {
  cursor: pointer;
  display: none;
  height: 24px;
  width: 24px;
}

.buttons {
  align-items: center;
  display: flex;
  gap: 18px;
}

.signin {
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.signin:hover {
  color: #fff;
}

.login {
  background: #fff;
  border-radius: 999px;
  color: #000;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  min-height: 40px;
  padding: 0 20px;
}

.login:hover {
  transform: scale(1.04);
}

.playlist {
  padding: 20px 24px 0;
}

.playlist h2 {
  font-size: clamp(22px, 2vw, 28px);
  margin-bottom: 18px;
}

.cardContainer {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.card {
  background: var(--surface-elevated);
  border-radius: 8px;
  cursor: pointer;
  min-width: 0;
  padding: 14px;
  position: relative;
  transition: background 0.25s ease, transform 0.25s ease;
}

.card:hover {
  background: var(--surface-hover);
  transform: translateY(-3px);
}

.card > img {
  aspect-ratio: 1;
  border-radius: 5px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.card h2 {
  font-size: 16px;
  margin-top: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin-top: 6px;
  min-height: 35px;
}

.playButton {
  bottom: 72px;
  opacity: 0;
  position: absolute;
  right: 20px;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 1;
}

.playButton svg {
  display: block;
  height: 42px;
  width: 42px;
}

.card:hover .playButton,
.card:focus-within .playButton {
  opacity: 1;
  transform: translateY(0);
}

/* Player */
.Playbar {
  background: #282828;
  border-top: 1px solid #3a3a3a;
  bottom: 0;
  left: calc(50% + 4px);
  max-width: 1400px;
  min-height: var(--player-height);
  padding: 14px 24px 12px;
  position: fixed;
  transform: translateX(-50%);
  width: calc(100% - 304px);
  z-index: 10;
}

.aboveBar {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(130px, 1fr) auto minmax(130px, 1fr);
}

.songinfo,
.songtime {
  color: #fff;
  font-size: 12px;
  overflow: hidden;
  padding: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.songtime {
  color: var(--muted);
  text-align: right;
}

.songbuttons {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: center;
}

.songbuttons img {
  cursor: pointer;
  height: 22px;
  width: 22px;
}

.songbuttons #play {
  height: 34px;
  width: 34px;
}

.timevol {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.volume {
  align-items: center;
  display: flex;
  gap: 8px;
}

.volume > img {
  height: 18px;
  width: 18px;
}

.range input {
  accent-color: var(--green);
  cursor: pointer;
  width: 90px;
}

.seekBar {
  background: #5e5e5e;
  border: 0;
  border-radius: 4px;
  bottom: 5px;
  height: 4px;
  left: 24px;
  position: absolute;
  width: calc(100% - 48px);
}

.circle {
  background: #fff;
  border-radius: 50%;
  height: 10px;
  left: 0;
  position: absolute;
  top: -3px;
  transform: translateX(-50%);
  width: 10px;
}

@media (max-width: 992px) {
  .left {
    background: #121212;
    bottom: 0;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    left: -320px;
    position: fixed;
    top: 0;
    transition: left 0.25s ease;
    width: min(320px, 88vw);
    z-index: 20;
  }

  .left.active {
    left: 0;
  }

  .close {
    cursor: pointer;
    display: block;
    height: 24px;
    position: absolute;
    right: 18px;
    top: 18px;
    width: 24px;
  }

  .home,
  .library {
    border-radius: 0;
  }

  .home {
    padding-top: 58px;
  }

  .menu {
    display: block;
  }

  .Playbar {
    left: 50%;
    width: calc(100% - 16px);
  }
}

@media (max-width: 640px) {
  :root {
    --player-height: 118px;
  }

  .container {
    padding: 0;
  }

  .right {
    border-radius: 0;
  }

  .header {
    padding: 12px 16px;
  }

  .nav {
    gap: 8px;
  }

  .nav svg {
    display: none;
  }

  .buttons {
    gap: 10px;
  }

  .signin {
    font-size: 13px;
  }

  .login {
    min-height: 36px;
    padding: 0 16px;
  }

  .playlist {
    padding: 18px 16px 0;
  }

  .cardContainer {
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card {
    padding: 10px;
  }

  .card h2 {
    font-size: 14px;
    margin-top: 10px;
  }

  .card p {
    font-size: 12px;
    min-height: 32px;
  }

  .playButton {
    bottom: 62px;
    right: 14px;
  }

  .playButton svg {
    height: 36px;
    width: 36px;
  }

  .Playbar {
    padding: 12px 14px 16px;
  }

  .aboveBar {
    gap: 10px;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .songinfo {
    grid-column: 1;
    grid-row: 1;
  }

  .songbuttons {
    gap: 14px;
    grid-column: 2;
    grid-row: 1;
  }

  .timevol {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
  }

  .songtime {
    text-align: left;
  }

  .range input {
    width: 74px;
  }

  .seekBar {
    bottom: 5px;
    left: 14px;
    width: calc(100% - 28px);
  }
}

@media (max-width: 360px) {
  .signin {
    display: none;
  }

  .playlist h2 {
    font-size: 20px;
  }

  .card p {
    display: none;
  }
}
