/* ========================================= */
/* 0. Variables CSS (Recomendado para fácil personalización) */
/* ========================================= */
:root {
    --primary-bg-color-fallback: #1a1a2e; /* Color de fondo de respaldo si la imagen no carga */
    --accent-color: #00bfff; /* Azul claro para elementos interactivos y títulos */
    --highlight-color: #90f0ff; /* Para el nombre del DJ y ciertos brillos */
    --text-color: #f0f0f0; /* Color de texto general claro */
    --text-color-light: #cccccc; /* Color de texto más suave */
    --card-bg-opacity: 0.2; /* Opacidad para los fondos de tarjetas (0.0 a 1.0) */
    --container-bg-opacity: 0.8; /* Opacidad para los fondos de contenedores (0.0 a 1.0) */

    /* Variables específicas de componentes */
    --radio-player-bg: rgba(40, 41, 45, 0.13);
    --card-hover-bg: rgba(255, 255, 255, calc(var(--card-bg-opacity, 0.2) + 0.1));
    --dj-section-bg: rgba(0, 0, 0, 0.4);
    --dj-section-border: rgba(0, 255, 255, 0.5);
    --dj-section-shadow: rgba(0, 255, 255, 0.2);
    --control-btn-gradient-start: #e1de27;
    --control-btn-gradient-end: #ff69b4;
    --volume-thumb-color: #ff69b4;
    --request-btn-bg: #b1c140; /* Verde para el botón de petición */
    --request-btn-hover-bg: #67992cf0;
    --modal-form-bg: rgba(54, 53, 62, 0.87);
    --modal-overlay-bg: rgba(0, 0, 0, 0.7);
}

/* ========================================= */
/* 1. Estilos Globales y de Reseteo (CRÍTICO para el Scroll y Layout) */
/* ========================================= */
/* Resetear box-sizing para todos los elementos */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow-x: hidden; /* Evita el scroll horizontal no deseado por elementos */
    overflow-y: auto;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    color: var(--text-color, #dfd324);
    position: relative; /* Base para el posicionamiento de elementos hijos */
    width: 100%; /* Asegura que el body no desborde */
    overflow-x: hidden; /* Doble seguridad contra desbordamientos */

    /* --- ESTILOS PARA LA IMAGEN DE FONDO --- */
    background-color: var(--primary-bg-color-fallback, #1a1a2e); /* Color de respaldo si la imagen no carga */
    background-image: url('http://puntochat.org/wp-content/uploads/gettyimages-1062558396-612x612-1.jpg'); /* ¡CAMBIA ESTO POR LA RUTA DE TU IMAGEN PREDETERMINADA! */
    background-size: auto; /* Asegura que la imagen cubra todo el área sin distorsionarse */
    background-position: center center; /* Centra la imagen */
    background-repeat: repeat; /* Evita que la imagen se repita */
    background-attachment: fixed; /* Hace que la imagen de fondo sea fija al hacer scroll */
}

/* ========================================= */
/* 2. Contenedor Principal (main-background) y Efectos */
/* ========================================= */
.main-background {
    min-height: 100vh;
    width: 100%; /* Ocupa el 100% del ancho disponible */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px 20px;
    box-sizing: border-box;
    background-color: rgba(26, 26, 46, var(--container-bg-opacity, 0.8));
    position: relative;
    z-index: 1;
}

.overlay-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Estilos de las burbujas */
.bubble {
    position: absolute;
    bottom: -100px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: bubbleUp 15s infinite ease-in;
}

/* Variaciones para las burbujas (tamaño, posición, velocidad) */
.x1 { left: 10%; width: 60px; height: 60px; animation-duration: 16s; animation-delay: 0s; }
.x2 { left: 20%; width: 80px; height: 80px; animation-duration: 18s; animation-delay: 2s; }
.x3 { left: 25%; width: 50px; height: 50px; animation-duration: 14s; animation-delay: 4s; }
.x4 { left: 40%; width: 70px; height: 70px; animation-duration: 20s; animation-delay: 0s; }
.x5 { left: 55%; width: 90px; height: 90px; animation-duration: 17s; animation-delay: 3s; }
.x6 { left: 70%; width: 65px; height: 65px; animation-duration: 15s; animation-delay: 5s; }
.x7 { left: 80%; width: 75px; height: 75px; animation-duration: 19s; animation-delay: 1s; }
.x8 { left: 90%; width: 100px; height: 100px; animation-duration: 21s; animation-delay: 6s; }
.x9 { left: 30%; width: 55px; height: 55px; animation-duration: 13s; animation-delay: 2.5s; }
.x10 { left: 50%; width: 85px; height: 85px; animation-duration: 18s; animation-delay: 4.5s; }

/* Animación para las burbujas */
@keyframes bubbleUp {
    0% {
        transform: translateY(0);
        opacity: 0.1;
    }
    100% {
        transform: translateY(-100vh);
        opacity: 0.5;
    }
}

/* ========================================= */
/* 3. Radio Player */
/* ========================================= */
.radio-player-container {
    position: relative;
    z-index: 1;
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    padding: 40px;
    background-color: var(--radio-player-bg, rgba(40, 41, 45, 0.13));
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    box-sizing: border-box;

    /* Nuevos estilos para el fondo del DJ */
    background-size: cover; /* Asegura que la imagen cubra todo el fondo */
    background-position: center; /* Centra la imagen */
    background-repeat: no-repeat; /* Evita que la imagen se repita */
    transition: background-image 1s ease-in-out, background-color 0.5s ease; /* Transición suave */
}

/* Clase para el fondo predeterminado si no hay DJ o la imagen no carga */
.radio-player-container.default-bg {
    background-image: none !important; /* Fuerza la eliminación de la imagen si se aplica */
    background-color: var(--radio-player-bg, rgba(40, 41, 45, 0.13)); /* Vuelve al color original */
}


.player-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #fff;
    letter-spacing: 2px;
}

.tagline {
    font-size: 1.1em;
    color: #eee;
    margin-bottom: 30px;
}

.player-controls {
    display: flex;
    flex-wrap: wrap; /* Permite que los elementos se envuelvan en pantallas pequeñas */
    justify-content: center;
    align-items: center;
    gap: 20px; /* Espacio entre los controles */
    margin-bottom: 30px;
}

.control-btn {
    background: linear-gradient(45deg, var(--control-btn-gradient-start, #e1de27), var(--control-btn-gradient-end, #ff69b4));
    border: none;
    border-radius: 30px;
    width: 90px;
    height: 50px;
    color: white;
    font-size: 1.8em;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.control-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px; /* Espacio superior para separar si se envuelve */
}

.volume-icon {
    font-size: 1.2em;
    color: #fff;
}

#volume-slider {
    width: 100px;
    -webkit-appearance: none;
    height: 8px;
    border-radius: 50px; /* Hago que el slider sea más redondeado */
    background: #ddd;
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--volume-thumb-color, #ff69b4);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--volume-thumb-color, #ff69b4);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.now-playing {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 20px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
    white-space: nowrap;
}

.now-playing-text {
    font-size: 1em;
    font-weight: 600;
    color: #f0f0f0;
    margin: 0;
}

.song-title-wrapper {
    flex-grow: 1;
    overflow: hidden;
}

.sliding-text {
    display: inline-block;
    padding-left: 100%;
    animation: slide-text 15s linear infinite;
}

@keyframes slide-text {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* --- Estilos para la sección del DJ en vivo --- */
.dj-live-section {
    margin-top: 20px;
    background-color: var(--dj-section-bg, rgba(0, 0, 0, 0.4));
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--dj-section-shadow, rgba(0, 255, 255, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 90%;
    max-width: 600px;
    margin: 20px auto 0 auto;
   /* border: 1px solid var(--dj-section-border, rgba(0, 255, 255, 0.5)); */
    box-sizing: border-box;
}

.dj-profile-thumb {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color, #00bfff);
    box-shadow: 0 0 10px var(--highlight-color, rgba(0, 255, 255, 0.7));
}

.dj-info-text {
    font-size: 1.1em;
    color: var(--text-color-light, #cccccc);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: normal;
    word-break: break-word;
}

.dj-info-text .fas {
    color: var(--accent-color, #00bfff);
}

#current-dj {
    font-weight: 700;
    color: var(--highlight-color, #90f0ff);
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}


/* ========================================= */
/* 4. Secciones DJ Cards y Horarios */
/* ========================================= */
.dj-cards-container,
.dj-schedule-container {
    padding: 50px;
    background: rgba(0, 0, 0, 0.11);
    border-radius: 15px;
    margin-top: 40px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 1200px;
    width: 100%;
    position: relative;
    z-index: 10;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
}

.dj-cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
}

.dj-cards-container h2,
.dj-schedule-container h3 {
    color: var(--text-color, #f0f0f0);
    text-align: center;
    width: 100%;
    font-family: 'Montserrat', sans-serif;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
    position: relative;
    margin-bottom: 30px;
}
.dj-cards-container h2 { font-size: 2.5em; }
.dj-schedule-container h3 { font-size: 2.2em; }

.dj-cards-container h2::after,
.dj-schedule-container h3::after {
    content: '';
    display: block;
    background: var(--accent-color, #00bfff);
    margin: 10px auto 0;
    border-radius: 2px;
}
.dj-cards-container h2::after { width: 100px; height: 4px; }
.dj-schedule-container h3::after { width: 80px; height: 3px; }

.dj-card {
    flex: 1 1 280px;
    max-width: 350px;
    background: rgba(255, 255, 255, var(--card-bg-opacity, 0.2));
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, background 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-sizing: border-box;
}

.dj-card:hover {
    transform: translateY(-8px);
    background: var(--card-hover-bg, rgba(255, 255, 255, calc(var(--card-bg-opacity, 0.2) + 0.1)));
}

.dj-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dj-card:hover::before {
    opacity: 1;
}

.dj-card img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 4px solid var(--accent-color, #00bfff);
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.dj-card:hover img {
    transform: scale(1.05);
}

.dj-card h4 {
    color: var(--text-color, #f0f0f0);
    font-size: 1.6em;
    margin-bottom: 8px;
    font-family: 'Montserrat', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.dj-card p {
    color: var(--text-color-light, #cccccc);
    font-size: 1em;
    line-height: 1.5;
    margin-bottom: 15px;
}

.dj-social a {
    color: var(--text-color, #f0f0f0);
    margin: 0 8px;
    font-size: 1.4em;
    transition: color 0.3s ease, transform 0.3s ease;
}

.dj-social a:hover {
    color: var(--accent-color, #00bfff);
    transform: translateY(-3px);
}

/* Estilos para la Tabla de Horarios de DJs */
.dj-schedule-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 100%;
    box-sizing: border-box;
}

.dj-schedule-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Mantén un ancho mínimo para que la tabla sea legible */
    table-layout: fixed; /* Asegura que las columnas se distribuyan uniformemente */
}

.dj-schedule-table th,
.dj-schedule-table td {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 15px;
    text-align: left;
    color: var(--text-color-light, #e0e0e0);
    font-family: 'Poppins', sans-serif;
    white-space: normal; /* Permite que el texto se envuelva */
    word-break: break-word; /* Rompe palabras largas para evitar desbordamiento */
}

.dj-schedule-table th {
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--accent-color, #00bfff);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.95em;
}

.dj-schedule-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

.dj-schedule-table tr:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
}

.dj-schedule-table td.time-slot {
    font-weight: 600;
    color: var(--accent-color, #00bfff);
    /* white-space: nowrap; /* Descomenta si quieres que la hora nunca se envuelva */
}

/* ========================================= */
/* 5. Footer */
/* ========================================= */
.footer {
    color: var(--text-color-light, #cccccc);
    text-align: center;
    font-size: 0.9em;
    margin-top: 40px;
    padding: 20px;
    width: 100%;
    max-width: 1200px;
    box-sizing: border-box;
    z-index: 10;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================= */
/* 6. Modal de Petición (Restaurado y ajustado) */
/* ========================================= */
.modal-button {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 300;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.modal-button:hover {
    background-color: #e67e22;
    transform: translateY(-2px);
}

/* Estilos base del formulario */
.request-form-container {
    background-color: var(--modal-form-bg, rgba(54, 53, 62, 0.87));
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    position: relative;
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s ease-in-out;
    box-sizing: border-box;
}

.request-form-container h3 {
    color: #f0f0f0;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 700;
}

.request-form-container textarea {
    width: calc(100% - 20px);
    padding: 12px;
    margin-bottom: 18px;
    border-radius: 8px;
    border: 1px solid #f2eeee;
    background-color: #1d1b22;
    color: #fff;
    resize: vertical;
    min-height: 100px;
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    box-sizing: border-box;
}

.request-form-container button {
    background-color: var(--request-btn-bg, #b1c140);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 300;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.request-form-container button:hover {
    background-color: var(--request-btn-hover-bg, #67992cf0);
    transform: translateY(-2px);
}

.request-toggle-btn {
    background-color: #5165b3a3;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 300;
    margin-top: 20px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.request-toggle-btn:hover {
    background-color: #e67e22;
    transform: translateY(-2px);
}

/* --- Estilos para el MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay-bg, rgba(0, 0, 0, 0.7));
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.modal-overlay.active {
    visibility: visible;
    opacity: 1;
}

.modal-overlay.active .request-form-container {
    transform: scale(1);
    opacity: 1;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #ccc;
    font-size: 2em;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal-btn:hover {
    color: #fff;
}

/* ========================================= */
/* 7. Media Queries (Responsiveness) */
/* ========================================= */

/* Para tabletas (desde 768px hacia abajo) */
@media (max-width: 768px) {
    body {
        background-size: auto;
    }

    .main-background {
        padding: 30px 15px;
    }

    /* Reproductor de Radio */
    .radio-player-container {
        padding: 20px;
    }
    .player-title {
        font-size: 2em;
    }
    .tagline {
        font-size: 0.9em;
    }
    .player-controls {
        flex-direction: row; /* Mantener horizontal en tablets */
        flex-wrap: wrap; /* Permitir que se envuelvan */
        justify-content: center;
        gap: 15px; /* Reducir el espacio entre ellos */
    }
    .control-btn {
        width: 70px;
        height: 40px;
        font-size: 1.2em;
    }
    .volume-control {
        width: auto; /* Dejar que el contenido defina el ancho */
        justify-content: center;
    }
    #volume-slider {
        width: 150px;
    }
    .now-playing-text {
        font-size: 0.9em;
    }

    /* Secciones de DJ Cards y Horarios */
    .dj-cards-container,
    .dj-schedule-container {
        padding: 20px 15px;
        margin-top: 30px;
    }

    .dj-cards-container {
        flex-direction: column; /* Apila las tarjetas en una columna en tablets/móviles */
        align-items: center; /* Centra las tarjetas apiladas */
    }

    .dj-card {
        width: 90%; /* Hace que las tarjetas ocupen más ancho en móvil */
        max-width: 300px; /* Limita el ancho máximo para tarjetas individuales */
        padding: 15px;
    }

    .dj-card img {
        width: 90px;
        height: 90px;
    }

    .dj-card h4 {
        font-size: 1.3em;
    }

    .dj-card p {
        font-size: 0.85em;
    }

    .dj-social a {
        font-size: 1.1em;
    }

    .dj-schedule-container h3 {
        font-size: 1.6em;
    }

    .dj-schedule-table th,
    .dj-schedule-table td {
        padding: 8px 10px;
        font-size: 0.8em;
    }

    /* Sección del DJ en vivo */
    .dj-live-section {
        flex-direction: column; /* Apila la imagen y el texto en pantallas pequeñas */
        text-align: center;
        padding: 10px 15px;
        gap: 10px;
        max-width: 95%; /* Ocupa casi todo el ancho */
    }

    .dj-profile-thumb {
        width: 50px;
        height: 50px;
    }

    .dj-info-text {
        font-size: 1em;
    }

    /* Footer */
    .footer {
        margin-top: 30px;
        padding: 15px;
        font-size: 0.8em;
    }
}

/* Para teléfonos muy pequeños (max-width de 480px) */
@media (max-width: 480px) {
    .player-title {
        font-size: 1.8em;
    }
    .tagline {
        font-size: 0.8em;
    }
    .player-controls {
        flex-direction: column; /* Apilar botones solo en pantallas muy pequeñas */
    }
    .now-playing {
        padding: 8px 10px;
    }
    .now-playing-text {
        font-size: 0.85em;
    }
    .dj-cards-container h2 {
        font-size: 2em;
    }
    .dj-schedule-container h3 {
        font-size: 1.4em;
    }
    .dj-schedule-table th,
    .dj-schedule-table td {
        font-size: 0.75em;
    }
    .request-form-container {
        padding: 20px;
    }
    .request-form-container h3 {
        font-size: 1.3em;
    }
    .request-form-container textarea {
        min-height: 80px;
    }
    .request-form-container button {
        padding: 10px 20px;
        font-size: 1em;
    }
}