
/* ======================================= */
/* Style du Header Flottant                */
/* ======================================= */

.main-header {
    position: fixed; /* Le secret de l'effet flottant */
    top: 20px; /* La marge par rapport au haut de la page */
    left: 50%;
    transform: translateX(-50%); /* Technique pour centrer parfaitement */
    width: 95%;
    max-width: 1100px; /* Assure la cohérence avec le .container */
    z-index: 999; /* Pour qu'il soit toujours au-dessus du reste */

    /* L'esthétique "Glassmorphism" */
    background-color: rgba(255, 255, 255, 0.7); /* Fond blanc semi-transparent */
    backdrop-filter: blur(10px); /* Le flou de l'arrière-plan */
    -webkit-backdrop-filter: blur(10px); /* Pour la compatibilité avec Safari */

    /* Design épuré */
    border-radius: 12px; /* Les coins arrondis */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07); /* Ombre douce */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Fine bordure pour la finition */
}

/* On ajuste la navigation à l'intérieur du header */
.main-header nav.container {
    width: 100%; /* La nav prend toute la largeur de son parent .main-header */
    display: flex;
    justify-content: space-between; /* Espace le logo et les liens */
    align-items: center;
    padding: 15px 25px; /* Padding interne pour l'aération */
}

.main-header .logo {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--color-text-dark);
}
.main-header nav ul {
    list-style: none;
    display: flex;
    flex-direction: row; /* Aligne les éléments sur une ligne horizontale */
    align-items: center;  /* Centre verticalement les liens dans le header */
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.main-header nav a {
    text-decoration: none;
    color: var(--color-text-medium);
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.main-header nav a:hover {
    color: var(--color-text-dark);
    background-color: rgba(255, 255, 255, 0.5);
}

/* ======================================= */
/* Header et Sidebar (Approche Mobile-First) */
/* ======================================= */

/* --- Styles de base du header --- */
.main-header {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 20px);
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.main-header nav.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
}

.logo {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.2rem;
    text-decoration: none;
    color: var(--color-text-dark);
    z-index: 1001; /* Pour être au-dessus du menu mobile */
}

/* --- Styles pour Mobile (par défaut) --- */

/* Bouton Hamburger */
.nav-toggle-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--color-text-dark);
    cursor: pointer;
    z-index: 1001;
}

/* Conteneur de la navigation (la future sidebar) */
.nav-wrapper {
    position: fixed;
    top: 0;
    right: -20px;
    width: 80%;
    height: 100vh;
    background-color: #fff;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(100%); /* Caché par défaut */
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 2000; /* Au-dessus de tout */
    padding-top: 80px;
    display: flex;
    flex-direction: column;
}

/* Liste des liens */
.main-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-nav a {
    display: block;
    padding: 15px 30px;
    text-decoration: none;
    color: var(--color-text-dark);
    font-size: 1.2rem;
    font-weight: 600;
    transition: background-color 0.2s;
}
.main-nav a:hover {
    background-color: var(--color-background-light);
}

/* Bouton de fermeture */
.nav-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: var(--color-text-medium);
    cursor: pointer;
}

/* Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1999; /* Juste en dessous de la sidebar */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}

/* --- Classe 'is-open' pour activer la sidebar --- */
body.sidebar-is-open .nav-wrapper {
    transform: translateX(0);
    z-index: 10000;
    border-radius: 10px;
}
body.sidebar-is-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* --- Styles pour Ordinateur (écrans > 768px) --- */
@media (min-width: 769px) {
    .main-header {
        top: 20px;
        width: 95%;
        max-width: 1100px;
    }
    .main-header nav.container {
        padding: 15px 25px;
    }
    .logo {
        font-size: 1.5rem;
    }
    
    /* On cache les boutons mobile */
    .nav-toggle-btn, .nav-close-btn {
        display: none;
    }

    /* On réinitialise complètement le style de la sidebar pour le menu horizontal */
    .nav-wrapper {
        position: static;
        width: auto;
        height: auto;
        background-color: transparent;
        box-shadow: none;
        transform: none;
        transition: none;
        padding-top: 0;
    }
    .main-nav {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 1.5rem;
    }
    .main-nav a {
        padding: 5px 10px;
        color: var(--color-text-medium);
        font-size: 1rem;
        font-weight: 500;
        border-radius: 8px;
    }
    .main-nav a:hover {
        color: var(--color-text-dark);
        background-color: rgba(255, 255, 255, 0.5);
    }
}




/* ======================================= */
/* Adaptation Mobile (Responsive)          */
/* ======================================= */

@media (max-width: 768px) {
    main{
        padding-top: 20px;
    }
    .main-header {
        top: 10px; /* On réduit la marge en haut */
        width: calc(100% - 20px); /* Le header prend presque toute la largeur */
    }

    .main-header nav.container {
        padding: 10px 15px;
    }

    /* Sur mobile, il faudrait idéalement un menu "hamburger" */
    /* Pour l'instant, on réduit la taille et l'espacement pour que ça tienne */
    .main-header nav ul {
        gap: 0.5rem;
        flex-direction: column;
        align-items: flex-start;
    }
    .main-header nav a {
        font-size: 0.9rem;
    }
    .main-header .logo {
        font-size: 1.2rem;
    }
/* Conteneur de la navigation (la future sidebar) */
    .nav-wrapper {
        max-width: 320px;
    }
}
