/* VARIABLES Y BASE */
:root { 
    --primary: #00ff88; 
    --bg: #0f172a; 
    --card: #1e293b; 
    --text: #f1f5f9; 
    --text-dim: #94a3b8; 
    --danger: #ef4444; 
}

body { 
    background: var(--bg); 
    color: var(--text); 
    font-family: system-ui, sans-serif; 
    margin: 0; 
    padding: 15px; 
    /* Espacio vital para que el reproductor no tape las listas al final */
    padding-bottom: 140px; 
}

.hidden { display: none !important; }

/* NOTIFICACIONES TOAST */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--card); color: var(--text); padding: 12px 20px; border-radius: 10px; border-left: 4px solid var(--primary); box-shadow: 0 5px 15px rgba(0,0,0,0.3); animation: slideIn 0.3s ease-out forwards; font-size: 14px; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }

/* LAYOUT GRID */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 1200px; margin: 0 auto; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

/* COMPONENTES */
.card { background: var(--card); padding: 15px; border-radius: 12px; border: 2px solid transparent; transition: all 0.3s; }

input, select { background: #000; color: #fff; padding: 10px; border-radius: 12px; border: 1px solid #334155; width: 100%; margin-bottom: 8px; box-sizing: border-box; }
button { background: var(--primary); color: #000; font-weight: bold; border: none; border-radius: 12px; padding: 12px; cursor: pointer; transition: opacity 0.2s; }
button:hover { opacity: 0.9; }

.file-label { display: block; background: #000; color: var(--text-dim); padding: 20px; border-radius: 12px; border: 2px dashed #334155; text-align: center; cursor: pointer; margin-bottom: 10px; }

/* TARJETAS DE CANCIÓN */
.track-card { 
    background: rgba(0,0,0,0.2); 
    padding: 15px; 
    border-radius: 12px; 
    margin-bottom: 12px; 
    border: 2px solid transparent; 
    cursor: pointer;
    transition: all 0.2s ease;
}
.track-card:hover { background: rgba(255, 255, 255, 0.05); transform: translateY(-2px); }

/* RESALTADO DE CANCIÓN ACTIVA (Sincronizado) */
.active-track { 
    border-color: var(--primary) !important; 
    background: rgba(0, 255, 136, 0.1) !important; 
    box-shadow: inset 0 0 10px rgba(0, 255, 136, 0.15);
}

.track-content { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.track-info { flex: 1; }
.track-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.track-title { display: block; font-weight: bold; color: var(--primary); font-size: 1.1rem; }
.track-meta { display: block; font-size: 0.85rem; color: var(--text-dim); margin-top: 2px; }

.stats-row { display: flex; gap: 10px; margin: 8px 0; }
.stat-item { display: flex; align-items: center; gap: 5px; font-size: 0.8rem; font-weight: bold; color: var(--text-dim); background: rgba(255,255,255,0.03); padding: 4px 8px; border-radius: 6px; }

.btn-mini { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.05); color: #fff; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); padding: 0; }
.btn-danger { color: var(--danger); border-color: var(--danger); }

.add-to-folder { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.05); }
.folder-title { color: var(--primary); font-weight: bold; margin: 15px 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }

/* REPRODUCTOR GLOBAL (FIXED) */
#global-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.96); 
    border-top: 2px solid var(--primary);
    padding: 12px 20px;
    z-index: 10000;
    box-shadow: 0 -8px 25px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
}

.player-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.player-info { 
    display: flex; 
    flex-direction: column; 
    min-width: 140px; 
    max-width: 220px;
    overflow: hidden;
}

#player-title { color: var(--primary); font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1rem; }
#player-artist { color: var(--text-dim); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ONDA DE SONIDO */
#waveform {
    flex: 2;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 5px;
    min-width: 100px;
}

/* AUTH & HEADER */
#auth-section img { display: block; margin: 0 auto 30px auto; width: 220px; }

#user-section header { 
    max-width: 1200px; 
    margin: 0 auto 20px auto; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
#user-section header img { height: 50px; width: auto; }

/* CONTROLES PRE-PRODUCCIÓN */
.btn-control { 
    background: transparent; 
    border: 1px solid var(--text-dim); 
    color: var(--text-dim); 
    width: 42px; 
    height: 42px; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 20px; 
}
.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    padding: 5px 10px;
    border-radius: 10px;
}

/* Estilo para que el slider sea más fino y moderno */
#volume-slider {
    cursor: pointer;
    height: 4px;
    accent-color: var(--primary); /* El color verde neón */
}

@media (max-width: 768px) {
    .volume-container {
        width: 100%;
        justify-content: center;
    }
}
.btn-control.active { border-color: var(--primary); color: var(--primary); background: rgba(0, 255, 136, 0.1); }

/* RESPONSIVE MÓVIL */
@media (max-width: 768px) {
    body { padding-bottom: 180px; } /* Más espacio en móvil para el reproductor verticalizado */
    .player-content { flex-direction: column; gap: 8px; }
    .player-info { max-width: 100%; text-align: center; min-width: 100%; }
    #waveform { width: 100%; height: 35px; }
    .player-controls { display: flex; gap: 15px; width: 100%; justify-content: center; }
}