
:root {
  --primary-color: #f7f1f1;
  --secondary-color: rgb(80, 25, 25);
  --app-background-color: #4d4d62;
  --background-color: #1b1b32;
  --foreground-color: #f8a5c2;
  --highlight-color: #f300b6;
  --root-font-size: 16px;
  --font-headline: "Roboto Mono", monospace;
  --font-family: "Lato", sans-serif;
}

*,
*::after,
*::before {
  box-sizing: border-box;
}

body {
  background-color: var(--app-background-color);
  color: var(--primary-color);
  font-family: var(--font-family);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

h1 {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  line-height: 1.6;
}

h2 {
  font-size: clamp(0.875rem, 2vw, 1rem);
}

ul {
  margin: 0;
  padding: 0;
}

.container {
  margin: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  row-gap: 0.5rem;
  width: 100%;
  max-width: 500px;
}

.player,
.playlist {
  width: 100%;
  max-width: 450px;
  background-color: var(--background-color);
  border: 3px solid var(--foreground-color);
}

.player {
  padding: 2vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 1rem;
  min-height: 300px;
}

.player-bar,
.playlist-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1vw;
  width: 100%;
  height: 30px;
  background-color: var(--foreground-color);
}

.parallel-lines {
  display: flex;
  flex-wrap: wrap;
  row-gap: 6px;
  padding: 0 1vw;
}

.parallel-lines > div {
  height: 2px;
  width: 100%;
  min-width: 50px;
  background-color: var(--highlight-color);
}

.fcc-title,
.playlist-title {
  color: var(--secondary-color);
  margin: 0 2vw;
  font-family: var(--font-headline);
}

.player-content {
  display: flex;
  background-color: var(--foreground-color);
  width: 100%;
  min-height: 200px;
  column-gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#player-album-art {
  background-color: var(--secondary-color);
  border: 6px solid var(--background-color);
  flex-shrink: 0;
}

#player-album-art img {
  width: 100%;
  max-width: 150px;
  display: block;
}

.player-display {
  display: flex;
  flex-direction: column;
  row-gap: 1rem;
  padding: 1rem;
  background-color: var(--background-color);
  width: 100%;
  max-width: 226px;
  min-height: 180px;
}

.player-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

#progress-bar {
  flex-grow: 1;
  cursor: pointer;
}

.player-volume {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

#volume-control {
  width: 100%;
  max-width: 100px;
}

.player-buttons svg {
  fill: var(--primary-color);
  width: 100%;
  max-width: 24px;
}

.playing > svg {
  fill: var(--highlight-color);
}

.player-buttons {
  display: flex;
  justify-content: space-around;
  gap: 0.5rem;
}

button {
  background: transparent;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: clamp(0.875rem, 2vw, 1rem);
  outline-color: var(--highlight-color);
  text-align: center;
}

.playlist-song {
  outline-color: var(--highlight-color);
}

.playlist li:not(:last-child) {
  border-bottom: 1px solid var(--background-color);
}

button:focus,
.playlist-song:focus {
  outline-style: dashed;
  outline-width: 2px;
}

.playlist {
  padding: 2vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 1rem;
  width: 100%;
}

#playlist-songs {
  width: 100%;
  background-color: var(--foreground-color);
  display: flex;
  flex-direction: column;
  row-gap: 0.5rem;
  padding: 0.5rem;
  list-style: none;
}

.playlist-song {
  display: flex;
  height: 55px;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
}

[aria-current="true"] {
  background-color: var(--background-color);
}

[aria-current="true"] p {
  color: var(--highlight-color);
}

.playlist-song-info {
  height: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  column-gap: 0.5rem;
  padding: 0.5rem 0;
  font-family: var(--font-family);
  width: 100%;
}

#player-song-title,
#player-song-artist {
  margin: 0;
}

#player-song-artist {
  color: var(--highlight-color);
  font-size: clamp(0.625rem, 1.5vw, 0.75rem);
}

#player-song-title {
  font-size: clamp(0.875rem, 2vw, 1.125rem);
}

.playlist-song-title {
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
  width: 60%;
  text-align: left;
}

.playlist-song-artist {
  font-size: clamp(0.625rem, 1.5vw, 0.725rem);
  width: 25%;
}

.playlist-song-duration {
  font-size: clamp(0.625rem, 1.5vw, 0.725rem);
  margin: auto;
  font-family: var(--font-headline);
  width: 15%;
}

.playlist-song-delete {
  padding: 0;
  width: 20px;
  height: 20px;
}

.playlist-song-delete,
.playlist-song-delete svg {
  fill: var(--foreground-color);
}

.playlist-song-delete:hover circle,
.playlist-song-delete:focus circle {
  fill: #ff0000;
}

@media (max-width: 700px) {
  .container {
    margin: 0.5rem;
  }

  .player {
    min-height: 340px;
  }

  .player-content {
    flex-direction: column;
    align-items: center;
    min-height: 300px;
  }

  #player-album-art {
    width: 100%;
    max-width: 200px;
  }

  .player-display {
    max-width: 100%;
    min-height: 200px;
    background-color: transparent;
    position: relative;
    text-align: center;
  }

  .player-progress,
  .player-volume {
    background-color: var(--background-color);
    padding: 0.5rem;
    margin: 0.5rem;
    border-radius: 4px;
  }

  #playlist-songs {
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--background-color) var(--secondary-color);
  }

  #playlist-songs::-webkit-scrollbar {
    width: 5px;
  }

  #playlist-songs::-webkit-scrollbar-track {
    background: var(--background-color);
  }

  #playlist-songs::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
  }

  .playlist-song-title {
    width: 50%;
  }

  .playlist-song-artist {
    width: 30%;
  }

  .playlist-song-duration {
    width: 20%;
  }
}

@media (max-width: 400px) {
  .player {
    min-height: 360px;
  }

  .player-content {
    min-height: 320px;
  }

  #player-album-art img {
    max-width: 120px;
  }

  .player-display {
    min-height: 220px;
  }

  .player-buttons svg {
    max-width: 20px;
  }

  .playlist-song-title {
    font-size: clamp(0.7rem, 1.8vw, 0.8rem);
  }

  .playlist-song-artist,
  .playlist-song-duration {
    font-size: clamp(0.6rem, 1.5vw, 0.7rem);
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 600px;
  }

  .player,
  .playlist {
    max-width: 550px;
  }

  .player-content {
    min-height: 240px;
  }

  #player-album-art img {
    max-width: 180px;
  }

  .player-display {
    max-width: 300px;
  }
}