:root {
    /* Colores ajustados para un diseño más oscuro y rojo vibrante */
    --color-primary: #e72a1e;     /* Rojo más fuerte */
    --color-dark: #121212;        /* Fondo muy oscuro, casi negro */
    --color-box-bg: #181818;      /* Fondo de las cajas, NEGRO más profundo */
    --color-text: #ffffff;
    --color-light-text: #bdbdbd;  /* Texto ligeramente gris */
    --opacity-level: 0.95;        /* Valor por defecto, se sobrescribe por PHP */
    --transition-speed: 0.3s;
}

/* Base y Fondo */
body {
    background-color: var(--color-dark); /* Fondo base del cuerpo */
    color: var(--color-text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px 20px 70px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* Contenedor Principal y Opacidad (CORRECCIÓN 1: Contenedor principal) */
.player-container {
    max-width: 1200px;
    width: 95%;
    padding: 20px;
    border-radius: 10px;
    /* Usa el color de caja definido para que sea transparente */
    background-color: rgba(24, 24, 24, var(--opacity-level)); 
    backdrop-filter: blur(10px); 
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8); 
}

/* Fondo de las secciones (CORRECCIÓN 2: Secciones internas ahora transparentes) */
.player-box {
    /* Ahora también usa la variable de opacidad para heredar la transparencia */
    background-color: rgba(24, 24, 24, var(--opacity-level)); 
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05); 
}

/* La sección de programación usa el mismo estilo para ser transparente */
.schedule-section {
    grid-column: 1 / -1; 
    text-align: center;
    padding: 30px 20px;
    /* Usa la variable de opacidad para ser transparente */
    background-color: rgba(24, 24, 24, var(--opacity-level)); 
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 20px;
}

/* El resto del CSS sigue igual */

/* Reproductor Principal y Título */
.main-player-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 30px;
}

.now-playing-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 25px;
}

/* Carátula del Álbum y Animación de Rotación */
.album-art img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 5px solid var(--color-primary);
    box-shadow: 0 0 20px rgba(231, 42, 30, 0.7); 
    object-fit: cover;
    margin-bottom: 15px;
    transition: transform 0.5s ease-in-out, box-shadow 0.3s;
}
.album-art img.playing {
    animation: rotate 10s linear infinite;
}
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.track-details .station-name {
    font-size: 1.1em;
    opacity: 0.9;
    color: var(--color-primary);
    font-weight: 600;
}
.track-details h2 {
    font-size: 2.2em;
    margin: 5px 0 0;
    color: var(--color-text);
    text-transform: uppercase;
    font-weight: 700; 
}

/* CONTROLES PERSONALIZADOS */
.custom-radio-controls {
    width: 100%;
    max-width: 700px;
    text-align: center;
}

.progress-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 3px;
    margin-bottom: 15px;
}
.progress-bar {
    width: 0%; 
    height: 100%;
    background-color: var(--color-primary);
    border-radius: 3px;
    transition: width 0.3s;
}

.controls-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    position: relative; 
}

#play-pause-btn {
    font-size: 3em;
    color: var(--color-primary);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}
#play-pause-btn:hover {
    color: #ff554a; 
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}
.volume-control i {
    color: var(--color-light-text);
}
#volume-slider {
    width: 120px;
    height: 4px;
    background: var(--color-light-text);
    -webkit-appearance: none;
    appearance: none;
    border-radius: 2px;
    outline: none;
}
#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(231, 42, 30, 0.5);
}
#volume-percent {
    font-size: 0.9em;
    opacity: 0.9;
    color: var(--color-light-text);
}

.live-tag {
    color: var(--color-primary);
    font-weight: bold;
    font-size: 0.9em;
}

/* Animación de Ondas de Sonido */
.sound-waves {
    display: flex;
    align-items: center;
    height: 30px; 
    gap: 2px;
    margin-left: 15px; 
}
.sound-bar {
    width: 4px;
    height: 5px; 
    background-color: var(--color-primary);
    border-radius: 2px;
    animation: sound-wave-animation 1.2s ease-in-out infinite;
    transform-origin: bottom;
}
.sound-bar:nth-child(1) { animation-delay: -1.2s; }
.sound-bar:nth-child(2) { animation-delay: -1.0s; }
.sound-bar:nth-child(3) { animation-delay: -0.8s; }
.sound-bar:nth-child(4) { animation-delay: -0.6s; }
.sound-bar:nth-child(5) { animation-delay: -0.4s; }
.sound-bar:nth-child(6) { animation-delay: -0.2s; }

@keyframes sound-wave-animation {
    0%, 100% { height: 5px; opacity: 0.8; }
    50% { height: 25px; opacity: 1; }
}

.sound-waves.hidden .sound-bar {
    animation: none;
    height: 5px;
    opacity: 0.8;
}

/* Columnas de Contenido */
.content-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* Estilo de Sección */
.section h3 {
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 10px;
    margin-top: 0;
    font-size: 1.2em;
    color: var(--color-primary);
    font-weight: 700;
}
.section ul {
    list-style: none;
    padding: 0;
}
.section ul li {
    margin-bottom: 10px;
    font-size: 0.9em;
    color: var(--color-light-text);
}
.section ul li a {
    color: var(--color-text);
    text-decoration: none;
    transition: color var(--transition-speed);
}
.section ul li a:hover {
    color: var(--color-primary);
}


.schedule-section h3 {
    margin-bottom: 25px;
}

.schedule-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap; 
}
.schedule-tabs button {
    background: none;
    border: none;
    color: var(--color-light-text);
    padding: 10px 15px;
    margin: 0 5px;
    cursor: pointer;
    font-size: 1em;
    transition: color 0.3s, border-bottom 0.3s;
    border-bottom: 3px solid transparent;
    font-weight: 600;
}
.schedule-tabs button.active {
    color: var(--color-primary);
    border-bottom: 3px solid var(--color-primary);
    font-weight: bold;
}

.schedule-content {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

.schedule-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}
.schedule-item:last-child {
    border-bottom: none;
}
.schedule-time {
    font-weight: bold;
    color: var(--color-primary);
}
.schedule-program {
    color: var(--color-text);
}
.schedule-content p {
    color: var(--color-light-text);
}


/* Footer y Redes Sociales */
.social-footer {
    width: 100%;
    background-color: var(--color-primary);
    padding: 10px 0;
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 100;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.5);
}

.social-links a {
    color: var(--color-text);
    font-size: 1.5em;
    margin: 0 10px;
    transition: opacity var(--transition-speed);
}
.social-links a:hover {
    opacity: 0.8;
}
.copyright {
    color: var(--color-text);
    margin-left: 20px;
    font-size: 0.9em;
    opacity: 0.8;
}

/* Media Queries (Responsive) */
@media (max-width: 768px) {
    .content-columns {
        grid-template-columns: 1fr;
    }
    .now-playing-info {
        padding-top: 20px;
    }
    .track-details h2 {
        font-size: 1.5em;
    }
    .schedule-tabs button {
        font-size: 0.8em;
        padding: 8px 5px;
    }
    .controls-line {
        flex-wrap: wrap; 
        justify-content: center;
        gap: 15px; 
    }
    .sound-waves {
        order: 1; 
        margin-left: 0;
        margin-top: 10px;
    }
    #play-pause-btn {
        order: 0; 
    }
    .volume-control {
        order: 2; 
    }
    .live-tag {
        order: 3; 
    }
    .player-container {
        padding: 15px;
    }
}

/* Contenedor de botones flotantes en columna */
.action-buttons {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 999;
}

/* Botón de compartir */
.share-button {
    background-color: #e53935;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
}

.share-button:hover {
    background-color: #c62828;
}

.share-button svg {
    fill: white;
    width: 20px;
    height: 20px;
}

/* Botones de app */
.app-button {
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
}

.app-button.android {
    background-color: #3ddc84;
}

.app-button.ios {
    background-color: #007aff;
}

.app-button svg {
    fill: white;
    width: 20px;
    height: 20px;
}

/* Móvil: reducir más */
@media (max-width: 600px) {
    .action-buttons {
        top: 10px;
        right: 10px;
        gap: 6px;
    }

    .share-button,
    .app-button {
        width: 38px;
        height: 38px;
    }

    .share-button svg,
    .app-button svg {
        width: 18px;
        height: 18px;
    }
}

/* === TOOLTIP DE BOTONES FLOTANTES === */
.tooltip {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: max-content;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    position: absolute;
    right: 110%; /* PC: aparece a la izquierda */
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 1000;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* === MÓVIL: mostrar SIEMPRE debajo del botón === */
@media (max-width: 768px) {
    .tooltip {
        flex-direction: column;
        align-items: center;
    }

    .tooltip-text {
        all: unset; /* elimina el estilo de tooltip flotante */
        display: block;
        font-size: 10px;
        color: #fff;
        background: none;
        margin-top: 4px;
        text-align: center;
        pointer-events: none;
    }
}
