/* ===================================================================
   aiTunes.pro — stylesheet
   Vanilla CSS, no build step. Mobile-first, responsive.
   =================================================================== */

:root {
  --bg:        #0c0d12;
  --bg-2:      #14161f;
  --panel:     #191c27;
  --panel-2:   #212533;
  --border:    #2a2f40;
  --text:      #f2f3f7;
  --text-dim:  #9aa0b4;
  --text-mute: #6b7187;
  --accent:    #7c5cff;
  --accent-2:  #00d4b8;
  --accent-hot:#ff5c8a;
  --grad:      linear-gradient(120deg, #7c5cff 0%, #00d4b8 100%);
  --grad-hot:  linear-gradient(120deg, #ff5c8a 0%, #7c5cff 100%);
  --shadow:    0 8px 30px rgba(0, 0, 0, 0.45);
  --radius:    14px;
  --player-h:  88px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(0, 212, 184, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(var(--player-h) + 24px);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }

/* ===================== HEADER ===================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(16px, 4vw, 48px);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 800;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow);
}
.brand-text h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.brand-text h1 .dot { color: var(--accent-2); }
.tagline { color: var(--text-dim); font-size: 0.85rem; }

.header-links { display: flex; align-items: center; gap: 18px; }
.header-links a { color: var(--text-dim); font-weight: 500; font-size: 0.92rem; transition: color 0.15s; }
.header-links a:hover { color: var(--text); }
.header-links .cta {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 10px;
}
.header-links .cta:hover { border-color: var(--accent); }

/* ===================== HERO ===================== */
.hero { padding: 28px clamp(16px, 4vw, 48px) 8px; }
.hero-inner {
  background: linear-gradient(160deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: clamp(22px, 4vw, 40px);
  box-shadow: var(--shadow);
}
.hero h2 { font-size: clamp(1.4rem, 3.2vw, 2.1rem); font-weight: 800; letter-spacing: -0.02em; }
.hero-sub { color: var(--text-dim); margin-top: 6px; max-width: 60ch; }

.mood-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.mood-chip {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
}
.mood-chip:hover { transform: translateY(-2px); border-color: var(--accent); }
.mood-chip .emoji { margin-right: 6px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.btn {
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.12s, filter 0.15s, border-color 0.15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 20px rgba(124, 92, 255, 0.35); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent-2); }
.btn-yt { background: #ff0033; color: #fff; box-shadow: 0 6px 20px rgba(255, 0, 51, 0.3); }
.btn-yt:hover { filter: brightness(1.08); }

/* ===================== LIBRARY ===================== */
.library { padding: 18px clamp(16px, 4vw, 48px) 40px; }
.library-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.album-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.album-chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.15s;
}
.album-chip:hover { color: var(--text); border-color: var(--accent); }
.album-chip.active { background: var(--grad); color: #fff; border-color: transparent; }
.album-chip .count { opacity: 0.7; font-weight: 400; margin-left: 5px; }

.search-wrap { position: relative; display: flex; align-items: center; gap: 10px; }
#searchInput {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  min-width: 220px;
  outline: none;
  transition: border-color 0.15s;
}
#searchInput:focus { border-color: var(--accent); }
#searchInput::placeholder { color: var(--text-mute); }
.result-count { color: var(--text-mute); font-size: 0.82rem; white-space: nowrap; }

/* ---------- Track list ---------- */
.track-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.track {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.13s, border-color 0.13s, transform 0.08s;
}
.track:hover { background: var(--panel-2); border-color: var(--border); }
.track.playing { border-color: var(--accent); background: linear-gradient(100deg, rgba(124, 92, 255, 0.14), var(--panel-2)); }

/* cover-art thumbnail (replaces the old row number) */
.track-art-wrap {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--grad-hot);
  flex-shrink: 0;
}
.track-art { width: 100%; height: 100%; object-fit: cover; display: block; }
.art-eq {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; justify-content: center;
  gap: 2px; padding-bottom: 8px;
  background: rgba(0, 0, 0, 0.45);
  height: auto;
}

.track-main { min-width: 0; }
.track-title {
  font-weight: 600;
  font-size: 0.96rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track.playing .track-title { color: var(--accent-2); }
.track-album { color: var(--text-mute); font-size: 0.78rem; }

.track-badge {
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.track-size { color: var(--text-mute); font-size: 0.75rem; font-variant-numeric: tabular-nums; }

/* equalizer animation on the playing row */
.eq { display: inline-flex; gap: 2px; height: 12px; align-items: flex-end; }
.eq span { width: 3px; background: var(--accent-2); border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.eq span:nth-child(2) { animation-delay: 0.25s; }
.eq span:nth-child(3) { animation-delay: 0.5s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 12px; } }

.empty-state { text-align: center; color: var(--text-mute); padding: 48px 0; }

/* ===================== FOOTER ===================== */
.site-footer {
  text-align: center;
  color: var(--text-mute);
  font-size: 0.82rem;
  padding: 24px 16px 8px;
  line-height: 1.8;
}
.site-footer a { color: var(--text-dim); text-decoration: underline; }
.footer-meta { font-size: 0.78rem; }

/* ===================== STICKY PLAYER ===================== */
.player-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--player-h);
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(280px, 2fr) minmax(120px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0 clamp(14px, 3vw, 32px);
  background: rgba(16, 18, 26, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 50;
}

.np-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.np-art {
  width: 50px; height: 50px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 22px;
  background: var(--grad-hot);
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.np-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-text { min-width: 0; }
.np-title { font-weight: 600; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-album { color: var(--text-mute); font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.np-controls { display: flex; flex-direction: column; gap: 4px; }
.control-buttons { display: flex; align-items: center; justify-content: center; gap: 10px; }
.ctrl {
  background: transparent;
  color: var(--text-dim);
  font-size: 1.05rem;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  transition: color 0.13s, background 0.13s, transform 0.1s;
}
.ctrl:hover { color: var(--text); background: var(--panel-2); }
.ctrl:active { transform: scale(0.92); }
.ctrl-play {
  background: var(--text);
  color: var(--bg);
  width: 44px; height: 44px;
  font-size: 1.15rem;
}
.ctrl-play:hover { background: #fff; color: var(--bg); transform: scale(1.05); }
.ctrl-toggle.on { color: var(--accent-2); }

.seek-row { display: flex; align-items: center; gap: 10px; }
.time { color: var(--text-mute); font-size: 0.72rem; font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 5px;
  border-radius: 999px;
  background: var(--panel-2);
  outline: none;
  cursor: pointer;
}
#seekBar { flex: 1; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25);
  transition: transform 0.1s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border: none; border-radius: 50%;
  background: var(--text);
}

.np-extra { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.vol-wrap { display: flex; align-items: center; gap: 6px; color: var(--text-mute); }
#volBar { width: 80px; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 760px) {
  .track { grid-template-columns: 44px 1fr auto; }
  .track-badge { display: none; }

  .player-bar {
    grid-template-columns: 1fr auto;
    grid-template-areas: "info extra" "controls controls";
    height: auto;
    padding: 10px clamp(14px, 3vw, 32px);
    gap: 8px 16px;
  }
  .np-info { grid-area: info; }
  .np-extra { grid-area: extra; }
  .np-controls { grid-area: controls; }
  body { padding-bottom: 140px; }
  #volBar { width: 60px; }
}

@media (max-width: 480px) {
  .header-links .cta { display: none; }
  .np-extra #loopBtn { display: none; }
  .track-size { display: none; }
  .track { grid-template-columns: 44px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; transition: none !important; }
}
