/* --- VARIABLES --- */
:root {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #282828;
    --accent: #1db954;
    --accent-hover: #1ed760;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --border: #333333;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* --- RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- SECCIÓN DE AUTENTICACIÓN --- */
.seccion-auth {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-container {
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.login-container h1 {
    margin-bottom: 30px;
    font-size: 28px;
}

/* --- PESTAÑAS --- */
.tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

.tab-btn:hover {
    color: var(--text-primary);
}

/* --- FORMULARIOS --- */
.form-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-container input {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
}

.form-container input:focus {
    outline: 2px solid var(--accent);
}

.form-container button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-container button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

#msg-auth {
    color: #ff4444;
    margin-top: 10px;
    font-size: 12px;
}

/* --- REPRODUCTOR FIJO --- */
.reproductor-fijo {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 100;
    border-top: 1px solid var(--border);
}

.reproductor-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 180px;
}

.album-art {
    width: 50px;
    height: 50px;
    background: var(--bg-tertiary);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.info-text #titulo-actual {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.info-text #artista-actual {
    font-size: 12px;
    color: var(--text-secondary);
}

.reproductor-controles {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-control {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    transition: all 0.3s ease;
}

.btn-control:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.btn-play {
    background: var(--accent);
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-play:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

.reproductor-progreso {
    flex: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.reproductor-progreso input[type="range"] {
    flex: 1;
    height: 5px;
    -webkit-appearance: none;
    background: var(--bg-tertiary);
    border-radius: 5px;
    cursor: pointer;
}

.reproductor-progreso input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.bar-rgb {
    position: absolute;
    bottom: -5px;
    left: 45px;
    height: 3px;
    background: linear-gradient(90deg, #1db954, #1ed760, #1db954);
    width: 0%;
    transition: width 0.1s linear;
}

#tiempo-actual, #tiempo-total {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 40px;
}

.btn-logout-navbar {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    transition: color 0.3s;
}

.btn-logout-navbar:hover {
    color: #ff4444;
}

/* --- CONTENIDO PRINCIPAL --- */
.contenido-principal {
    padding: 40px 30px 120px 30px;
    min-height: 100vh;
}

.barra-busqueda {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

#contador-pistas {
    font-size: 14px;
    color: var(--text-secondary);
}

#buscador {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    width: 300px;
    font-size: 14px;
}

#buscador:focus {
    outline: none;
    border-color: var(--accent);
}

/* --- GRID DE CANCIONES --- */
.rejilla-canciones {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.tarjeta {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.tarjeta:hover {
    background: var(--bg-tertiary);
    transform: translateY(-5px);
}

.tarjeta.sonando {
    background: linear-gradient(135deg, #1db954 0%, #1ed760 100%);
    box-shadow: 0 4px 15px rgba(29, 185, 84, 0.4);
}

/* --- BOTÓN DE SUBIDA --- */
.boton-subir {
    text-align: center;
    margin: 30px 0;
}

.boton-subir button {
    background: var(--accent);
    color: var(--text-primary);
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.boton-subir button:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

#progreso-subida {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* --- PANEL DE SONIDOS --- */
.panel-sonidos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.btn-efecto {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.btn-efecto:hover {
    background: var(--accent);
    border-color: var(--accent);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .reproductor-fijo {
        flex-direction: column;
        padding: 15px;
        gap: 12px;
    }

    .reproductor-info, .reproductor-controles, .reproductor-progreso {
        width: 100%;
        justify-content: center;
    }

    .bar-rgb { display: none; }

    .contenido-principal {
        padding: 20px 15px 160px 15px;
    }

    .barra-busqueda {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    #buscador { width: 100%; }
}