/* ========================================
   HUB — SÉLECTEUR DE PLAYLISTS (layout 25/75)
   ======================================== */

.lac-hub {
    width: 100%;
    box-sizing: border-box;
    font-family: 'ABeeZee', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    display: grid;
    grid-template-columns: 25% 75%;
    grid-template-rows: auto;   /* la hauteur suit le contenu le plus grand */
    gap: 16px;
    align-items: start;
}

/* ── Colonne gauche : liste des pochettes ─────────────────────────────── */

.lac-hub-covers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    /* Même hauteur que .lac-hub-panel pour que les deux colonnes soient égales */
    height: var(--lac-hub-height, 480px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(199, 182, 41, 0.4) transparent;
    box-sizing: border-box;
}

.lac-hub-covers::-webkit-scrollbar {
    width: 4px;
}
.lac-hub-covers::-webkit-scrollbar-track {
    background: transparent;
}
.lac-hub-covers::-webkit-scrollbar-thumb {
    background: rgba(199, 182, 41, 0.4);
    border-radius: 4px;
}

.lac-hub-cover-btn {
    position: relative;
    display: flex;
    flex-direction: row;      /* image + texte côte à côte dans la colonne */
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: none;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    outline: none;
    width: 100%;
    text-align: left;
    flex-shrink: 0;
}

.lac-hub-cover-btn img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    display: block;
    transition: opacity 0.2s ease;
}

.lac-hub-cover-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: rgba(255,255,255,0.4);
    flex-shrink: 0;
}

.lac-hub-cover-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;             /* permet le text-overflow */
}

.lac-hub-cover-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
    transition: color 0.2s ease;
}

.lac-hub-cover-count {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
}

/* État hover */
.lac-hub-cover-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(3px);
}

.lac-hub-cover-btn:hover .lac-hub-cover-label {
    color: rgba(255, 255, 255, 1);
}

/* État actif */
.lac-hub-cover-btn.active {
    background: rgba(199, 182, 41, 0.08);
    border-color: #C7B629;
    box-shadow: 0 0 0 1px rgba(199, 182, 41, 0.2);
    transform: translateX(3px);
}

.lac-hub-cover-btn.active .lac-hub-cover-label {
    color: #C7B629;
    font-weight: 600;
}

.lac-hub-cover-btn.active .lac-hub-cover-count {
    color: rgba(199, 182, 41, 0.6);
}

/* Focus clavier */
.lac-hub-cover-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}

/* Indicateur ▶ sur la pochette en cours de lecture */
.lac-hub-cover-btn.playing .lac-hub-cover-placeholder,
.lac-hub-cover-btn.playing img {
    box-shadow: 0 0 0 2px #C7B629;
}

.lac-hub-cover-btn.playing::after {
    content: '▶';
    position: absolute;
    top: 4px;
    left: 44px;               /* coin haut-droit de la miniature */
    background: rgba(199, 182, 41, 0.92);
    color: #111;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    animation: lac-hub-pulse 1.5s ease-in-out infinite;
}

@keyframes lac-hub-pulse {
    0%, 100% { transform: scale(1);    opacity: 1; }
    50%       { transform: scale(1.2); opacity: 0.75; }
}

/* ── Colonne droite : panneau playlist ────────────────────────────────── */

.lac-hub-panel {
    position: relative;
    height: var(--lac-hub-height, 480px);
    overflow: hidden;
    border-radius: 16px;
}

.lac-hub-playlist {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transform: translateX(8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.lac-hub-playlist.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.lac-hub-playlist.entering {
    opacity: 0;
    transform: translateX(8px);
    pointer-events: none;
}

/* ── Responsive : retour en colonne sur mobile ────────────────────────── */

@media (max-width: 700px) {
    .lac-hub {
        grid-template-columns: 1fr;
    }

    /* Sur mobile : covers redeviennent une rangée horizontale scrollable */
    .lac-hub-covers {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 10px;
        gap: 8px;
        /* Masquer la barre de scroll native */
        scrollbar-width: none;
    }
    .lac-hub-covers::-webkit-scrollbar { display: none; }

    .lac-hub-cover-btn {
        flex-direction: column;
        align-items: center;
        width: 72px;
        flex-shrink: 0;
        padding: 6px;
        transform: none !important;
    }

    .lac-hub-cover-btn img,
    .lac-hub-cover-placeholder {
        width: 56px;
        height: 56px;
    }

    .lac-hub-cover-btn.playing::after {
        left: auto;
        right: 4px;
        top: 4px;
    }

    .lac-hub-cover-info {
        align-items: center;
    }

    .lac-hub-cover-label {
        font-size: 10px;
        text-align: center;
        max-width: 64px;
    }

    .lac-hub-cover-count {
        display: none;
    }

    .lac-hub-panel {
        height: 520px;
    }

    /* Transition verticale sur mobile */
    .lac-hub-playlist {
        transform: translateY(6px);
    }
    .lac-hub-playlist.entering {
        transform: translateY(6px);
    }
    .lac-hub-playlist.visible {
        transform: translateY(0);
    }
}
