/* ======================== */
/* 1. Estilos Generales y Contenedor */
/* ======================== */

/* Estilos principales para el contenedor de la rocola */
.rocola-container {
    justify-content: center;
    max-width: 600px;
    margin: 20px auto;
    padding: 50px;
    background: #000000 !important;
    color: #b3b3b3;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    overflow-y: auto;
}
/* Asegura que el contenedor de la cola no tenga espacio por defecto */
#rocola-next-song-info {
    margin: 0;
    padding: 0;
    /* Si estás usando Flexbox en el padre, asegúrate que este div no se estire */
    /* Por ejemplo, podrías usar: flex-grow: 0; */
}

/* Opcional: Estilo para la línea de la canción siguiente */
.next-track-text {
    font-size: 1.1em; /* Más pequeño que el nombre de la canción actual */
    color: white;     /* Un color tenue */
    margin-top: 0px; /* Pequeño espacio con el artista actual */
    margin-bottom: 0;
}

/* Estilo para los títulos de sección (h2 y h3) */
.rocola-container h2 {
    color: #f78d02;
    border-bottom: 2px solid #f78d02;
    padding-bottom: 10px;
    margin-top: 30px;
    font-weight: bold;
    font-size: 0.8em; 
    text-align: center;
    margin-bottom: 5px;
}

/* **[MEJORA UX: Verde Neón y Resplandor para H3]** */
.rocola-container h3 {
    color: #00ff00;
    font-size: 1.8em;
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
}

/* Estilos para el mensaje de "costo por canción" y "tus créditos" */
.rocola-costo-creditos,
.rocola-tus-creditos {
    color: #6d33f2;
    text-align: center;
    font-size: 2.3em; /* ¡CUIDADO! Este tamaño es muy grande (50px) si no es intencional. */
    font-weight: bold;
}

/* **[MEJORA UX: Destacar el valor de los créditos con neón]** */
.rocola-costo-creditos span,
.rocola-tus-creditos span {
    color: #00ff00; /* Usamos el verde neón para los números */
    font-size: 1.1em;
}

/* Estilo para el mensaje que pide iniciar sesión */
.rocola-login-message {
    margin-top: 10px;
    font-size: 3em;
    text-align: center;
}

/* **[MEJORA UX: Subrayado sutil para el enlace de login]** */
.rocola-login-message a {
    color: #6d33f2;
    font-weight: bold;
    text-decoration: none;
    border-bottom: 1px dashed #9370db;
    padding-bottom: 2px;
}

    .rocola-status-message {
        padding: 10px 15px;
        margin: 15px 0;
        border-radius: 4px;
        font-size: 1.3em;
        font-weight: 500;
        border-left: 5px solid;
    }
    .rocola-status-explicit-on {
        background-color: #e6ffe6; /* Fondo verde claro */
        border-color: #00cc00;    /* Borde verde */
        color: #006600;
    }
    .rocola-status-explicit-off {
        background-color: #ffe6e6; /* Fondo rojo claro */
        border-color: #cc0000;    /* Borde rojo */
        color: #660000;
    }

/* Estilo para el mensaje de leyenda sobre el administrador */
/* **[MEJORA UX: Barra lateral de acento para la leyenda]** */
.rocola-message-legend {
    text-align: center;
    font-size: 2em;
    border-left: 3px solid #6a42e3; /* Barra vertical de acento */
    padding: 10px;
    margin: 20px 0;
    background-color: #1a1a1a;
    border-radius: 4px;
}

/* ======================== */
/* 2. Sección de Playlist y Reproducción Actual */
/* ======================== */

/* Contenedor de la información de la playlist */
#rocola-playlist-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

/* Contenedor para el texto del playlist */
.rocola-playlist-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

/* Estilos para el nombre del playlist */
#rocola-playlist-name {
    color: #ffffff;
    font-size: 2.5em;
    font-weight: bold;
    margin: 0;
    text-align: center;
}

/* Estilos para los párrafos dentro del contenedor de texto */
.rocola-playlist-text p {
    margin-top: 5px;
    margin-bottom: 5px;
    text-align: center;
}

/* Estilos de la imagen del playlist */
/* **[MEJORA UX: Marco de acento Morado]** */
#rocola-playlist-image {
    order: 2;
    width: 110px;
    height: 110px;
    border-radius: 8px;
    object-fit: cover;
    border: 3px solid #6d33f2;
    box-shadow: 0 0 10px rgba(147, 112, 219, 0.6);
}

/* Contenedor de la canción en reproducción */
/* **[MEJORA UX: Borde y Resplandor Verde Neón para FOCO]** */
#rocola-status {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #000; /* Negro puro para máximo contraste */
    padding: 15px; /* Más padding para que se vea más grande */
    border-radius: 12px;
    margin-top: 25px;
    margin-bottom: 25px;
    justify-content: center;
    text-align: center;
    /* Se mantiene 'display: none' del HTML si no hay canción, pero si está visible... */
    border: 2px solid #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

#current-track-image {
    width: 90px;
    height: 90px;
    border-radius: 4px;
    object-fit: cover;
}

#current-track-name {
    color: #ffffff;
    font-weight: bold;
    margin: 0;
    font-size: 2.5em;
}

#current-track-artist {
    color: #b3b3b3;
    margin: 0;
    font-size: 1.5em;
}

/* Nuevo contenedor para agrupar texto e imagen */
.rocola-playlist-inner-container {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* ======================== */
/* 3. Sección de Búsqueda de Canciones */
/* ======================== */

/* Estilo para el formulario de búsqueda */
#rocola-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

/* Estilo para el campo de entrada de texto */
/* **[MEJORA UX: Borde y Sombra Morada al enfocar]** */
#rocola-search-input {
    flex-grow: 1;
    padding: 6px 6px;
    border: 1px solid #555;
    border-radius: 6px;
    background: #545454;
    color: #fff;
    font-size: 1.8em;
    /* Transición UX */
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#rocola-search-input:focus {
    border: 1px solid #9370db;
    box-shadow: 0 0 8px rgba(147, 112, 219, 0.6);
    outline: none;
}

/* Estilo para el botón de búsqueda */
#rocola-search-button {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    background: #6d33f2;
    color: #fff;
    font-size: 1.8em;
    cursor: pointer;
    white-space: nowrap;
    /* Transiciones UX */
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#rocola-search-button:hover {
    background: #1F0A3B;
}

/* **[MEJORA UX: Efecto de Presión al Buscar]** */
#rocola-search-button:active {
    background: #835dc9;
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 0 5px rgba(147, 112, 219, 0.8);
}

/* Estilos para los resultados de la búsqueda */
#rocola-results {
    margin-top: 18px;
}

/* Contenedor de cada canción individual */
.rocola-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #333;
    /* Transiciones UX */
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* **[MEJORA UX: Borde de selección y resaltado al pasar/tocar]** */
.rocola-track:hover {
    background-color: #1a1a1a;
    border-left: 5px solid #9370db;
    padding-left: 10px;
    box-shadow: 0 0 10px rgba(147, 112, 219, 0.1);
}

.rocola-track:last-child {
    border-bottom: none;
}

/* Estilos para la imagen de la canción */
.rocola-track img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 15px;
}

/* Contenedor del nombre y artista */
.rocola-track .track-details {
    flex-grow: 1;
}

/* Estilos para el nombre de la canción */
.rocola-track .track-name {
    color: #fff;
    font-weight: bold;
    font-size: 1.9em;
    margin: 0;
}

/* Estilos para el nombre del artista */
.rocola-track .track-artist {
    color: #b3b3b3;
    font-size: 1.6em;
    margin: -10;
}

/* Estilos para el botón "Agregar" */
.add-track-btn {
    padding: 5px 5px;
    border: none;
    border-radius: 4px;
    background: #1db954;
    color: #fff;
    font-size: 4em;
    cursor: pointer;
    /* Transiciones UX */
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-width: 100px;
}

.add-track-btn:hover {
    background: #1ed161;
}

/* **[MEJORA UX: Efecto de Presión al Agregar]** */
.add-track-btn:active {
    background: #159544;
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 0 8px rgba(29, 185, 84, 0.7);
}

/* ======================== */
/* 4. Estilos de los Mapas y Administración (Backend) */
/* (Se mantienen tal cual, pues las mejoras de backend ya fueron sugeridas) */
/* ======================== */

.rocola-form-table {
    width: 100%;
    border-collapse: collapse;
}

.rocola-form-table th,
.rocola-form-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ccc;
}

.rocola-form-table input[type="text"],
.rocola-form-table input[type="number"] {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

.rocola-form-table small {
    color: #888;
    font-style: italic;
    display: block;
    margin-top: 5px;
}

#rocola-map {
    height: 300px !important;
    width: 100% !important;
    margin-top: 10px;
    border: 1px solid #ccc;
}

.form-table tr td:nth-child(2) {
    height: auto !important;
    min-height: 320px !important;
    padding-bottom: 0 !important;
    display: block !important;
}

#rocola-front-map {
    height: 200px;
    border-radius: 10px;
    z-index: 1;
}

#rocola-auth-status h3 {
    margin-top: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 5px;
}

.status-connected {
    color: green;
    font-weight: bold;
}

.status-disconnected {
    color: red;
    font-weight: bold;
}

.button-danger {
    background: #dc3232;
    color: #fff;
    border-color: #bd2121;
}

.button-danger:hover {
    background: #c82333;
}

#rocola-reset-button-admin {
    background-color: #e53935;
    color: #ffffff;
}

#rocola-reset-button-admin:hover {
    background-color: #f44336;
    transform: translateY(-2px);
}


/* ======================== */
/* 5. Mensajes de Estado */
/* ======================== */

#rocola-results p,
#playlists-list p {
    text-align: center;
    color: #b3b3b3;
    margin-top: 20px;
}

.rocola-message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: bold;
    text-align: center;
    transition: all 0.5s ease-in-out;
    font-size: 1.5em;
}

.rocola-message.success {
    background-color: #4caf50;
    color: #ffffff;
}

.rocola-message.error {
    background-color: #f44336;
    color: #ffffff;
}
/* ======================================= */
/* ESTILOS DEL BOTÓN DE COMPARTIR GLOBAL (INSTAGRAM LOOK) */
/* ======================================= */

#rocola-share-button {
    /* 1. Maquetación y Espaciado */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 20px;
    padding: 12px 25px;

    /* 2. Color y Degradado (¡CLAVE DEL ESTILO INSTAGRAM!) */
    background: linear-gradient(to right, #833AB4, #E1306C, #FD1D1D, #FEDA77);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    cursor: pointer;

    /* 3. Tipografía (Limpia y Negrita) */
    font-size: 1.8em;
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    letter-spacing: 1px;

    /* 4. Efectos */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

/* Estado al pasar el ratón (Hover) */
#rocola-share-button:hover {
    background-size: 150%;
    background-position: left center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    transform: translateY(-3px);
}

/* Estado al presionar (Active) */
#rocola-share-button:active {
    background-size: 100%;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}
/* ========================================================= */
/* 6. ESTILOS DE LA TARJETA DE COMPARTIR (540x960px) - AJUSTES DE POSICIÓN Y FUENTE */
/* ========================================================= */

#rocola-share-template {
    position: absolute;
    top: -9999px;
    left: -9999px;
    z-index: -1;
}

#rocola-share-template .rocola-share-card {
    width: 540px;
    height: 960px;
    position: relative;
    overflow: hidden;
    display: block;
}

#rocola-share-template #share-background-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

#rocola-share-template #share-song-image {
    position: absolute;
    width: 100px;
    height: 100px;
    top: -20px;
    left: -120px;
    border-radius: 5px;
    object-fit: cover;
    z-index: 2;
}

#rocola-share-template .card-song-info {
    position: absolute;
    width: 355px;
    height: 58px;
    top: 140px;
    left: 165px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    z-index: 10;
    line-height: 1.3;
}

#rocola-share-template .card-track-name {
    font-size: 28px;
    font-weight: bold;
    margin: 3px 0;
    bottom: 40;
}

#rocola-share-template .card-artist-name {
    font-size: 24px;
    margin: 0;
   align-items: center;     /* Centrado vertical */
   bottom: 40;
}

#rocola-share-template #share-playlist-image {
    position: absolute;
    width: 160px;
    height: 160px;
    top: 610px;
    left: 295px;
    object-fit: cover;
    z-index: 3;
    border-radius: 8px;
}

#rocola-share-template .card-message {
    position: absolute;
    bottom: 25px;
    left: 0;
    width: 100%;
    text-align: center;

    font-size: 26px;
    color: #fff;
    padding: 0 px;
    box-sizing: border-box;
    z-index: 4;
}

#rocola-share-template .card-song-info .card-text {
    position: relative;
    z-index: 11;
    align-items: center;     
}
/* ======================== */
/* 7. Estilos Responsivos Mejorados */
/* ======================== */

@media (max-width: 768px) {
    .rocola-container {
        max-width: 100% !important;
        width: 100%;
        margin: 0;
        padding: 25px 15px;
        box-sizing: border-box;
    }


.rocola-message-legend {
        font-size: 1.4em;
        padding: 0 10px;
    }


    .rocola-container h2 {
        font-size: 2.5em;
        margin-bottom: 20px;
    }

    .rocola-container h3 {
        font-size: 1.7em;
        margin-top: 25px;
        margin-bottom: 20px;
    }

    #rocola-search-form {
        flex-direction: column;
        gap: 5px;
    }

    #rocola-search-input,
    #rocola-search-form button {
        width: 100%;
        font-size: 2.2em;
        min-height: 25px;
    }

    .rocola-track {
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 10px;
        gap: 15px;
    }

    .rocola-track img {
        width: 75px;
        height: 75px;
        min-width: 75px;
    }

    .rocola-track .track-details {
        /* Aseguramos que el texto no se desborde */
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .rocola-track .track-name {
        font-size: 1.6em;
    }

    .rocola-track .track-artist {
        font-size: 1.3em;
    }

    .add-track-btn {
        margin-left: auto;
        width: auto;
        min-height: 48px;
        font-size: 7vw;
        min-width: 70px;
    }

    #rocola-status {
        flex-direction: row;
        gap: 15px;
        justify-content: flex-start;
        text-align: left;
        padding: 15px;
    }

    #current-track-image {
        width: 80px;
        height: 80px;
        min-width: 80px;
    }

    .rocola-status .track-info {
        flex-grow: 1;
        overflow: hidden;
    }

    #current-track-name {
        font-size: 2em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #current-track-artist {
        font-size: 1.5em;
    }

    .rocola-costo-creditos,
    .rocola-tus-creditos {
        font-size: 1.6em;
    }
}