/* Radio Promesa — La Pilas 105.3 FM */

:root {
  --bg-deep: #0a0e1a;
  --bg-card: rgba(18, 24, 42, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --accent: #e8a838;
  --accent-glow: rgba(232, 168, 56, 0.45);
  --accent-soft: #f5d78e;
  --text: #f0f2f8;
  --text-muted: #9aa3b8;
  --live: #22c55e;
  --whatsapp: #25d366;
  --radius: 20px;
  --radius-sm: 12px;
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(232, 168, 56, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 80%, rgba(59, 130, 246, 0.08), transparent),
    radial-gradient(ellipse 50% 30% at 0% 60%, rgba(139, 92, 246, 0.06), transparent);
  pointer-events: none;
  z-index: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1100px, 100% - 2rem);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  padding: clamp(0.5rem, 2vh, 1.25rem) 0 0.35rem;
  text-align: center;
}

.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto clamp(0.4rem, 1.5vh, 1rem);
  width: min(100%, 420px);
  padding: clamp(0.5rem, 2vw, 1rem) clamp(0.75rem, 3vw, 1.5rem);
  background: #ffffff;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(232, 168, 56, 0.45);
  box-shadow:
    0 0 40px var(--accent-glow),
    0 12px 32px rgba(0, 0, 0, 0.3);
}

.logo {
  width: 100%;
  height: auto;
  max-height: clamp(72px, 18vw, 150px);
  object-fit: contain;
  object-position: center;
}

.station-location {
  font-size: clamp(0.78rem, 2.2vw, 1rem);
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.slogan {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(0.82rem, 2.4vw, 1.05rem);
  color: var(--accent-soft);
  margin-top: 0.25rem;
}

/* Player — elemento principal */
.player-section {
  padding: clamp(0.5rem, 1.5vh, 1rem) 0 clamp(0.35rem, 1vh, 0.75rem);
}

.player-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: clamp(0.85rem, 3vw, 1.75rem);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.player-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.player-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.player-tune {
  width: 100%;
  margin-bottom: 0.5rem;
}

.player-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0 0.5rem;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(34, 197, 94, 0.15);
  color: var(--live);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.live-badge[hidden] {
  display: none;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--live);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.listeners {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.listeners strong {
  color: var(--accent-soft);
  font-weight: 600;
}

/* Visualizer */
.visualizer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 28px;
  margin-bottom: 0.6rem;
}

.visualizer span {
  width: 5px;
  height: 12px;
  background: linear-gradient(to top, var(--accent), var(--accent-soft));
  border-radius: 3px;
  opacity: 0.35;
  transition: opacity 0.3s;
}

.visualizer.is-active span {
  opacity: 1;
  animation: bar 0.8s ease-in-out infinite alternate;
}

.visualizer span:nth-child(1) { animation-delay: 0s; }
.visualizer span:nth-child(2) { animation-delay: 0.1s; }
.visualizer span:nth-child(3) { animation-delay: 0.2s; }
.visualizer span:nth-child(4) { animation-delay: 0.15s; }
.visualizer span:nth-child(5) { animation-delay: 0.05s; }
.visualizer span:nth-child(6) { animation-delay: 0.25s; }
.visualizer span:nth-child(7) { animation-delay: 0.12s; }

@keyframes bar {
  from { height: 10px; }
  to { height: 44px; }
}

.now-playing {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 3vw, 1.2rem);
  font-weight: 600;
  margin-bottom: 0.2rem;
  min-height: 1.35em;
  padding: 0 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-height: 1.25em;
}

.player-status.is-empty {
  visibility: hidden;
}

/* Play button */
.play-btn {
  position: relative;
  width: clamp(80px, 20vw, 100px);
  height: clamp(80px, 20vw, 100px);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(145deg, var(--accent), #c48a1f);
  color: var(--bg-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 32px var(--accent-glow),
    inset 0 2px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px var(--accent-glow);
}

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

.play-btn.is-playing {
  animation: glow-ring 2s ease-in-out infinite;
}

@keyframes glow-ring {
  0%, 100% { box-shadow: 0 8px 32px var(--accent-glow); }
  50% { box-shadow: 0 8px 48px rgba(232, 168, 56, 0.7); }
}

.play-btn svg {
  position: absolute;
  width: 38%;
  height: 38%;
  fill: currentColor;
}

.play-btn .icon-play {
  display: block;
}

.play-btn .icon-pause,
.play-btn .icon-loading {
  display: none;
}

.play-btn[data-state="playing"] .icon-play {
  display: none;
}

.play-btn[data-state="playing"] .icon-pause {
  display: block;
}

.play-btn[data-state="connecting"] .icon-play,
.play-btn[data-state="connecting"] .icon-pause {
  display: none;
}

.play-btn[data-state="connecting"] .icon-loading {
  display: block;
  animation: spin 0.8s linear infinite;
}

.play-btn[data-state="connecting"] {
  pointer-events: none;
  opacity: 0.85;
}

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

.frequency {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem;
  line-height: 1;
  margin: 0;
}

.freq-num {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text), var(--accent-soft));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.freq-band {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Footer del player */
.player-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.contact-item {
  padding: 0.35rem 0.5rem;
  text-align: center;
}

.contact-item + .contact-item {
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.contact-item .label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.contact-item .value {
  font-weight: 600;
  font-size: clamp(0.75rem, 2.5vw, 0.88rem);
  color: var(--accent-soft);
}

.contact-item .value.is-placeholder {
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
}

/* WhatsApp floating */
.whatsapp-float {
  position: fixed;
  bottom: calc(1.25rem + var(--safe-bottom));
  right: 1.25rem;
  z-index: 100;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--whatsapp);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.45);
  transition: transform 0.2s, opacity 0.2s;
}

.whatsapp-float:hover {
  transform: scale(1.08);
}

.whatsapp-float.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.whatsapp-float svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

/* Locutores */
.locutores-section {
  padding: clamp(0.5rem, 1.5vh, 1rem) 0 clamp(1.5rem, 3vh, 2.5rem);
}

.locutores-container {
  width: min(1100px, 100% - 1rem);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 3.5vw, 1.45rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.15rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-bottom: 0.75rem;
}

/* Carrusel de locutores */
.carousel {
  overflow: hidden;
  margin-inline: -1rem;
  padding-block: 0.5rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.carousel.is-touch {
  overflow: hidden;
  touch-action: pan-y;
}

.carousel.is-js-drive .carousel-track {
  animation: none !important;
  will-change: transform;
}

.carousel-track {
  display: flex;
  gap: clamp(0.75rem, 2.5vw, 1.15rem);
  width: max-content;
  padding-inline: 0.75rem;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.carousel.is-ready:not(.is-touch) .carousel-track {
  animation: carousel-scroll 45s linear infinite;
  will-change: transform;
}

.carousel.is-ready:not(.is-touch):hover .carousel-track,
.carousel.is-ready.is-paused:not(.is-touch) .carousel-track {
  animation-play-state: paused;
}

@keyframes carousel-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

.carousel-item {
  flex: 0 0 auto;
  width: clamp(168px, 44vw, 220px);
  aspect-ratio: 944 / 1109;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  color: inherit;
  font: inherit;
  padding: 0;
  line-height: 0;
  transition: transform 0.25s, box-shadow 0.25s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.carousel.is-touch .carousel-item {
  flex-shrink: 0;
}

@media (hover: hover) {
  .carousel-item:hover,
  .carousel-item:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(232, 168, 56, 0.25);
    outline: none;
  }
}

.carousel-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  pointer-events: none;
}

/* Modal locutor */
.locutor-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.locutor-modal[hidden] {
  display: none;
}

.locutor-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.locutor-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: var(--bg-card);
  border: 1px solid rgba(232, 168, 56, 0.35);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow), 0 0 60px var(--accent-glow);
  animation: modal-in 0.3s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.locutor-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.locutor-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.locutor-modal-img {
  width: 100%;
  max-height: min(70vh, 520px);
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  margin-inline: auto;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 1rem 0 calc(1.25rem + var(--safe-bottom));
  color: var(--text-muted);
  font-size: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.site-footer strong {
  color: var(--accent-soft);
  font-weight: 500;
}

.powered-by {
  margin-top: 0.65rem;
  font-size: 0.68rem;
  opacity: 0.45;
  letter-spacing: 0.02em;
}

.powered-by a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: opacity 0.2s, border-color 0.2s;
}

.powered-by a:hover {
  opacity: 1;
  border-bottom-color: currentColor;
}

/* Pantallas de poco alto — locutores visibles sin scroll */
@media (max-height: 740px) {
  .site-header {
    padding-top: 0.35rem;
  }

  .logo-wrap {
    max-width: 320px;
    padding: 0.4rem 0.65rem;
    margin-bottom: 0.35rem;
  }

  .logo {
    max-height: 64px;
  }

  .station-location,
  .slogan {
    font-size: 0.75rem;
    margin-top: 0.1rem;
  }

  .player-section {
    padding-bottom: 0.25rem;
  }

  .player-card {
    padding: 0.7rem;
  }

  .player-header {
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .play-btn {
    width: 68px;
    height: 68px;
  }

  .visualizer {
    height: 22px;
    margin-bottom: 0.4rem;
  }

  .player-footer {
    margin-top: 0.35rem;
    padding-top: 0.5rem;
  }

  .contact-item {
    padding: 0.25rem 0.35rem;
  }

  .locutores-section {
    padding-top: 0.35rem;
  }

  .section-subtitle {
    margin-bottom: 0.5rem;
  }

  .whatsapp-float {
    width: 48px;
    height: 48px;
    bottom: 0.75rem;
    right: 0.75rem;
  }

  .whatsapp-float svg {
    width: 26px;
    height: 26px;
  }
}

/* Tablet+ */
@media (min-width: 900px) {
  .player-card {
    max-width: 520px;
    margin-inline: auto;
  }

  .logo-wrap {
    max-width: 480px;
  }

  .play-btn {
    width: 100px;
    height: 100px;
  }
}

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