/* ================================================= */
/* 🎵 HASTRAL MUSIC – CSS FINAL (PRO & STABLE) */
/* ================================================= */

:root {
    --bg-main: #070b1a;
    --bg-panel: rgba(15, 20, 40, 0.95);
    --border-soft: rgba(255,255,255,0.08);
    --accent: #7c7cff;
    --accent-2: #b16cff;
    --text-main: #f1f1ff;
    --text-muted: #9aa0c7;
}

/* ---------- MUSIC BUTTON ---------- */
#musicBtn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    border-radius: 50%;
    padding: 10px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(124,124,255,0.6);
    transition: transform 0.2s, box-shadow 0.2s;
}

#musicBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(177,108,255,0.9);
}

/* ---------- OVERLAY ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.hidden {
    display: none;
}

/* ---------- MUSIC MODAL ---------- */
.music-modal {
    width: 95%;
    max-width: 1100px;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(180deg, #090e22, #060815);
    border-radius: 22px;
    padding: 26px;
    color: var(--text-main);
    box-shadow: 0 0 40px rgba(124,124,255,0.25);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ---------- HEADER ---------- */
.music-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.music-modal-header h2 {
    font-size: 26px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
}

/* ---------- ADD MUSIC ---------- */
.add-music-section {
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 28px;
}

.add-form {
    display: flex;
    gap: 10px;
}

.add-form input {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: #0d1230;
    color: white;
}

.add-form button {
    padding: 12px 18px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    cursor: pointer;
}

/* ---------- PLAYLISTS ---------- */
.playlists-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.create-playlist-btn {
    background: none;
    border: 1px solid var(--border-soft);
    padding: 8px 14px;
    border-radius: 10px;
    color: var(--text-main);
    cursor: pointer;
}

.playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.playlist-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.playlist-card:hover {
    transform: translateY(-4px);
}

.playlist-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(124,124,255,0.45);
}

/* ---------- MUSIC GRID ---------- */
.music-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
    gap: 18px;
}

/* ---------- MUSIC CARD ---------- */
.music-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    padding: 14px;
    display: flex;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.music-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(124,124,255,0.25);
}

.music-card.playing {
    border-color: var(--accent);
    box-shadow: 0 0 25px rgba(124,124,255,0.6);
}

.music-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
}

/* ---------- INFO ---------- */
.music-info {
    flex: 1;
}

.music-title {
    font-size: 14px;
    font-weight: bold;
}

/* ---------- ACTIONS ---------- */
.music-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.action-btn {
    border: none;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    background: #141a3a;
    color: white;
}

.action-btn:hover {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.remove-btn:hover {
    background: linear-gradient(135deg, #ff4d4d, #ff0077);
}

/* ---------- MINI PLAYER ---------- */
.mini-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(15,20,45,0.95);
    border: 1px solid var(--border-soft);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 999;
    box-shadow: 0 0 30px rgba(124,124,255,0.35);
}

.mini-player.hidden {
    display: none;
}

.mini-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 12px;
}

.mini-title {
    font-size: 13px;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-controls {
    display: flex;
    gap: 8px;
}

.mini-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

.mini-btn.large {
    font-size: 22px;
}
/* ---------- RESPONSIVE MOBILE ---------- */
@media (max-width: 768px) {
    .music-modal {
        width: 95%;
        max-width: 95%;
        padding: 20px;
        max-height: 90vh;
    }
    
    .music-modal-header h2 {
        font-size: 22px;
    }
    
    .music-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .playlists-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .music-modal {
        padding: 15px;
        border-radius: 15px;
    }
    
    .music-modal-header {
        margin-bottom: 15px;
    }
    
    .music-modal-header h2 {
        font-size: 20px;
    }
    
    .close-modal-btn {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    /* Section ajout musique */
    .add-music-section h3 {
        font-size: 16px;
    }
    
    .add-form {
        flex-direction: column;
    }
    
    .add-form input {
        width: 100%;
    }
    
    .add-form button {
        width: 100%;
    }
    
    /* Playlists */
    .playlists-section h3,
    .music-library h3 {
        font-size: 16px;
    }
    
    .playlists-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .playlist-card {
        padding: 12px;
    }
    
    /* Cartes musique mobile */
    .music-card {
        padding: 10px;
        border-radius: 12px;
    }
    
    .music-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .music-title {
        font-size: 13px;
    }
    
    .music-actions {
        flex-direction: row;
        gap: 4px;
    }
    
    .action-btn {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    /* Mini player mobile */
    .mini-player {
        bottom: 10px;
        right: 10px;
        left: 10px;
        padding: 10px;
        border-radius: 15px;
        justify-content: space-between;
    }
    
    .mini-thumbnail {
        width: 45px;
        height: 45px;
    }
    
    .mini-title {
        font-size: 12px;
        max-width: 120px;
    }
    
    .mini-controls {
        gap: 6px;
    }
    
    .mini-btn {
        font-size: 16px;
    }
    
    .mini-btn.large {
        font-size: 20px;
    }
}
