/* ─── Tokens ──────────────────────────────────────────────── */
:root {
  --bg:          #f8f9fc;
  --surface:     #ffffff;
  --surface2:    #f0f2f7;
  --border:      #e2e6ee;
  --text:        #1a1d27;
  --text-muted:  #6b7280;
  --accent:      #6c63ff;
  --accent-dim:  #ede9ff;
  --danger:      #ef4444;
  --radius:      14px;
  --shadow:      0 2px 12px rgba(0,0,0,.07);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.12);
  --font:        'Inter', system-ui, sans-serif;
  --transition:  .2s ease;
}

[data-theme="dark"] {
  --bg:          #0f1117;
  --surface:     #1a1d27;
  --surface2:    #22263a;
  --border:      #2e3347;
  --text:        #e8eaf0;
  --text-muted:  #8b92a8;
  --accent:      #8b84ff;
  --accent-dim:  #1e1b40;
  --shadow:      0 2px 12px rgba(0,0,0,.3);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.5);
}

/* ─── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Container ───────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ─── Header ──────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: .9rem;
  padding-bottom: .9rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.brand-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}

.brand-sub {
  font-size: .75rem;
  color: var(--text-muted);
  display: none;
}

@media (min-width: 600px) { .brand-sub { display: block; } }

/* ─── Theme toggle ────────────────────────────────────────── */
.theme-toggle {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .45rem .6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .3rem;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.theme-toggle:hover { background: var(--accent-dim); color: var(--accent); }

.theme-toggle svg { width: 16px; height: 16px; }

[data-theme="dark"] .icon-sun  { display: block; }
[data-theme="dark"] .icon-moon { display: none;  }
[data-theme="light"] .icon-sun  { display: none;  }
[data-theme="light"] .icon-moon { display: block; }
[data-theme="auto"]  .icon-sun  { display: none;  }
[data-theme="auto"]  .icon-moon { display: block; }

/* ─── Player bar ──────────────────────────────────────────── */
.player-bar {
  position: sticky;
  top: 61px;
  z-index: 90;
  background: var(--accent);
  color: white;
  padding: .65rem 0;
  box-shadow: var(--shadow-lg);
}

.player-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .8rem;
}

.player-info {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.player-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 22px;
}

.player-wave span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,.85);
  animation: wave 1.1s ease-in-out infinite;
}

.player-wave span:nth-child(1) { height: 8px;  animation-delay: 0s; }
.player-wave span:nth-child(2) { height: 16px; animation-delay: .15s; }
.player-wave span:nth-child(3) { height: 22px; animation-delay: .3s; }
.player-wave span:nth-child(4) { height: 14px; animation-delay: .45s; }
.player-wave span:nth-child(5) { height: 10px; animation-delay: .6s; }

@keyframes wave {
  0%,100% { transform: scaleY(1); }
  50%      { transform: scaleY(.4); }
}

.player-name { font-weight: 600; font-size: .95rem; }
.player-meta { font-size: .78rem; opacity: .8; }

.player-controls {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.btn-icon {
  background: rgba(255,255,255,.2);
  border: none;
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: white;
  transition: background var(--transition);
}
.btn-icon:hover { background: rgba(255,255,255,.35); }
.btn-icon svg { width: 18px; height: 18px; }

.volume-slider {
  -webkit-appearance: none;
  width: 90px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.4);
  outline: none;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: white;
}

.player-error {
  font-size: .78rem;
  background: rgba(0,0,0,.25);
  padding: .25rem .6rem;
  border-radius: 999px;
}

/* ─── Main ────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.hero {
  margin-bottom: 2rem;
}

.hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.2;
}

.hero-sub {
  margin-top: .5rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ─── Search ──────────────────────────────────────────────── */
.search-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: .85rem 1rem .85rem 2.75rem;
  font-size: 1rem;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ─── Filters ─────────────────────────────────────────────── */
.filters {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

select {
  padding: .55rem .9rem;
  font-family: var(--font);
  font-size: .9rem;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
select:focus { border-color: var(--accent); }

.results-count {
  margin-left: auto;
  font-size: .85rem;
  color: var(--text-muted);
}

/* ─── Grid / Cards ────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .55rem;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--accent);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}

.card-logo {
  width: 44px; height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface2);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.card-logo-placeholder {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1.3rem;
}

.card h3 {
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.badge {
  font-size: .72rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-weight: 500;
}

.badge-accent {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: transparent;
}

.card-actions {
  margin-top: auto;
  display: flex;
  gap: .5rem;
}

.btn {
  padding: .5rem .9rem;
  border: none;
  border-radius: 8px;
  font-size: .85rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition), background var(--transition);
  display: flex;
  align-items: center;
  gap: .35rem;
}
.btn:hover { opacity: .85; }

.btn-primary { background: var(--accent); color: white; }
.btn-ghost {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); }

.btn svg { width: 15px; height: 15px; }

/* ─── Empty state ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}
.empty-state svg { width: 56px; height: 56px; margin: 0 auto 1rem; display: block; opacity: .4; }

/* ─── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.footer-tagline {
  font-size: .8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-links a {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .88rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--accent); }
.footer-links svg { width: 16px; height: 16px; }

.footer-copy {
  width: 100%;
  font-size: .78rem;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: .5rem;
}
