/* ==========================================================================
   Spotify Web Player 2.0 - Core Utilities & Variables
   ========================================================================== */

:root {
  /* Spotify Palette */
  --spotify-green: #1ed760;
  --spotify-green-hover: #1fdf64;
  --spotify-green-active: #169c46;
  --spotify-green-glow: rgba(30, 215, 96, 0.35);

  /* Backgrounds */
  --bg-black: #000000;
  --bg-base: #121212;
  --bg-surface: #181818;
  --bg-elevated: #242424;
  --bg-highlight: #2a2a2a;
  --bg-glass: rgba(24, 24, 24, 0.75);
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.12);

  /* Text & Accents */
  --text-base: #ffffff;
  --text-subdued: #a7a7a7;
  --text-muted: #727272;
  --text-negative: #f15e6c;

  /* Borders & Shadows */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.16);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-elevated: 0 16px 36px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 25px var(--spotify-green-glow);

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Dynamic Ambient */
  --ambient-hue: 145deg;
  --ambient-color-1: rgba(30, 215, 96, 0.15);
  --ambient-color-2: rgba(18, 18, 18, 0.95);
}

/* Base resets & box sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-black);
  color: var(--text-base);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  user-select: none;
}

/* Flexbox utilities */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }

/* Grid utilities */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Spacing gaps */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }

/* Margins & Paddings */
.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }

/* Backgrounds */
.bg-black { background-color: var(--bg-black); }
.bg-base { background-color: var(--bg-base); }
.bg-surface { background-color: var(--bg-surface); }
.bg-elevated { background-color: var(--bg-elevated); }
.bg-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Typography utilities */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.text-white { color: #ffffff; }
.text-subdued { color: var(--text-subdued); }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--spotify-green); }
.text-center { text-align: center; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Border Radius */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }
.border { border: 1px solid var(--border-subtle); }
.border-subtle { border-color: var(--border-subtle); }

/* SVG Invert & Icon helpers */
.invert { filter: invert(1); }
.cursor-pointer { cursor: pointer; }
.transition { transition: all var(--transition-normal); }

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  transition: background-color var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.32);
}

/* Equalizer Bars Animation */
.equalizer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  width: 14px;
}

.equalizer-bar {
  width: 3px;
  background-color: var(--spotify-green);
  border-radius: 1px;
  animation: equalizerBounce 1s infinite ease-in-out alternate;
}

.equalizer-bar:nth-child(1) { height: 60%; animation-delay: 0.1s; }
.equalizer-bar:nth-child(2) { height: 100%; animation-delay: 0.3s; }
.equalizer-bar:nth-child(3) { height: 40%; animation-delay: 0.2s; }
.equalizer-bar:nth-child(4) { height: 80%; animation-delay: 0.4s; }

@keyframes equalizerBounce {
  0% { height: 20%; }
  100% { height: 100%; }
}

/* Ambient Pulse Animation */
@keyframes ambientGlowPulse {
  0% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 0.95; transform: scale(1.04); }
  100% { opacity: 0.7; transform: scale(1); }
}

/* Ripple & Pop Animations */
@keyframes popHeart {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.pop-anim {
  animation: popHeart 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 104px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: #1ed760;
  color: #000;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  z-index: 4000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}