/* --- GLOBAL : Body, Header, Nav Mobile, Dark Mode Base --- */

/* Body & Layout */
body {
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 80px; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0faf0;
    color: #1a3d1a; 
}

/* Header */
#mainHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #a5d6a7;
}

#mainHeader .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1b5e20;
    text-decoration: none;
}

/* Menu Header (Caché sur mobile par défaut) */
#mainHeader .header-nav { display: none; }

#mainHeader .header-nav a {
    color: #2e7d32;
    text-decoration: none;
    font-weight: 500;
}
#mainHeader .header-nav a:hover { text-decoration: underline; }

#mainHeader .header-right {
    display: flex;
    align-items: center;
    gap: 10px; 
}

#mainHeader #userNameHeader {
    color: #1a3d1a;
    font-weight: 600;
    font-size: 0.9rem; 
    display: none; 
}
@media (min-width: 400px) {
    #mainHeader #userNameHeader { display: inline; }
}

/* Boutons Header (Login/Logout) */
#mainHeader .btn-login, #mainHeader .btn-logout {
    padding: 5px 12px; border-radius: 6px; text-decoration: none;
    font-weight: 600; font-size: 13px; white-space: nowrap;
    display: inline-flex; align-items: center; line-height: 1; border: 1px solid transparent; 
}
#mainHeader .btn-login { color: white; border: 1px solid #2e7d32; background: #2e7d32; }
#mainHeader .btn-logout { color: #c62828; border: 1px solid #c62828; }

/* Selecteur de Langue */
.lang-select {
    appearance: none; -webkit-appearance: none;
    padding: 5px 30px 5px 12px; margin: 0; width: auto;
    border: 1px solid #2e7d32; border-radius: 6px; background-color: white;
    font-size: 13px; font-weight: 600; color: #1a3d1a; cursor: pointer; line-height: 1;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%232e7d32" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
    background-repeat: no-repeat; background-position: right 6px center; background-size: 14px;
}

/* Navigation Mobile (Bas) - Visible par défaut sur mobile */
.mobile-bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 60px;
    background-color: #ffffff; display: flex; justify-content: space-around;
    align-items: center; box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000; border-top: 1px solid #eee;
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-decoration: none; color: #757575; font-size: 0.75rem; width: 25%; height: 100%;
}
.nav-item i { font-size: 1.2rem; margin-bottom: 4px; }
.nav-item.active { color: #2e7d32; font-weight: 700; }
.nav-item:active { background-color: #f5f5f5; }

/* Dark Mode Global */
body.darkmode { background-color: #1a1a1a; color: #e0e0e0; }
body.darkmode .mobile-bottom-nav { background-color: #2d2d2d; border-top-color: #444; }
body.darkmode .nav-item { color: #aaa; }
body.darkmode .nav-item.active { color: #81c784; }
body.darkmode .lang-select {
    background-color: #333; color: #e0e0e0; border-color: #81c784; background-repeat: no-repeat;
    background-position: right 5px center;
    background-size: 14px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%2381c784" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
}

/* --- MODAL DE CONFIRMATION (Style Générique) --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); 
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-box {
    background: white;
    padding: 25px;
    border-radius: 15px;
    width: 85%;
    max-width: 350px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-box h3 { margin-top: 0; color: #2e7d32; }
.modal-box p { color: #555; margin-bottom: 20px; }

.modal-buttons {
    display: flex;
    gap: 15px; /* Espace entre les boutons */
    justify-content: center;
}

/* Bouton Annuler (Gris) */
.btn-modal-cancel {
    background: #e0e0e0;
    color: #333;
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-modal-cancel:hover { background: #d5d5d5; }

/* Bouton Confirmer (Rouge pour la déconnexion) */
.btn-modal-confirm {
    background: #c62828;
    color: white;
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-modal-confirm:hover { background: #b71c1c; }

/* Dark Mode Modal */
body.darkmode .modal-box { background: #2d2d2d; }
body.darkmode .modal-box h3 { color: #81c784; }
body.darkmode .modal-box p { color: #ddd; }
body.darkmode .btn-modal-cancel { background: #444; color: #fff; }
body.darkmode .btn-modal-cancel:hover { background: #555; }



/* GESTION RESPONSIVE (MOBILE vs PC) */


@media (min-width: 768px) {
    /* 1. On AFFICHE le menu du haut */
    #mainHeader .header-nav { 
        display: flex !important; 
        gap: 20px; 
    }

    /* 2. On CACHE la barre du bas */
    .mobile-bottom-nav {
        display: none !important;
    }

    /* 3. On ajuste le padding du body pour ne pas avoir de vide en bas */
    body {
        padding-bottom: 20px !important;
    }
}