/* ============================================
   FastFit Beat — Vanilla CSS
   ============================================ */

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

:root {
  --bg: #000;
  --fg: #f5f5f5;
  --card-bg: #1a1d23;
  --card-hover: #22262e;
  --border: #2a2d35;
  --muted: #888;
  --gym-primary: hsl(65 92% 56%);
  --gym-primary-glow: hsl(65 100% 70%);
  --gym-secondary: hsl(195 100% 50%);
  --gym-accent: hsl(45 100% 51%);
  --player-bg: rgba(12, 13, 16, 0.95);
  --radius: 12px;
  --shadow-card: 0 4px 20px rgba(0,0,0,.5);
  --shadow-glow: 0 0 40px rgba(120,80,255,.3);
  --transition: .25s cubic-bezier(.4,0,.2,1);
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

/* hide scrollbar */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; }

/* ---------- App shell ---------- */
#app {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  padding: 24px 0 140px;  /* equal top padding, bottom accounts for player bar */
}

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px 8px;
  gap: 10px;
}

.header img {
  height: 72px;
  width: auto;
}

.header h1 {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--gym-primary), var(--gym-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  padding: 0 16px 16px;
  letter-spacing: .02em;
}

/* ---------- Station Grid ---------- */
.stations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 12px 24px;
}

.station-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  background: var(--card-bg);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
  -webkit-user-select: none;
  user-select: none;
}

.station-card:hover,
.station-card:active {
  transform: scale(1.03);
}

.station-card.active {
  box-shadow: 0 0 0 2px var(--gym-primary), var(--shadow-card);
}

.station-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}

.station-card:hover img {
  transform: scale(1.08);
}

.station-card .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.15) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
}

.station-card .station-name {
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.station-card .station-genre {
  font-size: .65rem;
  color: rgba(255,255,255,.6);
  letter-spacing: .04em;
  margin-top: 2px;
}

.station-card .play-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gym-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.8);
  transition: all var(--transition);
}

.station-card.active .play-indicator {
  opacity: 1;
  transform: scale(1);
}

.play-indicator svg {
  width: 12px;
  height: 12px;
  fill: #000;
}

/* ---------- Bottom Player Bar ---------- */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  background: var(--player-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,.08);
  z-index: 100;
  padding: 0;
  transition: transform .4s ease;
}

.player-bar.hidden {
  transform: translateX(-50%) translateY(100%);
}

/* Now Playing info row */
.now-playing {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 8px;
}

.now-playing-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

.now-playing-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.now-playing-info {
  flex: 1;
  min-width: 0;
}

.now-playing-station {
  font-size: .85rem;
  font-weight: 700;
  color: var(--gym-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-playing-status {
  font-size: .7rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* Controls row */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px 14px;
  gap: 12px;
}

/* Play button */
.play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--gym-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), transform .15s ease, box-shadow var(--transition);
  box-shadow: 0 0 20px rgba(200,220,0,.25);
}

.play-btn:hover {
  background: var(--gym-primary-glow);
  box-shadow: 0 0 30px rgba(200,220,0,.4);
}

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

.play-btn svg {
  width: 22px;
  height: 22px;
  fill: #000;
}

/* Equalizer */
.equalizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
  flex-shrink: 0;
}

.eq-bar {
  width: 4px;
  border-radius: 2px;
  background: var(--gym-primary);
  transition: height .15s ease;
}

.eq-bar.paused {
  height: 4px !important;
}

/* Volume */
.volume-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 140px;
}

.volume-wrap svg {
  width: 18px;
  height: 18px;
  fill: var(--muted);
  flex-shrink: 0;
  cursor: pointer;
  transition: fill var(--transition);
}

.volume-wrap svg:hover {
  fill: var(--fg);
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gym-primary);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(200,220,0,.4);
}

.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gym-primary);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(200,220,0,.4);
}

/* Loading spinner */
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(0,0,0,.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Animations ---------- */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.station-card {
  animation: fade-in-up .5s ease backwards;
}

.station-card:nth-child(1) { animation-delay: .05s; }
.station-card:nth-child(2) { animation-delay: .1s; }
.station-card:nth-child(3) { animation-delay: .15s; }
.station-card:nth-child(4) { animation-delay: .2s; }
.station-card:nth-child(5) { animation-delay: .25s; }
.station-card:nth-child(6) { animation-delay: .3s; }

/* ---------- Safe area (iOS notch) ---------- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .player-bar {
    padding-bottom: env(safe-area-inset-bottom);
  }
  #app {
    padding-bottom: calc(140px + env(safe-area-inset-bottom));
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 360px) {
  .stations { gap: 8px; padding: 0 8px 20px; }
  .now-playing { padding: 10px 12px 6px; }
  .controls { padding: 4px 12px 12px; }
}
