/* radio.css — overrides y agregados específicos del modo radio.
   Se carga DESPUÉS de globe.css, así que pisa estilos cuando hace falta.
   Mantiene la estética del chip (glass + halo) y agrega:
     - chip-radio        : botón broadcast-tower en el chip
     - radio-dropdown    : panel flotante con lista de estaciones
     - radio-player      : barra fija inferior con controles del stream
*/

/* ── Botón "RADIO" en el chip ─────────────────────────────────────── */
/* Diseño "ON AIR": pill rojo cálido, prominente, con punto pulsante a
   la izquierda (la luz roja del estudio). Mucho más visible que el
   botón TTS gris, para invitar al click. */
.chip-radio {
    background: linear-gradient(135deg, #dc2626 0%, #ea580c 100%);
    border: 1px solid rgba(254, 215, 170, 0.55);
    color: #fff;
    height: 40px;
    padding: 0 14px 0 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    box-shadow:
        0 4px 14px rgba(220, 38, 38, 0.45),
        0 0 0 0 rgba(248, 113, 113, 0.6);
    transition: transform 0.18s ease, box-shadow 0.25s ease, filter 0.18s ease;
    margin-right: 6px;
    animation: radio-attention 2.4s ease-in-out infinite;
}
.chip-radio i {
    font-size: 14px;
}
.chip-radio-label {
    font-size: 12px;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.chip-radio-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fef2f2;
    box-shadow: 0 0 8px #fee2e2, 0 0 16px #f87171;
    animation: radio-dot-blink 1.4s ease-in-out infinite;
    flex-shrink: 0;
}
.chip-radio:hover {
    transform: translateY(-1px) scale(1.03);
    filter: brightness(1.08);
    box-shadow:
        0 8px 22px rgba(220, 38, 38, 0.55),
        0 0 0 4px rgba(248, 113, 113, 0.18);
}
.chip-radio[aria-expanded="true"] {
    background: linear-gradient(135deg, #b91c1c 0%, #c2410c 100%);
    transform: translateY(0) scale(1);
}
.chip-radio.is-active {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    box-shadow:
        0 6px 18px rgba(239, 68, 68, 0.6),
        0 0 0 4px rgba(248, 113, 113, 0.25),
        0 0 22px rgba(248, 113, 113, 0.6);
    animation: radio-on-air-pulse 1.2s ease-in-out infinite;
}
.chip-radio.is-active .chip-radio-dot {
    animation-duration: 0.7s;
}

/* "Latido" sutil cuando está inactivo, para invitar al click sin
   ser agresivo. Halo radial que respira. */
@keyframes radio-attention {
    0%, 100% {
        box-shadow:
            0 4px 14px rgba(220, 38, 38, 0.45),
            0 0 0 0 rgba(248, 113, 113, 0.5);
    }
    50% {
        box-shadow:
            0 4px 14px rgba(220, 38, 38, 0.55),
            0 0 0 8px rgba(248, 113, 113, 0);
    }
}

/* Pulse más intenso cuando está sonando ("ON AIR" real). */
@keyframes radio-on-air-pulse {
    0%, 100% {
        box-shadow:
            0 6px 18px rgba(239, 68, 68, 0.6),
            0 0 0 4px rgba(248, 113, 113, 0.25),
            0 0 22px rgba(248, 113, 113, 0.6);
    }
    50% {
        box-shadow:
            0 6px 22px rgba(239, 68, 68, 0.75),
            0 0 0 8px rgba(248, 113, 113, 0.15),
            0 0 32px rgba(248, 113, 113, 0.85);
    }
}

@keyframes radio-dot-blink {
    0%, 60%, 100% { opacity: 1; }
    70%, 90%      { opacity: 0.25; }
}

/* En pantallas chicas escondemos el label y dejamos sólo punto + ícono,
   para que el chip no se desborde. */
@media (max-width: 520px) {
    .chip-radio {
        padding: 0 10px;
    }
    .chip-radio-label {
        display: none;
    }
}

/* ── Dropdown de estaciones ───────────────────────────────────────── */
.radio-dropdown {
    position: fixed;
    top: 96px;             /* anclado bajo el header / chip */
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    width: min(420px, calc(100vw - 32px));
    max-height: 60vh;
    background: rgba(13, 18, 32, 0.92);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 1100;
}
.radio-dropdown.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.radio-dd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.radio-dd-title {
    font-weight: 600;
    color: #f1f5f9;
    font-size: 14px;
    letter-spacing: 0.3px;
}
.radio-dd-close {
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
}
.radio-dd-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.radio-dd-list {
    overflow-y: auto;
    max-height: calc(60vh - 50px);
    padding: 6px 0;
}
.radio-dd-loading,
.radio-dd-empty,
.radio-dd-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px 16px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    text-align: center;
}
.radio-dd-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: radio-spin 0.8s linear infinite;
}
@keyframes radio-spin {
    to { transform: rotate(360deg); }
}
.radio-station {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.12s ease;
    border-left: 3px solid transparent;
}
.radio-station:hover {
    background: rgba(255, 255, 255, 0.05);
}
.radio-station.is-playing {
    background: rgba(96, 165, 250, 0.12);
    border-left-color: #60a5fa;
}
.radio-station-favicon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.radio-station-favicon.placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.45);
    font-size: 14px;
}
.radio-station-body {
    flex: 1;
    min-width: 0;
}
.radio-station-name {
    color: #e2e8f0;
    font-weight: 500;
    font-size: 13px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.radio-station-meta {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.radio-station-play {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    flex-shrink: 0;
}
.radio-station:hover .radio-station-play,
.radio-station.is-playing .radio-station-play {
    color: #60a5fa;
}

/* ── Player fijo abajo ────────────────────────────────────────────── */
.radio-player {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    width: min(420px, calc(100vw - 32px));
    background: rgba(13, 18, 32, 0.94);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 999px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 24px rgba(96, 165, 250, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 1200;
}
.radio-player.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.radio-player-btn {
    background: rgba(96, 165, 250, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.4);
    color: #bfdbfe;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}
.radio-player-btn:hover:not(:disabled) {
    background: rgba(96, 165, 250, 0.32);
    transform: scale(1.05);
}
.radio-player-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.radio-player-main {
    width: 40px;
    height: 40px;
    font-size: 14px;
    background: rgba(96, 165, 250, 0.3);
    border-color: rgba(96, 165, 250, 0.6);
    color: #fff;
}
.radio-player-nav {
    width: 30px;
    height: 30px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
}
.radio-player-nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}
.radio-player-stop {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.4);
    color: #fecaca;
}
.radio-player-stop:hover {
    background: rgba(248, 113, 113, 0.24);
}
.radio-player-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.radio-player-name {
    color: #f1f5f9;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.radio-player-meta {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.radio-player.is-buffering .radio-player-meta::after {
    content: " · cargando…";
    color: #fbbf24;
}
.radio-player.is-error {
    border-color: rgba(248, 113, 113, 0.5);
}
.radio-player.is-error .radio-player-meta {
    color: #fecaca;
}
audio#radio-audio {
    display: none;
}
