/* style.css */
/* -------- RESET -------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
/* -------- BASE -------- */
body,
html {
  height: 100%;
  background: #121212;
  color: white;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
.app {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: 1fr 80px;
  grid-template-areas:
    "sidebar main"
    "sidebar player";
  height: 100vh;
  width: 100vw;
}
/* ------ SIDEBAR ------ */
.sidebar {
  grid-area: sidebar;
  background: #000;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  color: red;
}
.sidebar .logo img {
  width: 100%;
  display: block;
  margin-bottom: 20px;
}
.song-list {
  list-style: none;
}
.song {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  padding: 10px;
  border-radius: 8px;
  background-color: #333;
  transition: background-color 0.2s ease;
  width: 100%;
}
.song:hover {
  background: #444;
}
.song-info .name {
  font-weight: 600;
  font-size: 0.9rem;
}
.play-btn {
  background: none;
  border: none;
  color: #1db954;
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s;
}
.play-btn:hover {
  color: white;
}
/* ---- MAIN CONTENT ---- */
.main-content {
  grid-area: main;
  padding: 20px;
  background: linear-gradient(180deg, #282828 0%, #121212 100%);
  overflow-y: auto;
}
/* ---- PLAYER BAR ---- */
.player-bar {
  grid-area: player;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #181818;
  padding: 0 20px;
  height: 80px;
}
.left-section {
  flex: 1;
}
.song-name {
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.center-section {
  flex: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.controls {
  display: flex;
  gap: 20px;
  margin-bottom: 8px;
}
.controls button {
  background: none;
  border: none;
  color: #1db954;
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
}
.controls button:hover {
  color: white;
}
.progress {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #333;
  cursor: pointer;
}
.right-section {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}
.volume {
  width: 120px;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #333;
  cursor: pointer;
}

/* ---- RESPONSIVE ---- */
/* <=1024px */
@media (max-width: 1050px) {
  .app {
    grid-template-columns: 150px 1fr;
  }
  .sidebar {
    padding: 15px;
  }
  .controls button {
    font-size: 22px;
  }
  .volume {
    width: 100px;
  }
}

/* <=768px: stack & wrap fully */
@media (max-width: 950px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "sidebar"
      "main"
      "player";
  }
  .sidebar {
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .main-content {
    padding: 15px;
  }
  .player-bar {
    flex-direction: column;
    height: auto;
    padding: 10px 15px;
    gap: 8px;
  }
  .left-section,
  .center-section,
  .right-section {
    width: 100%;
    text-align: center;
  }
  .center-section {
    order: 2;
  }
  .left-section {
    order: 1;
  }
  .right-section {
    order: 3;
  }

  /* FULL WRAP song title, no ellipsis */
  .song-name {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    display: block;
    font-size: clamp(0.6rem, 2.5vw, 1rem);
    line-height: 1.2;
  }
}

/* <=480px: tiny tweaks */
@media (max-width: 480px) {
  .song {
    flex-direction: column;
    align-items: flex-start;
  }
  .play-btn {
    align-self: flex-end;
    font-size: 18px;
  }
  .controls {
    gap: 12px;
  }
  .controls button {
    font-size: 18px;
  }
  .progress {
    height: 4px;
  }
}
