/* ==== GLOBAL RESET ==== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: Arial, sans-serif; }
body {
  background-color: #121212;
  color: #ffffff;
  display: flex;
  flex-direction: column;
}

/* ==== LAYOUT ==== */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 240px;
  background-color: #000;
  padding: 20px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #222;
}
.logo {
  display: flex; align-items: center; font-weight: bold;
  font-size: 18px; margin-bottom: 30px; gap: 10px;
}
.logo-mark {
  width: 40px; height: 40px; border-radius: 8px;
  background: linear-gradient(135deg, #1DB954, #1ed760);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff;
}
.logo-text { font-size: 14px; }
.logo-text small { color: #888; }

.nav-main { display: flex; flex-direction: column; gap: 6px; }
.nav-btn {
  background: none; border: none; color: #aaa;
  text-align: left; padding: 10px; border-radius: 8px;
  font-size: 15px; display: flex; gap: 10px; align-items: center;
  cursor: pointer; transition: background .2s, color .2s;
}
.nav-btn:hover, .nav-btn.active { background: #1e1e1e; color: #1DB954; }

/* ==== MAIN ==== */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid #222;
  background: #000;
}
.search-inline {
  display: flex; align-items: center; background: #1e1e1e;
  padding: 6px 12px; border-radius: 20px; gap: 8px; width: 50%;
}
.search-inline input {
  border: none; background: none; color: #fff; outline: none; flex: 1;
}
.search-inline i { color: #888; }
.top-actions { display: flex; gap: 14px; }
.top-actions a, .top-actions button {
  background: none; border: none; color: #aaa; cursor: pointer; font-size: 18px;
}

.pages {
  flex: 1; overflow-y: auto; padding: 20px;
  padding-bottom: 140px; /* leave space for player */
}
.page { display: none; }
.page.active { display: block; }

/* ==== HERO ==== */
.hero {
  background: linear-gradient(135deg, rgba(30,215,96,0.15), rgba(0,0,0,0.6));
  border-radius: 12px; padding: 20px; display: flex; gap: 16px; align-items: center;
}
.hero-art {
  width: 80px; height: 80px; border-radius: 12px; background: #1DB954;
  display: flex; align-items: center; justify-content: center; font-size: 32px;
}
.hero-meta strong { color: #aaa; font-size: 13px; }
.hero-meta h2 { font-size: 20px; margin-top: 6px; }
.chips { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.chip {
  background: #1e1e1e; color: #1DB954; padding: 4px 10px;
  border-radius: 999px; font-size: 12px;
}

/* ==== GRIDS ==== */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill,minmax(160px,1fr));
  gap: 16px; margin-top: 14px;
}
.artist-card, .album-item, .track-card {
  background: #1e1e1e; border-radius: 10px; padding: 12px;
  transition: background .2s, transform .2s; cursor: pointer;
}
.artist-card:hover, .album-item:hover, .track-card:hover {
  background: #282828; transform: translateY(-4px);
}
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.cover {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.artist-info h3 { font-size: 14px; margin: 0; }
.artist-info p { font-size: 12px; color: #aaa; }

/* Album style */
.album-item img {
  width: 100%; border-radius: 6px; margin-bottom: 8px;
}
.album-item .title { font-weight: bold; }
.album-item .artist { font-size: 13px; color: #aaa; }
.album-item .play-button {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(0,0,0,0.7); border-radius: 50%; width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  color: #1DB954; font-size: 24px; opacity: 0;
}
.album-item:hover .play-button { opacity: 1; }

/* ==== PLAYLISTS ==== */
.page-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.page-head input {
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid #333;
  background: #1e1e1e;
  color: #fff;
  flex: 1;
  transition: border 0.2s, box-shadow 0.2s;
}
.page-head input:focus {
  outline: none;
  border: 1px solid #1DB954;
  box-shadow: 0 0 0 2px rgba(30,215,96,0.3);
}
.page-head button {
  background: #1DB954;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: bold;
  color: #000;
  transition: background 0.2s;
}
.page-head button:hover { background: #1ed760; }

.playlists-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.playlist-card {
  background: #1e1e1e;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}
.playlist-card:hover {
  background: #282828;
  transform: translateY(-4px);
}
.playlist-card strong { display: block; font-size: 15px; }
.playlist-card small { color: #aaa; font-size: 12px; }

.playlist-tracks { margin-top: 20px; }
.playlist-track {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: 8px;
  background: #1e1e1e; margin-bottom: 8px;
  transition: background 0.2s;
}
.playlist-track:hover { background: #282828; }
.playlist-track .info { display: flex; align-items: center; gap: 12px; }
.playlist-track .info img {
  width: 44px; height: 44px; border-radius: 6px; object-fit: cover;
}
.playlist-track strong { font-size: 14px; }
.playlist-track small { color: #aaa; font-size: 12px; }
.playlist-track button {
  background: none; border: none; cursor: pointer; font-size: 14px;
  color: #aaa; margin-left: 6px;
}
.playlist-track button:hover { color: #1DB954; }

/* ==== SEARCH ==== */
#searchInput {
  width: 100%;
  padding: 12px 14px;
  margin: 10px 0;
  border-radius: 25px;
  border: 1px solid #333;
  background: #1e1e1e;
  color: #fff;
  transition: border 0.2s, box-shadow 0.2s;
}
#searchInput:focus {
  outline: none;
  border: 1px solid #1DB954;
  box-shadow: 0 0 0 2px rgba(30,215,96,0.3);
}
.search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.track-card {
  background: #1e1e1e;
  border-radius: 10px;
  padding: 12px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  transition: background 0.2s, transform 0.2s;
}
.track-card:hover { background: #282828; transform: translateY(-4px); }
.track-card img {
  width: 100%; border-radius: 8px; margin-bottom: 8px; height: 150px; object-fit: cover;
}
.track-card .title { font-weight: bold; margin-bottom: 4px; }
.track-card .sub { color: #aaa; font-size: 13px; }
.track-card button {
  margin-top: 6px;
  background: #1DB954;
  border: none;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  color: #000;
  transition: background 0.2s;
}
.track-card button:hover { background: #1ed760; }


/* ==== PLAYER FOOTER ==== */
.player {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 90px; background: #000; border-top: 1px solid #222;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; z-index: 100;
}
.player-left { display: flex; align-items: center; gap: 12px; }
.player-thumb { width: 60px; height: 60px; border-radius: 6px; background: #1DB954; object-fit: cover; }
.player-title { font-weight: bold; }
.player-artist { font-size: 12px; color: #aaa; }

.player-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.controls { display: flex; gap: 12px; }
.controls button {
  background: none; border: none; color: #fff; cursor: pointer; font-size: 18px;
}
#playPause {
  background: #1DB954; color: #000; border-radius: 50%; width: 44px; height: 44px;
  font-weight: bold;
}
.progress-group { display: flex; align-items: center; gap: 6px; width: 70%; }
.progress-group input[type="range"] {
  flex: 1; -webkit-appearance: none; height: 4px; background: #333;
  border-radius: 2px; outline: none;
}
.progress-group input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px;
  border-radius: 50%; background: #1DB954; cursor: pointer;
}
#currentTime, #durationTime { font-size: 12px; color: #aaa; width: 40px; text-align: center; }

.player-right { display: flex; gap: 12px; align-items: center; }
.volume input[type="range"] {
  width: 80px; -webkit-appearance: none; height: 4px;
  background: #333; border-radius: 2px;
}
.volume input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: #1DB954; cursor: pointer;
}

/* ==== MODAL ==== */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: none; align-items: center; justify-content: center; z-index: 200;
}
.modal[aria-hidden="false"] { display: flex; }
.modal-inner {
  background: #1e1e1e; padding: 20px; border-radius: 10px;
  width: 90%; max-width: 600px; max-height: 80vh; overflow-y: auto; position: relative;
}
.modal-close { position: absolute; top: 10px; right: 10px; background: none; border: none; color: #aaa; font-size: 18px; }

/* ==== MOBILE ==== */
.mobile-only { display: none; }
.bottom-nav {
  display: none;
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .mobile-only { display: flex; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 90px; left: 0; right: 0;
    height: 60px; background: #111; border-top: 1px solid #222;
    justify-content: space-around; align-items: center; z-index: 90;
  }
  .bottom-nav .bt {
    background: none; border: none; color: #aaa; font-size: 14px;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
  }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .player { height: 80px; padding: 8px; }
}
@media (max-width: 500px) {
  .grid { grid-template-columns: repeat(2,1fr); }
  .search-inline { width: 70%; }
  .progress-group { display: none; }
  .player-thumb { width: 50px; height: 50px; }
}
