/* ============================================================
   WP Radio Player v3 — radio-player.css
   ============================================================ */

#rp-player {
    --rp-h:           72px;
    --rp-bg:          #0d0d0f;
    --rp-bg2:         #17171b;
    --rp-accent:      #ff4757;
    --rp-accent-glow: rgba(255, 71, 87, 0.35);
    --rp-text:        #f0f0f2;
    --rp-text-muted:  rgba(240, 240, 242, 0.50);
    --rp-border:      rgba(255, 255, 255, 0.08);
    --rp-font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --rp-ease:        cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Barra de progreso de navegación ────────────────────────── */
#rp-progress-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    z-index: 100000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

#rp-progress-bar.rp-progress--active { opacity: 1; }

.rp-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--rp-accent), #ff9f43);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.7);
    transition: width 0.08s linear;
}

/* ── Contenedor principal ───────────────────────────────────── */
#rp-player {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 99999;
    height: var(--rp-h);
    background: var(--rp-bg);
    border-top: 1px solid var(--rp-border);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.5), 0 -1px 0 rgba(255,255,255,0.04);
    font-family: var(--rp-font);
    -webkit-font-smoothing: antialiased;
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
}

#rp-player::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--rp-accent) 40%, #ff9f43 60%, transparent);
    opacity: 0;
    transition: opacity 0.4s var(--rp-ease);
}
#rp-player[data-state="playing"]::before { opacity: 1; }

/* ── Layout ─────────────────────────────────────────────────── */
.rp-inner {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    height: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    gap: 20px;
}

/* ── Info de estación ───────────────────────────────────────── */
.rp-station {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    overflow: hidden;
}

.rp-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
}

.rp-name {
    color: var(--rp-text);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rp-status {
    color: var(--rp-text-muted);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 2px;
    transition: color 0.25s;
}
#rp-player[data-state="playing"] .rp-status { color: var(--rp-accent); }
#rp-player[data-state="error"]   .rp-status { color: #ffc107; }

/* ── Metadatos ──────────────────────────────────────────────── */
.rp-meta-wrap {
    display: none;       /* oculto hasta que JS lo muestre */
    flex-direction: column;
    min-width: 0;
    max-width: 380px;
}

/* Animación al cambiar canción */
.rp-meta-wrap.rp-meta--animate .rp-meta-song {
    animation: rp-meta-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes rp-meta-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.rp-meta-artist {
    color: var(--rp-accent);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rp-meta-song {
    color: var(--rp-text);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* Scrolling ticker si el texto es largo */
@media (min-width: 600px) {
    .rp-meta-song {
        max-width: 300px;
    }
}

/* ── Ecualizador ────────────────────────────────────────────── */
.rp-equalizer {
    display: flex;
    align-items: flex-end;
    gap: 2.5px;
    height: 22px;
    flex-shrink: 0;
}
.rp-equalizer span {
    display: block;
    width: 3px;
    border-radius: 2px;
    background: var(--rp-accent);
    height: 4px;
    opacity: 0.35;
    transition: height 0.15s ease;
}
.rp-equalizer.rp-eq--active span { opacity: 1; }
.rp-equalizer.rp-eq--active span:nth-child(1) { animation: eq1 0.72s ease-in-out infinite; }
.rp-equalizer.rp-eq--active span:nth-child(2) { animation: eq2 0.55s ease-in-out infinite 0.10s; }
.rp-equalizer.rp-eq--active span:nth-child(3) { animation: eq3 0.84s ease-in-out infinite 0.20s; }
.rp-equalizer.rp-eq--active span:nth-child(4) { animation: eq4 0.65s ease-in-out infinite 0.05s; }
.rp-equalizer.rp-eq--active span:nth-child(5) { animation: eq1 0.75s ease-in-out infinite 0.15s; }

@keyframes eq1 { 0%,100%{height:4px}  50%{height:18px} }
@keyframes eq2 { 0%,100%{height:14px} 50%{height:5px}  }
@keyframes eq3 { 0%,100%{height:8px}  50%{height:20px} }
@keyframes eq4 { 0%,100%{height:18px} 50%{height:7px}  }

/* ── Botón play ─────────────────────────────────────────────── */
.rp-controls { display: flex; align-items: center; }

.rp-btn-play {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 2px solid var(--rp-border);
    background: var(--rp-bg2);
    color: var(--rp-text);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.25s, border-color 0.25s, transform 0.2s, box-shadow 0.3s;
    outline: none; padding: 0;
}
.rp-btn-play:hover {
    background: #232328;
    border-color: rgba(255,255,255,0.2);
    transform: scale(1.06);
}
.rp-btn-play:active { transform: scale(0.95); }

#rp-player[data-state="playing"] .rp-btn-play {
    background: var(--rp-accent); border-color: var(--rp-accent);
    box-shadow: 0 0 0 6px var(--rp-accent-glow), 0 4px 20px var(--rp-accent-glow);
}
#rp-player[data-state="loading"] .rp-btn-play {
    border-color: rgba(255,255,255,0.3);
    animation: rp-pulse 1.4s ease-in-out infinite;
}
@keyframes rp-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.1); }
    50%      { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
}

.rp-ico { width: 20px; height: 20px; fill: currentColor; display: block; }
.rp-ico-spin {
    fill: none; stroke: currentColor; stroke-width: 2.5;
    animation: rp-spin 0.9s linear infinite;
    transform-origin: center;
}
@keyframes rp-spin { to { transform: rotate(360deg); } }

/* ── Volumen ────────────────────────────────────────────────── */
.rp-volume-group { display: flex; align-items: center; gap: 8px; }

.rp-btn-mute {
    background: none; border: none; color: var(--rp-text-muted);
    cursor: pointer; padding: 4px; display: flex; align-items: center;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    outline: none;
}
.rp-btn-mute:hover { color: var(--rp-text); background: rgba(255,255,255,0.06); }
.rp-btn-mute .rp-ico { width: 18px; height: 18px; }

.rp-vol-slider {
    -webkit-appearance: none; appearance: none;
    width: 88px; height: 3px; border-radius: 3px;
    background: rgba(255,255,255,0.15); outline: none; cursor: pointer;
}
.rp-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--rp-text); cursor: pointer;
    border: 2px solid var(--rp-accent);
    transition: transform 0.15s;
}
.rp-vol-slider::-webkit-slider-thumb:hover { transform: scale(1.25); }
.rp-vol-slider::-moz-range-thumb {
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--rp-text); border: 2px solid var(--rp-accent);
}

/* ── Badge LIVE ─────────────────────────────────────────────── */
.rp-live-badge {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 10px; border: 1px solid var(--rp-border);
    border-radius: 20px; background: rgba(255,255,255,0.04);
    opacity: 0; transform: translateY(4px); pointer-events: none;
    transition: opacity 0.3s var(--rp-ease), transform 0.3s var(--rp-ease);
}
#rp-player[data-state="playing"] .rp-live-badge { opacity: 1; transform: translateY(0); }

.rp-live-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--rp-accent);
    animation: rp-blink 1.2s ease-in-out infinite;
}
@keyframes rp-blink { 0%,100%{opacity:1} 50%{opacity:0.2} }
.rp-live-label {
    color: var(--rp-accent); font-size: 10px;
    font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}

/* ── Transiciones de página ─────────────────────────────────── */
.rp-page--leaving  { opacity: 0.4; transition: opacity 0.15s ease; }
.rp-page--entering { opacity: 0; animation: rp-fade-in 0.3s var(--rp-ease) forwards; }

@keyframes rp-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .rp-live-badge { display: none; }
    .rp-vol-slider { width: 64px; }
    .rp-meta-wrap  { max-width: 200px; }
}
@media (max-width: 480px) {
    .rp-inner {
        grid-template-columns: 1fr auto;
        padding: 0 16px; gap: 12px;
    }
    .rp-volume-group, .rp-live-badge { display: none; }
    .rp-btn-play { width: 42px; height: 42px; }
    .rp-name, .rp-meta-song { font-size: 13px; }
    .rp-status, .rp-meta-artist { font-size: 10px; }
}

body { padding-bottom: 72px !important; }
