/* =========================================================
   MA RADIO — Feuille de style complète
   ========================================================= */

:root {
  --bg:        #0a0a0f;
  --bg-2:      #12121c;
  --card:      rgba(255, 255, 255, 0.045);
  --card-brd:  rgba(255, 255, 255, 0.09);
  --txt:       #f4f4f8;
  --txt-dim:   #a0a0b4;
  --txt-faint: #6b6b82;
  --accent:    #ff2d55;
  --accent-2:  #7c3aed;
  --accent-3:  #22d3ee;
  --live:      #21d07a;
  --radius:    20px;
  --shadow:    0 20px 60px rgba(0, 0, 0, 0.55);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--txt);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Fond animé ---------- */
.bg-gradient {
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(45% 45% at 20% 20%, rgba(124, 58, 237, 0.35), transparent 60%),
    radial-gradient(50% 50% at 82% 15%, rgba(255, 45, 85, 0.28), transparent 60%),
    radial-gradient(55% 55% at 65% 90%, rgba(34, 211, 238, 0.22), transparent 60%),
    var(--bg);
  filter: saturate(1.1);
  animation: drift 22s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-3%, 2%, 0) scale(1.08); }
}
.bg-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout ---------- */
.app {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(255, 45, 85, 0.35);
  position: relative;
}
.live-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
}
.brand-text h1 {
  font-size: 20px; font-weight: 800; letter-spacing: -0.02em;
}
.brand-text p {
  font-size: 12.5px; color: var(--txt-dim); margin-top: 2px;
}
.onair {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--card-brd);
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--txt-dim);
  transition: all 0.3s ease;
}
.onair.is-live { color: var(--live); border-color: rgba(33, 208, 122, 0.4); }
.onair-pulse {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--txt-faint);
}
.onair.is-live .onair-pulse {
  background: var(--live);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(33, 208, 122, 0.6); }
  100% { box-shadow: 0 0 0 12px rgba(33, 208, 122, 0); }
}

/* ---------- Player ---------- */
.player {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 30px;
  align-items: center;
  padding: 30px;
  background: var(--card);
  border: 1px solid var(--card-brd);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.player-art {
  position: relative;
  width: 220px; height: 220px;
  display: grid; place-items: center;
}
.vinyl {
  width: 200px; height: 200px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at center, #15151f 0 2px, #0c0c14 2px 4px),
    #0c0c14;
  box-shadow: inset 0 0 0 8px #0a0a12, var(--shadow);
  position: relative;
  animation: spin 6s linear infinite;
  animation-play-state: paused;
}
.player.is-playing .vinyl { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }
.vinyl-center {
  position: absolute; inset: 0; margin: auto;
  width: 66px; height: 66px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px #0a0a12, 0 6px 18px rgba(0,0,0,0.5);
}
.vinyl-center::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 10px; height: 10px; border-radius: 50%; background: #0a0a12;
}

/* Pochette (cover) : affichée en label circulaire sur le vinyle */
.cover {
  position: absolute; inset: 14px;
  border-radius: 50%; object-fit: cover;
  display: none;
  box-shadow: inset 0 0 0 6px #0a0a12, 0 6px 18px rgba(0,0,0,0.5);
}
.player.has-cover .cover { display: block; }
.player.has-cover .vinyl-center { display: none; }

/* Equalizer */
.equalizer {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: flex-end; gap: 3px; height: 34px;
  opacity: 0; transition: opacity 0.3s;
}
.player.is-playing .equalizer { opacity: 1; }
.equalizer span {
  width: 4px; border-radius: 3px;
  background: linear-gradient(var(--accent-3), var(--accent));
  animation: eq 0.9s ease-in-out infinite;
}
.equalizer span:nth-child(odd)  { animation-duration: 1.1s; }
.equalizer span:nth-child(3n)   { animation-duration: 0.7s; }
.equalizer span:nth-child(1){height:40%} .equalizer span:nth-child(2){height:70%}
.equalizer span:nth-child(3){height:100%} .equalizer span:nth-child(4){height:55%}
.equalizer span:nth-child(5){height:85%} .equalizer span:nth-child(6){height:45%}
.equalizer span:nth-child(7){height:95%} .equalizer span:nth-child(8){height:60%}
.equalizer span:nth-child(9){height:80%} .equalizer span:nth-child(10){height:50%}
@keyframes eq { 0%,100%{transform:scaleY(0.4)} 50%{transform:scaleY(1)} }

.player-info { min-width: 0; }
.now-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em;
  color: var(--accent-3);
}
.now-title {
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em;
  margin: 8px 0 4px; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.now-artist { font-size: 14.5px; color: var(--txt-dim); }

/* Progress */
.progress { margin: 22px 0 20px; }
.progress-bar {
  height: 6px; border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3));
  border-radius: 999px;
  transition: width 0.25s linear;
}
.progress-time {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--txt-faint);
  margin-top: 8px; font-variant-numeric: tabular-nums;
}

/* Controls */
.controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.btn-tune {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-family: var(--font); font-size: 15px; font-weight: 700;
  box-shadow: 0 10px 26px rgba(255, 45, 85, 0.4);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.btn-tune:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(255, 45, 85, 0.5); }
.btn-tune:active { transform: translateY(0); }
.btn-tune svg { fill: #fff; }
.btn-tune .ico-pause { display: none; }
.player.is-playing .btn-tune .ico-play { display: none; }
.player.is-playing .btn-tune .ico-pause { display: block; }

.btn-live {
  padding: 12px 16px; border-radius: 999px; cursor: pointer;
  background: var(--card); border: 1px solid var(--card-brd);
  color: var(--txt-dim); font-family: var(--font); font-size: 13px; font-weight: 600;
  transition: all 0.2s ease;
}
.btn-live:hover { color: var(--txt); border-color: var(--accent-3); }

.volume { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.btn-mute {
  background: none; border: none; cursor: pointer; color: var(--txt-dim);
  display: grid; place-items: center; padding: 4px;
}
.btn-mute svg { fill: currentColor; }
.btn-mute:hover { color: var(--txt); }
.btn-mute.is-muted { color: var(--accent); }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 110px; height: 5px; border-radius: 999px;
  background: rgba(255,255,255,0.12); cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px; border: none; border-radius: 50%; background: #fff;
}

/* ---------- Schedule ---------- */
.schedule {
  background: var(--card);
  border: 1px solid var(--card-brd);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.schedule-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.schedule-head h3 { font-size: 17px; font-weight: 700; }
.schedule-hint { font-size: 12px; color: var(--txt-faint); }

.tracklist { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.track {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center;
  gap: 14px; padding: 12px 14px; border-radius: 12px;
  transition: background 0.2s ease;
}
.track:hover { background: rgba(255,255,255,0.04); }
.track.is-current { background: rgba(255, 45, 85, 0.1); }
.track-idx {
  font-size: 13px; color: var(--txt-faint); font-variant-numeric: tabular-nums;
  text-align: center;
}
.track.is-current .track-idx { color: var(--accent); }
.track-bars {
  display: none; align-items: flex-end; gap: 2px; height: 16px; justify-content: center;
}
.track.is-current .track-idx { display: none; }
.track.is-current .track-bars { display: flex; }
.track-bars span {
  width: 3px; background: var(--accent); border-radius: 2px;
  animation: eq 0.8s ease-in-out infinite;
}
.track-bars span:nth-child(1){height:60%} .track-bars span:nth-child(2){height:100%;animation-duration:0.6s}
.track-bars span:nth-child(3){height:40%;animation-duration:1s}
.track-meta { min-width: 0; }
.track-title {
  font-size: 14.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-artist { font-size: 12.5px; color: var(--txt-dim); }
.track-dur { font-size: 13px; color: var(--txt-faint); font-variant-numeric: tabular-nums; }
.track-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--live); border: 1px solid rgba(33,208,122,0.4);
  padding: 3px 8px; border-radius: 999px; display: none;
}
.track.is-current .track-badge { display: inline-block; }

/* ---------- Footer ---------- */
.footer {
  text-align: center; font-size: 12.5px; color: var(--txt-faint);
  padding-top: 6px;
}
.footer-admin { margin-top: 8px; }
.footer-admin a {
  color: var(--txt-dim); text-decoration: none;
  border: 1px solid var(--card-brd); border-radius: 999px;
  padding: 5px 12px; transition: all 0.2s ease;
}
.footer-admin a:hover { color: var(--txt); border-color: var(--accent-3); }

/* ---------- États ---------- */
.is-loading .now-title::after {
  content: ""; display: inline-block; width: 14px; height: 14px;
  margin-left: 8px; vertical-align: middle;
  border: 2px solid rgba(255,255,255,0.25); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}

/* ---------- Responsive ---------- */
@media (max-width: 680px) {
  .player { grid-template-columns: 1fr; text-align: center; padding: 26px 20px; }
  .player-art { margin: 0 auto; width: 190px; height: 190px; }
  .vinyl { width: 175px; height: 175px; }
  .now-title { white-space: normal; font-size: 22px; }
  .controls { justify-content: center; }
  .volume { margin-left: 0; width: 100%; justify-content: center; }
  .onair { display: none; }
}
