/* ============================================================
   EuropaRebelde Streaming Player - Hoja de Estilos
   Paleta: Oscuro (#0b1a2e, #0f2a3f) | Rojo (#b52e1e, #831f0f)
                Dorado (#ffd966, #cf9b1b)
   ============================================================ */

/* --- Reset y contenedor raíz --- */
.er-player-wrap *,
.er-player-wrap *::before,
.er-player-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.er-player-wrap {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #0b1a2e 0%, #0f2a3f 100%);
    border: 1px solid #1a3a5c;
    border-radius: 12px;
    padding: 16px 20px 12px;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 6px 32px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,217,102,0.08);
    position: relative;
    overflow: hidden;
}

/* Línea decorativa superior dorada */
.er-player-wrap::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #831f0f, #b52e1e, #ffd966, #b52e1e, #831f0f);
}

/* --- Fila principal (horizontal) --- */
.er-main-row {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: nowrap;
}

/* ---- BLOQUE IZQUIERDO: Logo/Marca ---- */
.er-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: 130px;
}

.er-brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #071220;
    border: 2px solid #ffd966;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #ffd966;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(181,46,30,0.5);
    transition: box-shadow 0.3s ease;
    overflow: hidden;
    padding: 0;
}

/* El SVG de la bandera ocupa todo el círculo */
.er-brand-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
}

.er-brand-icon:hover {
    box-shadow: 0 0 20px rgba(255,217,102,0.4);
}

.er-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.er-brand-text .er-name-top {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.er-brand-text .er-name-bottom {
    font-size: 11px;
    font-weight: 600;
    color: #ffd966;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ---- Separador vertical ---- */
.er-divider {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, #1a3a5c, transparent);
    flex-shrink: 0;
}

/* ---- BLOQUE CENTRAL: Controles ---- */
.er-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

/* Botón PLAY/PAUSE */
.er-btn-play {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: radial-gradient(circle at 40% 35%, #c93520, #831f0f);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(181,46,30,0.6);
    transition: all 0.25s ease;
    flex-shrink: 0;
    position: relative;
    outline: none;
}

.er-btn-play:hover {
    background: radial-gradient(circle at 40% 35%, #e03d28, #9e2510);
    box-shadow: 0 6px 24px rgba(181,46,30,0.8);
    transform: scale(1.07);
}

.er-btn-play.playing {
    background: radial-gradient(circle at 40% 35%, #1a7a3c, #0e5228);
    box-shadow: 0 4px 16px rgba(26,122,60,0.6);
}

.er-btn-play.playing:hover {
    background: radial-gradient(circle at 40% 35%, #1e9048, #0e5228);
    box-shadow: 0 6px 24px rgba(26,122,60,0.8);
}

/* Tooltip en botones */
.er-btn-play::after,
.er-btn-stop::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: #ffd966;
    font-size: 10px;
    padding: 3px 7px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.er-btn-play:hover::after,
.er-btn-stop:hover::after {
    opacity: 1;
}

/* Botón STOP */
.er-btn-stop {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #1a3a5c;
    background: #0b1a2e;
    color: #8aadcc;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
    position: relative;
    outline: none;
}

.er-btn-stop:hover {
    border-color: #ffd966;
    color: #ffd966;
    background: #0f2a3f;
    box-shadow: 0 0 10px rgba(255,217,102,0.2);
}

/* ---- Indicador de estado + barras ---- */
.er-status-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    min-width: 110px;
}

.er-status-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #8aadcc;
    text-transform: uppercase;
    transition: color 0.3s;
}

.er-status-label.live {
    color: #ff4444;
}

.er-status-label.stopped {
    color: #8aadcc;
}

.er-status-label.buffering {
    color: #ffd966;
}

/* Barras de señal */
.er-signal-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 18px;
}

.er-bar {
    width: 5px;
    border-radius: 2px 2px 0 0;
    background: #1a3a5c;
    transition: background 0.3s;
}

.er-bar:nth-child(1) { height: 6px; }
.er-bar:nth-child(2) { height: 10px; }
.er-bar:nth-child(3) { height: 14px; }
.er-bar:nth-child(4) { height: 18px; }

/* Animación de barras activas */
.er-signal-bars.active .er-bar {
    background: #b52e1e;
}

.er-signal-bars.active .er-bar:nth-child(1) {
    animation: er-pulse1 0.8s ease-in-out infinite alternate;
}
.er-signal-bars.active .er-bar:nth-child(2) {
    animation: er-pulse2 0.9s ease-in-out infinite alternate;
}
.er-signal-bars.active .er-bar:nth-child(3) {
    animation: er-pulse3 0.7s ease-in-out infinite alternate;
}
.er-signal-bars.active .er-bar:nth-child(4) {
    animation: er-pulse4 1.1s ease-in-out infinite alternate;
}

@keyframes er-pulse1 {
    0%   { height: 4px;  background: #b52e1e; }
    100% { height: 12px; background: #ff5533; }
}
@keyframes er-pulse2 {
    0%   { height: 8px;  background: #b52e1e; }
    100% { height: 18px; background: #ff5533; }
}
@keyframes er-pulse3 {
    0%   { height: 6px;  background: #b52e1e; }
    100% { height: 14px; background: #ffd966; }
}
@keyframes er-pulse4 {
    0%   { height: 10px; background: #b52e1e; }
    100% { height: 20px; background: #ffd966; }
}

/* ---- Metadatos del stream ---- */
.er-meta {
    flex: 1;
    overflow: hidden;
}

.er-meta-title {
    font-size: 12px;
    color: #ffd966;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.er-meta-sub {
    font-size: 10px;
    color: #5a7a9a;
    margin-top: 2px;
}

/* ---- FILA INFERIOR: Volumen ---- */
.er-volume-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #1a3a5c;
    width: 100%;
}

.er-volume-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 33%;
}

.er-vol-icon {
    font-size: 18px;
    cursor: pointer;
    color: #8aadcc;
    transition: color 0.2s;
    flex-shrink: 0;
    user-select: none;
}

.er-vol-icon:hover {
    color: #ffd966;
}

/* Slider de volumen custom (cross-browser) */
.er-slider-track {
    position: relative;
    flex: 1;
    height: 6px;
    background: #1a3a5c;
    border-radius: 3px;
    cursor: pointer;
    user-select: none;
}

.er-slider-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 80%;
    background: #b52e1e;
    border-radius: 3px;
    pointer-events: none;
    transition: width 0.05s;
}

.er-slider-thumb {
    position: absolute;
    top: 50%;
    left: 80%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffd966;
    border: 2px solid #cf9b1b;
    box-shadow: 0 0 6px rgba(255,217,102,0.6);
    pointer-events: none;
    transition: left 0.05s, transform 0.2s;
}

.er-slider-track:hover .er-slider-thumb {
    transform: translate(-50%, -50%) scale(1.25);
}

.er-vol-pct {
    font-size: 10px;
    color: #5a7a9a;
    min-width: 28px;
    text-align: right;
}

/* ---- Mensaje de error ---- */
.er-error-msg {
    display: none;
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(181,46,30,0.15);
    border: 1px solid #b52e1e;
    border-radius: 6px;
    color: #ff7766;
    font-size: 11px;
    text-align: center;
}

.er-error-msg.visible {
    display: block;
}


/* ---- RESPONSIVE: móvil ---- */
@media (max-width: 600px) {
    .er-main-row {
        flex-wrap: wrap;
        gap: 12px;
    }

    .er-brand {
        min-width: unset;
        width: 100%;
        justify-content: center;
    }

    .er-divider {
        display: none;
    }

    .er-controls {
        width: 100%;
        justify-content: center;
    }

    .er-volume-row {
        justify-content: center;
    }

    .er-volume-slider {
        flex: 1;
        max-width: 200px;
    }

}
