@import url('https://fonts.googleapis.com/css2?family=Libertinus+Sans:ital,wght@0,400;0,700;1,400&display=swap');

/*
      Improved CSS for Vibelist
      - Modern, Spotify-inspired UI
      - Fully Responsive Design
      - Enhanced controls and interactive elements
    */
/* NOTE: Add your main.css styles here or keep the <link> tag if it's a separate file. 
       For this example, I'll embed the necessary styles from the previous version for it to be self-contained. */
:root {
  --bg: #0f1724;
  --card: #1e293b;
  --card-light: #334155;
  --muted: #94a3b8;
  --accent: #6a7bff;
  --text: #e2e8f0;
  --border-color: rgba(255, 255, 255, 0.07);
  font-family: "Libertinus Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--card-light) transparent;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #071021 0%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 100px;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  padding: 10px 0;
  margin-bottom: 24px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

.logo span {
  color: var(--accent);
  font-size: 2rem;
}

.logo i {
  font-size: 32px;
}

.navv ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 16px;
}

.navv a {
  color: var(--muted);
  font-size: 24px;
  transition: color 0.2s ease;
  text-decoration: none;
}

.navv a:hover {
  color: var(--text);
}

.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltipText {
  visibility: hidden;
  width: 120px;
  background-color: var(--card);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;
  position: absolute;
  z-index: 1;
  bottom: 120%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 12px;
}

.tooltip:hover .tooltipText {
  visibility: visible;
  opacity: 1;
}

.controls {
  flex-grow: 1;
  display: flex;
  justify-content: center;
}

.search {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 500px;
  width: 100%;
  max-width: 400px;
  transition: background-color 0.2s;
}

.search:focus-within {
  background-color: var(--card-light);
}

.search i {
  color: var(--muted);
  font-size: 20px;
}

.search input {
  background: transparent;
  border: 0;
  color: inherit;
  outline: 0;
  width: 100%;
  font-size: 14px;
  margin-left: 12px;
}

main {
  margin-top: 32px;
}

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

.playlist-card {
  background: linear-gradient(180deg, #0b1525, #07101a);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.playlist-card h2 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 700;
}

.tracks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 8px;
  flex-grow: 1;
}

.track {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: transparent;
  transition: background-color 0.2s ease;
  position: relative;
}

.track:hover {
  background: rgba(255, 255, 255, 0.05);
}

.track .cover {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  flex: 0 0 50px;
  object-fit: cover;
}

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

.meta h3 {
  margin: 0;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta p {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--muted);
}

.play-btn {
  background: var(--accent);
  border: 0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: transform 0.1s ease, background-color 0.2s ease;
}

.save-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  cursor: pointer;
  color: var(--muted);
  transition: transform 0.08s ease, background 0.12s ease;
  flex-shrink: 0;
}

.save-btn:hover {
  transform: translateY(-2px);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
}

.save-btn.saved {
  color: var(--accent);
  border-color: rgba(106, 123, 255, 0.3);
  background: rgba(106, 123, 255, 0.06);
}

.track[draggable="true"] {
  cursor: grab;
}

.track.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.tracks.drag-over {
  outline: 2px dashed rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px;
}

/* keep audio element at same size */
audio {
  width: 100%;
  max-width: 450px;
}

.track:hover .play-btn {
  transform: scale(1.1);
}

.play-btn:active {
  transform: scale(1);
}

.play-btn.playing {
  background-color: var(--muted);
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(11, 18, 32, 0.9);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-color);
  z-index: 100;
}

.now-playing-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.track-info {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 200px;
}

#nowCover {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
}

#nowTitle {
  font-size: 14px;
  font-weight: 500;
}

#nowArtist {
  font-size: 12px;
  color: var(--muted);
}

audio {
  width: 100%;
  max-width: 450px;
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 20px;
  }

  .now-playing-bar {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }

  body {
    padding-bottom: 160px;
  }

  .track-info {
    width: 100%;
  }

  audio {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .navv ul {
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
  }

  .navv a {
    font-size: 20px;
  }

  .logo {
    font-size: 20px;
  }

  .logo i {
    font-size: 28px;
  }
}