/* common-layout.css - Source unique de vérité pour Header & Footer */

/* ======================================== */
/* VARIABLES DE RÉFÉRENCE                   */
/* ======================================== */
:root {
    --common-header-height: 64px;
    --common-sidebar-width: 260px;
    --common-spacing-md: 1rem;
    --common-spacing-xl: 2rem;
}

/* ======================================== */
/* HEADER PARTAGÉ                           */
/* ======================================== */
.header {
    background-color: #1a1a1a !important;
    border-bottom: 1px solid #333 !important;
    padding: var(--common-spacing-md) var(--common-spacing-xl) !important;
    height: var(--common-header-height) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: 100% !important;
    box-sizing: border-box !important;
    z-index: 1000 !important;
    position: sticky !important;
    top: 0 !important;
}

.header-nav {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: var(--common-spacing-xl) !important;
    height: 100% !important;
    width: 100% !important;
}

.header-nav .nav-item, 
.header-nav a {
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 1.2rem !important;
    font-weight: 400 !important;
    transition: color 0.3s ease !important;
    background-color: transparent !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 !important;
}

.header-nav .nav-item:hover,
.header-nav a:hover {
    color: #1a73e8 !important;
}

/* ======================================== */
/* FOOTER PARTAGÉ                           */
/* ======================================== */
.footer {
    background-color: #1a1a1a !important;
    padding: var(--common-spacing-md) var(--common-spacing-xl) !important;
    
    /* Le footer est dans .main-content. Pour qu'il occupe toute la largeur (sidebar incluse), */
    /* on le décale à gauche de la largeur de la sidebar et on augmente sa taille. */
    margin-left: calc(-1 * var(--common-sidebar-width)) !important;
    width: calc(100% + var(--common-sidebar-width)) !important;
    box-sizing: border-box !important;
    
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 60px !important;
    z-index: 10 !important;

    /* COMPENSATEUR DE CENTRAGE : */
    /* Comme le footer commence à x=0 (bord gauche écran), justify-content: center le centrerait */
    /* par rapport à l'écran. Pour le centrer par rapport à la zone de droite (.main-content), */
    /* on ajoute un padding-left égal à la sidebar. */
    padding-left: var(--common-sidebar-width) !important;
}

.footer p {
    color: #ffffff !important;
    text-align: center !important;
    font-size: 0.9rem !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Responsivité Mobile */
@media (max-width: 1024px) {
    .header {
        height: auto !important;
        padding: 0.5rem 1rem !important;
    }
    
    .header-nav {
        gap: 1rem !important;
    }

    .footer {
        /* Sur mobile, la sidebar disparaît (display: none), le layout devient 1 colonne. */
        /* On annule donc tous les décalages liés à la sidebar. */
        margin-left: 0 !important;
        width: 100% !important;
        padding-left: var(--common-spacing-xl) !important; /* Retour au padding normal */
    }
}
