/* ============================================================
   MOBILE NAVBAR — 3-LAYER COMPACT REDESIGN
   À ajouter à la fin de base.css (ou inclure séparément).

   Sur desktop : .mob-controls-row et .mob-waveform-row
   sont masqués, rien ne change.

   Sur mobile (≤768px) : la navbar devient une barre fixée
   en bas, structurée en 3 couches empilées :
     [1] mob-controls-row  — contrôles audio compacts
     [2] mob-waveform-row  — waveform
     [3] navLinks          — liens de navigation
   ============================================================ */


/* ── DESKTOP : masquer les éléments mobile-only ── */
.mob-controls-row,
.mob-waveform-row {
    display: none;
}


/* ── MOBILE ── */
@media screen and (max-width: 768px) {

    /* Conteneur principal */
    .navBar {
        flex-direction: column;
        position: fixed;
        bottom: 0;
        left: 0;
        top: auto;
        width: 100%;
        height: auto;
        border-radius: 0;
        padding: 0;
        margin: 0;
        z-index: 1000;
        overflow: visible;
        justify-content: flex-end;
    }

    .navBar::before {
        border-radius: 10px 10px 0 0;
        inset: 0;
    }

    /* Masquer les blocs desktop dans la navbar */
    .navBar > .mainTrackInfo,
    .navBar > .mainControlBar {
        display: none !important;
    }

    /* Masquer expandButton et mobileExpandableContent */
    .expandButton,
    .mobileExpandableContent {
        display: none !important;
    }

    /* ── LAYER 1 (haut) : contrôles audio ── */
    .mob-controls-row {
        display: flex;
        width: 100%;
        order: 1;
        z-index: 2;
    }

    .mob-controls-row .mainControlBar {
        width: 100%;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 10px;
        box-sizing: border-box;
    }

    .mob-controls-row .controlButtons {
        position: static;
        display: flex;
        align-items: center;
        gap: 8px;
        width: auto;
    }

    .mob-controls-row .controlIcon {
        width: 16px;
        height: 16px;
    }

    .mob-controls-row .navFavoriteButton {
        position: static;
        background: transparent;
        border: none;
        padding: 0;
        cursor: pointer;
    }

    .mob-controls-row .navFavoriteIcon {
        width: 16px;
        height: 16px;
    }

    .mob-controls-row .mainTrackCover {
        position: static;
        width: 24px;
        height: 24px;
        border-radius: 3px;
        padding: 0;
    }

    .mob-controls-row .timeCode {
        display: flex !important;
        font-size: 0.6em;
        white-space: nowrap;
    }

    .mob-controls-row .mainVolumeSlider {
        display: block !important;
        width: 50px !important;
        -webkit-appearance: none;
        appearance: none;
        height: 3px;
        background: rgba(255, 255, 255, 0.4);
        border-radius: 3px;
        outline: none;
        cursor: pointer;
    }

    .mob-controls-row .mainVolumeSlider::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 10px;
        height: 10px;
        background: white;
        border-radius: 50%;
    }

    .mob-controls-row .mainVolumeSlider::-moz-range-thumb {
        width: 10px;
        height: 10px;
        background: white;
        border-radius: 50%;
        border: none;
    }

    .mob-controls-row .titleBox {
        display: flex !important;
        flex: 1;
        min-width: 0;
        max-width: 100px;
        overflow: hidden;
        font-size: 0.65em;
    }

    /* ── LAYER 2 : waveform ── */
    .mob-waveform-row {
        display: flex;
        width: 100%;
        height: 28px;
        align-items: center;
        order: 2;
        z-index: 2;
    }

    .mob-waveform-row .mainWaveform {
        width: 100%;
        height: 28px !important;
        min-height: 28px;
    }

    /* ── LAYER 3 (bas) : liens de navigation ── */
    .navLinks {
        width: 100%;
        height: auto;
        display: flex;
        align-items: center;
        justify-content: space-around;
        padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
        background: transparent;
        backdrop-filter: none;
        order: 3;
        z-index: 2;
        /* Annuler les règles précédentes qui ajoutaient du padding-top excessif */
        padding-top: 6px !important;
    }

    .navLinks .nav-link {
        font-size: 0.8em;
        padding: 4px 6px;
    }

    .navLinks .icon {
        width: 18px;
        height: 18px;
    }

    .navLinks .profile-pic {
        width: 22px;
        height: 22px;
    }

    /* Espace pour le contenu sous la navbar (~100px) */
    #content {
        padding-top: 0 !important;
        padding-bottom: calc(100px + env(safe-area-inset-bottom)) !important;
    }

    /* Dropdowns s'ouvrent vers le haut */
    .navBar .nav-dropdown-content {
        bottom: 100% !important;
        top: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin-bottom: 6px !important;
    }

    /* switch desktop/mobile */
    .switch1 { display: none !important; }
    .switch2 { display: block !important; }
}
