/* ESTILOS BASE */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #ffffff;
}

#rfd-web-container {
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#rfd-web-container.loaded { 
    opacity: 1; 
}

/* WRAPPER TRANSPARENTE EXTENDIDO */
#rfd-audio-bar-wrapper {
    position: fixed;
    left: 0;
    width: 100%;
    height: var(--rfd-alto-barra);
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999998;
    pointer-events: none;
}

/* BARRA VISIBLE CENTRAL */
#rfd-audio-bar {
    pointer-events: auto;
    width: var(--rfd-ancho-barra);
    max-width: 100%;
    height: var(--rfd-alto-barra);
    background-color: var(--rfd-color-fondo);
    border: 1px solid var(--rfd-border-color);
    color: var(--rfd-text-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

#rfd-audio-bar-wrapper.rfd-hidden #rfd-audio-bar {
    opacity: 0;
}

/* METADATOS Y CARÁTULA */
.rfd-branding {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

.rfd-album-art {
    width: var(--rfd-album-size);
    height: var(--rfd-album-size);
    border-radius: 6px;
    object-fit: cover;
    background-color: rgba(255,255,255,0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.rfd-meta-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.rfd-station-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.rfd-station-name {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--rfd-subtext-color);
    font-weight: 700;
}

/* INDICADOR EN VIVO */
.rfd-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rfd-live-dot {
    width: 6px;
    height: 6px;
    background-color: #ef4444;
    border-radius: 50%;
    animation: rfd-pulse 1.2s infinite ease-in-out;
}

@keyframes rfd-pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.7); }
    100% { opacity: 1; transform: scale(1); }
}

.rfd-track-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--rfd-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rfd-track-artist {
    font-size: 12px;
    color: var(--rfd-subtext-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* CONTROLES CENTRALES */
.rfd-player-core {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.rfd-play-btn {
    width: var(--rfd-play-size);
    height: var(--rfd-play-size);
    border-radius: 50%;
    background-color: var(--rfd-btn-bg);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.rfd-play-btn:hover { 
    transform: scale(1.06); 
}

.rfd-icon-play {
    width: 0; height: 0; 
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 12px solid var(--rfd-btn-icon-color);
    margin-left: 3px;
}

.rfd-icon-pause {
    width: 12px; height: 14px;
    display: flex; justify-content: space-between;
    display: none;
}

.rfd-icon-pause::before, .rfd-icon-pause::after {
    content: ""; width: 4px; height: 100%;
    background-color: var(--rfd-btn-icon-color);
}

.rfd-play-btn.playing .rfd-icon-play { display: none; }
.rfd-play-btn.playing .rfd-icon-pause { display: flex; }

/* ECUALIZADOR DINÁMICO ULTRA RÁPIDO */
.rfd-spectrum {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    width: 32px;
    height: 22px;
}

.rfd-bar {
    width: 3px; height: 3px;
    background-color: var(--rfd-text-color);
    opacity: 0.7;
    border-radius: 1px;
}

.rfd-play-btn.playing + .rfd-spectrum .rfd-bar:nth-child(1) { animation: rfd-fast-bounce 0.30s cubic-bezier(0.4, 0, 0.6, 1) infinite alternate; }
.rfd-play-btn.playing + .rfd-spectrum .rfd-bar:nth-child(2) { animation: rfd-fast-bounce 0.22s cubic-bezier(0.4, 0, 0.6, 1) infinite alternate 0.05s; }
.rfd-play-btn.playing + .rfd-spectrum .rfd-bar:nth-child(3) { animation: rfd-fast-bounce 0.35s cubic-bezier(0.4, 0, 0.6, 1) infinite alternate 0.1s; }
.rfd-play-btn.playing + .rfd-spectrum .rfd-bar:nth-child(4) { animation: rfd-fast-bounce 0.25s cubic-bezier(0.4, 0, 0.6, 1) infinite alternate 0.02s; }
.rfd-play-btn.playing + .rfd-spectrum .rfd-bar:nth-child(5) { animation: rfd-fast-bounce 0.28s cubic-bezier(0.4, 0, 0.6, 1) infinite alternate 0.08s; }

@keyframes rfd-fast-bounce {
    0% { height: 3px; opacity: 0.4; }
    100% { height: 22px; opacity: 1; }
}

/* DERECHA Y CONTROLES */
.rfd-controls-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.rfd-volume-slider {
    -webkit-appearance: none;
    width: 75px; height: 4px;
    border-radius: 2px;
    background: var(--rfd-subtext-color);
    outline: none;
}

.rfd-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--rfd-text-color);
    cursor: pointer;
}

.rfd-action-btn {
    background: transparent;
    border: none;
    color: var(--rfd-text-color);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 5px;
    display: flex;
    align-items: center;
}

.rfd-action-btn:hover { opacity: 1; }

/* MINI PLAYER REPLEGADO */
#rfd-mini-trigger {
    position: fixed;
    right: 15px;
    background-color: var(--rfd-color-fondo);
    color: var(--rfd-text-color);
    border: 1px solid var(--rfd-border-color);
    border-radius: 30px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 99999999;
    transform: translateY(150px);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.3s;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 600;
}

#rfd-mini-trigger.rfd-visible {
    transform: translateY(0);
    opacity: 1;
}

/* LOADER */
#rfd-preloader {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    display: flex; justify-content: center; align-items: center;
    z-index: 999999;
    transition: opacity 0.25s ease, visibility 0.25s;
}

.rfd-spinner {
    width: 28px; height: 28px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #111111;
    border-radius: 50%;
    animation: rfd-spin 0.7s linear infinite;
}

@keyframes rfd-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ADAPTABILIDAD MÓVIL */
@media (max-width: 768px) {
    #rfd-audio-bar-wrapper { padding: 0 !important; }
    #rfd-audio-bar { width: 100% !important; border-radius: 0 !important; border: none !important; padding: 0 15px; }
    .rfd-branding .rfd-station-name, .rfd-controls-right { display: none; }
}