/* ============================================================
   Al Karma FM — Premium Radio Player
   Mobile-first, responsive, no frameworks
   ============================================================ */

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

:root {
  --bg: #0a0a0f;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-glow: rgba(138, 92, 246, 0.12);

  --accent: #a78bfa;
  --accent-bright: #c4b5fd;
  --accent-deep: #7c3aed;
  --accent-glow: rgba(167, 139, 250, 0.35);

  --gold: #f59e0b;
  --gold-soft: rgba(245, 158, 11, 0.15);

  --text-primary: #f1f0ff;
  --text-secondary: rgba(241, 240, 255, 0.55);
  --text-muted: rgba(241, 240, 255, 0.35);

  --green: #34d399;
  --green-glow: rgba(52, 211, 153, 0.4);

  --red: #f87171;

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-card: 28px;
  --radius-btn: 100px;

  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* ── Background Orbs ── */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: orb-float 12s ease-in-out infinite;
}

.orb-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #6d28d9 0%, transparent 70%);
  top: -200px; left: -150px;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #1e40af 0%, transparent 70%);
  bottom: -100px; right: -100px;
  animation-delay: -4s;
}

.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
  top: 50%; left: 55%;
  transform: translate(-50%, -50%);
  animation-delay: -8s;
  opacity: 0.2;
}

@keyframes orb-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

/* ── Layout ── */
.main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* ── Card ── */
.card {
  width: 100%;
  max-width: 400px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 40px 32px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 32px 80px rgba(0,0,0,0.5),
    0 0 60px var(--card-glow);
}

/* ── Logo ── */
.logo-wrap {
  position: relative;
  margin-bottom: 28px;
}

.logo-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(167,139,250,0.18), rgba(109,40,217,0.1));
  border: 1.5px solid rgba(167,139,250,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  box-shadow:
    0 0 30px rgba(124,58,237,0.2),
    0 0 0 6px rgba(167,139,250,0.06);
}

.logo-inner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(167,139,250,0.15), rgba(109,40,217,0.08));
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon {
  width: 40px;
  height: 40px;
  color: var(--accent);
}

.logo-pulse {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1.5px solid rgba(167,139,250,0.18);
  opacity: 0;
  z-index: 0;
}

/* Pulse when playing */
body.is-playing .logo-pulse {
  animation: logo-pulse 2.4s ease-out infinite;
}

@keyframes logo-pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

body.is-playing .logo-ring {
  box-shadow:
    0 0 40px rgba(124,58,237,0.4),
    0 0 0 6px rgba(167,139,250,0.1);
  border-color: rgba(167,139,250,0.5);
}

/* ── Station Info ── */
.station-info {
  text-align: center;
  margin-bottom: 18px;
}

.station-name {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 4px;
}

.station-freq {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  opacity: 0.9;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  padding: 5px 14px 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: var(--transition);
}

body.is-playing .live-badge {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--green);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background var(--transition);
}

body.is-playing .live-dot {
  background: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
  animation: dot-pulse 1.2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

/* ── Status Message ── */
.status-msg {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 24px;
  letter-spacing: 0.3px;
  min-height: 18px;
  transition: color var(--transition);
  text-align: center;
}

.status-msg.error {
  color: var(--red);
}

.status-msg.success {
  color: var(--green);
}

/* ── Play Button ── */
.play-btn {
  position: relative;
  width: 100%;
  max-width: 280px;
  height: 58px;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #a855f7, #6d28d9);
  background-size: 200% 200%;
  box-shadow:
    0 4px 20px rgba(124,58,237,0.4),
    0 1px 0 rgba(255,255,255,0.15) inset;
  transition: transform var(--transition), box-shadow var(--transition);
  margin-bottom: 28px;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.play-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 30px rgba(124,58,237,0.55),
    0 1px 0 rgba(255,255,255,0.2) inset;
}

.play-btn:active {
  transform: translateY(0);
  box-shadow:
    0 2px 12px rgba(124,58,237,0.35),
    0 1px 0 rgba(255,255,255,0.1) inset;
}

.play-btn:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

.play-btn-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.2), transparent 60%);
  pointer-events: none;
}

.play-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.play-btn-icon svg {
  width: 22px;
  height: 22px;
}

.play-btn-label {
  font-size: 16px;
}

/* ── Spin animation ── */
.spin {
  animation: spin 0.9s linear infinite;
  transform-origin: center;
}

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

/* ── Volume ── */
.volume-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.vol-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.vol-icon-btn:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

.vol-icon {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.vol-icon-btn:hover .vol-icon {
  color: var(--text-primary);
}

.slider-wrap {
  flex: 1;
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
}

.volume-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  outline: none;
}

.volume-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.12);
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  margin-top: -6px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: var(--accent-bright);
}

.volume-slider::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.12);
  border: none;
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  border: none;
  cursor: pointer;
}

.volume-slider:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

.vol-pct {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

/* ── CTA Buttons ── */
.cta-row {
  display: none;
  gap: 10px;
  width: 100%;
}

.cta-btn {
  flex: 1;
  height: 46px;
  border-radius: var(--radius-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.1px;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
  border: 1px solid transparent;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.cta-btn:hover {
  transform: translateY(-1px);
}

.cta-btn:active {
  transform: translateY(0);
}

.cta-btn:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

.cta-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.cta-whatsapp {
  background: rgba(37, 211, 102, 0.12);
  border-color: rgba(37, 211, 102, 0.25);
  color: #4ade80;
  box-shadow: 0 2px 12px rgba(37,211,102,0.08);
}

.cta-whatsapp:hover {
  background: rgba(37, 211, 102, 0.18);
  border-color: rgba(37, 211, 102, 0.4);
  box-shadow: 0 4px 20px rgba(37,211,102,0.2);
}

.cta-contact {
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.2);
  color: var(--accent-bright);
  box-shadow: 0 2px 12px rgba(167,139,250,0.06);
}

.cta-contact:hover {
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: 0 4px 20px rgba(167,139,250,0.15);
}

.cta-status {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
}

.cta-status:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
}

/* ── Fallback error link ── */
.fallback-link {
  display: none;
  font-size: 12px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-bottom: 20px;
  transition: color var(--transition);
}

.fallback-link:hover {
  color: var(--accent-bright);
}

/* ── Station tagline ── */
.station-tagline {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ── Footer ── */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  padding: 16px 16px 24px;
}

/* ── Responsive ── */
@media (min-width: 480px) {
  .card {
    padding: 48px 40px 42px;
  }

  .station-name {
    font-size: 32px;
  }

  .play-btn {
    height: 62px;
    font-size: 17px;
  }
}

@media (min-width: 768px) {
  .card {
    padding: 56px 48px 48px;
    max-width: 440px;
  }

  .logo-ring {
    width: 108px;
    height: 108px;
  }

  .logo-inner {
    width: 72px;
    height: 72px;
  }

  .logo-icon {
    width: 46px;
    height: 46px;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
