/* =========================================
   ESTILOS ORIGINALES VILLA MANTERO - ACTUALIZADO GOLD
   ========================================= */
:root {
    --primary: #3695D3;
    --accent: #9CD2C6;
    --glass-bg: rgba(75, 93, 186, 0.85);
    --text-primary: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.1);
    --footer-bg: rgba(75, 93, 186, 0.85);
    --bg-light: #ffffff;
    --text-dark: #000000;
    /* Transparencias ajustadas para ver mejor el fondo */
    --dark-bg-color1: rgba(26, 26, 46, 0.75);
    --dark-bg-color2: rgba(22, 33, 62, 0.75);
    --dark-bg-color3: rgba(15, 52, 96, 0.75);
    --dark-bg-color4: rgba(45, 85, 149, 0.75);
    --light-bg-color1: rgba(224, 242, 247, 0.65);
    --light-bg-color2: rgba(200, 232, 242, 0.65);
    --light-bg-color3: rgba(176, 224, 233, 0.65);
    --light-bg-color4: rgba(152, 216, 224, 0.65);
    
    /* Variable dinámica para la barra de volumen */
    --volume-bar-color: var(--accent);
}

html, body {
    height: 100%;
    margin: 0;
    font-family: "Poppins", sans-serif;
    color: var(--text-primary);
    background: linear-gradient(-45deg, var(--dark-bg-color1), var(--dark-bg-color2), var(--dark-bg-color3), var(--dark-bg-color4));
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    overflow: hidden;
    transition: all 1s ease;
}

body.fade-transition { transition: all 1s ease; }
@keyframes gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* Contenedor de la imagen de fondo tipo Spotify */
#bg-artwork {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    filter: blur(15px) brightness(0.7);
    transition: background-image 1.2s ease-in-out; 
    transform: scale(1.1);
}

/* MENU LATERAL GENERAL */
#sidebar {
    width: 260px;
    background: var(--glass-bg);
    backdrop-filter: blur(6px);
    padding: 80px 20px 40px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.7s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
#sidebar ul { list-style: none; padding: 0; margin: 0; }
#sidebar li { margin-bottom: 12px; }

#sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 12px 18px;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.5s ease;
    color: var(--text-primary);
    cursor: pointer;
    background: var(--card-bg);
}
#sidebar a:hover {
    background: var(--accent);
    color: var(--text-dark);
    transform: translateX(5px);
    text-shadow: 0 0 12px var(--accent), 0 0 20px var(--accent);
    box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
}
#sidebar a.programacion-btn {
    background: var(--accent);
    color: var(--text-dark);
    font-weight: bold;
}
#sidebar a.programacion-btn:hover {
    background: #4B5DBA;
    color: #fff;
}

/* Redes Sociales */
.social-links-container { display: flex; justify-content: space-around; gap: 8px; margin-top: 12px; }
.social-links-container a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 2rem;
    color: var(--text-primary);
    background: var(--card-bg);
    transition: all 0.5s ease;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.social-links-container a:hover {
    background: var(--accent);
    color: var(--text-dark);
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
    text-shadow: none;
}

/* HAMBURGER */
.hamburger {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    font-size: 2rem;
    color: #ffffff;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 5px 10px;
    transition: all 0.5s ease-in-out;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
.hamburger:hover {
    background: var(--accent);
    color: var(--text-dark);
    box-shadow: 0 0 20px var(--accent);
}

@media (max-width: 991.98px) {
    .hamburger { display: block; }
    #sidebar { transform: translateX(-100%); }
    #sidebar.open { transform: translateX(0); }
    main { margin-left: 0 !important; }
}
@media (min-width: 992px) { .hamburger { display: none; } }

/* TEMA */
#theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1002;
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.5s ease-in-out;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
#theme-toggle:hover {
    background: var(--accent);
    color: var(--text-dark);
    box-shadow: 0 0 20px var(--accent), 0 0 30px var(--accent);
}

/* MAIN */
main {
    margin-left: 260px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    background: transparent !important;
}

/* FOOTER */
footer {
    text-align: center;
    padding: 20px 10px;
    background: var(--footer-bg);
    backdrop-filter: blur(6px);
    font-size: 0.9rem;
    color: var(--text-primary);
    flex-shrink: 0;
    transition: all 1s ease;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    z-index: 10;
}
footer .bar { display: inline; color: var(--accent); }
footer .footer-line1, footer .footer-line2 { display: inline; }
@media (max-width: 576px) {
    footer .footer-line1, footer .footer-line2 { display: block; }
    footer .bar { display: none; }
}

/* MODALES */
.modal-dialog { max-width: 900px; margin: 1.75rem auto; }
@media (max-width: 768px) { .modal-dialog { max-width: 95%; } }
.modal-content { position: relative; background: rgba(255,255,255,0.9); backdrop-filter: blur(10px); }
.modal-body { overflow-y: scroll; scrollbar-width: none; }
.modal-body::-webkit-scrollbar { display: none; }

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-btn i { color: #333; }
.close-btn:hover {
    background: #e63946;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.close-btn:hover i { color: #fff; }

/* MODO CLARO ACTUALIZADO */
body.light-mode {
    --text-primary: #23005c;
    --volume-bar-color: var(--text-dark);
    background: linear-gradient(-45deg, var(--light-bg-color1), var(--light-bg-color2), var(--light-bg-color3), var(--light-bg-color4));
    background-size: 400% 400%;
}
body.light-mode #sidebar { background: rgba(189, 222, 237, 0.85); }
body.light-mode #sidebar a { color: var(--text-dark); background: rgba(255, 255, 255, 0.7); }
body.light-mode #sidebar a:hover { background: var(--primary); color: #fff !important; }
body.light-mode footer { background: var(--primary); color: #fff; }

/* ANIMACIONES MODALES */
@keyframes fadeInZoomSlide { 0% { opacity: 0; transform: translateX(-50px) scale(0.8); } 100% { opacity: 1; transform: translateX(0) scale(1); } }
.modal-anim-in .modal-dialog { animation: fadeInZoomSlide 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }

/* =========================================
   RADIO PLAYER GOLD STANDARD
   ========================================= */
#player {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    z-index: 5;
}

.radio-card {
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(15px);
    border-radius: 30px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.15);
    transition: all 0.5s ease;
}

#cover-art {
    width: 250px;
    height: 250px;
    border-radius: 20px;
    object-fit: cover;
    margin-bottom: 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    transition: transform 0.4s ease;
}

.track-info h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.track-info span {
    font-size: 1.1rem;
    color: var(--accent);
    display: block;
    margin-bottom: 25px;
    font-weight: 500;
    transition: all 0.5s ease;
}

.play-btn {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
}

.play-btn:active {
    transform: scale(0.95);
}

/* AJUSTES MODO CLARO ESPECÍFICOS - MEJORA DE CONTRASTE */
body.light-mode .radio-card {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255,255,255,0.6);
}
body.light-mode .track-info h2 {
    color: var(--text-dark);
}

/* "SONANDO AHORA" - Modo Claro */
body.light-mode .playing-now-label {
    color: #555555 !important;
    font-weight: 600;
    text-shadow: 0.5px 0.5px 1px rgba(0,0,0,0.05);
}

/* INTÉRPRETE - Modo Claro */
body.light-mode .track-info span {
    color: #444444 !important;
    text-shadow: 0.5px 0.5px 1px rgba(0,0,0,0.1);
    font-weight: 600;
}

@media (max-width: 480px) {
    #cover-art { width: 180px; height: 180px; }
    .radio-card { padding: 25px; }
}

@media screen and (orientation: landscape) and (max-device-width: 932px) {
  html {
    transform: rotate(-90deg);
    transform-origin: left top;
    width: 100vh;
    height: 100vw;
    overflow: hidden;
    position: absolute;
    top: 100%;
    left: 0;
  }
}

.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    margin-top: 10px;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 20px;
    transition: all 0.5s ease;
}

#volume-control {
    width: 100%;
    cursor: pointer;
    accent-color: var(--volume-bar-color);
    transition: all 0.5s ease;
}

#volume-icon {
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.5s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    flex-shrink: 0;
}

#volume-icon:hover {
    transform: scale(1.2);
    color: var(--accent);
}

body.light-mode .volume-container {
    background: rgba(0, 0, 0, 0.05);
}
body.light-mode #volume-icon {
    color: var(--text-dark);
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* --- ARREGLO FIREFOX SOLO PARA MÓVILES --- */
@supports (-moz-appearance:none) {
    @media (max-width: 768px) {
        .radio-card {
            max-height: 72vh !important;
            padding: 20px !important;
        }
        #cover-art {
            max-height: 160px !important; 
            width: auto !important;
        }
        .track-info h2 { font-size: 1.1rem !important; }
    }
}

/* --- REGLA DE FLUIDEZ PARA PC --- */
@media (min-width: 992px) {
    .radio-card {
        max-height: none !important;
        width: 450px !important;     
    }
    #cover-art {
        width: 400px !important;     
        height: 400px !important;
    }
}

.marquee-container {
    width: 100%;
    /* Ponemos un ancho máximo para que en PC el texto tenga un límite y empiece a girar */
    max-width: 450px; 
    margin: 0 auto;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
    position: relative;
}

.marquee-text {
    display: inline-block;
    padding-left: 0;
    will-change: transform;
}

@keyframes scroll-text {
    0% { transform: translateX(0); }
    10% { transform: translateX(0); } /* Pausa inicial */
    90% { transform: translateX(var(--scroll-distance)); }
    100% { transform: translateX(var(--scroll-distance)); } /* Pausa final */
}

#btn-share:hover {
    color: #00ff00 !important;
    transform: scale(1.1);
    transition: all 0.2s ease;
}