/* =========================================
   1. RÉINITIALISATION ET STYLES DE BASE
   ========================================= */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}

html { scroll-behavior: smooth; }

body { 
    background-color: #F9F9F9; 
    color: #2C3E50; 
    line-height: 1.6; 
}

/* =========================================
   2. EN-TÊTE (HEADER)
   ========================================= */
header { 
    background-color: #ffffff; 
    text-align: center; 
    padding: 30px 20px; 
    border-bottom: 3px solid #E67E22; 
}

.logo-container h1 { color: #2C3E50; font-size: 2.2em; margin-top: 10px; letter-spacing: 1px; }
.logo-container p { color: #7F8C8D; font-weight: bold; letter-spacing: 3px; margin-top: 5px; }

/* =========================================
   3. BARRE DE NAVIGATION
   ========================================= */
nav { 
    background-color: #E67E22; 
    display: flex; 
    justify-content: center; 
    align-items: center;
    flex-wrap: wrap; 
    padding: 10px 20px; 
    position: sticky; 
    top: 0; 
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Conteneur invisible sur ordinateur, utilisé pour mobile */
.nav-mobile-header {
    display: none;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

/* Liens de navigation */
.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

nav a { 
    color: white; 
    text-decoration: none; 
    margin: 5px 12px; 
    font-weight: bold; 
    transition: color 0.3s ease; 
}
nav a:hover { color: #F1C40F; }

/* Bouton postuler (Ordinateur) */
.btn-postuler-nav { 
    background-color: #F1C40F; 
    color: #2C3E50 !important; 
    padding: 8px 20px; 
    border-radius: 5px; 
    font-weight: bold; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
    
    /* CORRECTION POUR QUE LE TEXTE NE SE COUPE PAS */
    white-space: nowrap; 
    display: inline-block; 
}
.btn-postuler-nav:hover { transform: scale(1.05); }

/* Le bouton postuler version mobile (caché sur PC) */
.btn-postuler-mobile {
    display: none;
    background-color: #F1C40F;
    color: #2C3E50 !important;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
}


/* =========================================
   AFFICHAGE MOBILE (Téléphones)
   ========================================= */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
    }

    /* On affiche la barre avec Menu à gauche et Postuler à droite */
    .nav-mobile-header {
        display: flex; 
    }

    .menu-toggle {
        color: white;
        font-size: 1.2em;
        font-weight: bold;
        cursor: pointer;
        padding: 5px;
    }

    /* On affiche le bouton jaune à droite sur mobile */
    .btn-postuler-mobile {
        display: inline-block;
    }

    /* On cache les liens par défaut */
    .nav-links {
        display: none; 
        flex-direction: column;
        text-align: center;
        width: 100%;
        margin-top: 10px;
    }
    
    /* Quand on clique sur le menu, ça s'affiche */
    .nav-links.active {
        display: flex; 
    }
    
    .nav-links a {
        padding: 10px 0;
        border-bottom: 1px solid rgba(255,255,255,0.2);
        margin: 0;
        width: 100%;
    }

    /* On cache le bouton "Postuler Maintenant" du menu déroulant sur mobile (car on a déjà le bouton à droite) */
    .btn-postuler-nav {
        display: none;
    }
}

/* =========================================
   4. LOGO CENTRAL
   ========================================= */
.logo-central { text-align: center; margin-top: 40px; margin-bottom: 20px; }
.logo-central img { width: 250px; max-width: 80%; height: auto; filter: drop-shadow(0px 10px 15px rgba(0,0,0,0.15)); }

/* =========================================
   5. SECTION OFFRES D'EMPLOI
   ========================================= */
.section-offres { max-width: 900px; margin: 30px auto; padding: 0 20px; }
.section-offres h2 { color: #E67E22; text-align: center; margin-bottom: 20px; }
.liste-offres { display: flex; flex-direction: column; gap: 15px; }

.carte-offre {
    background: white;
    border-left: 5px solid #F1C40F;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.numero-offre { background-color: #E67E22; color: white; padding: 3px 8px; border-radius: 4px; font-size: 0.8em; font-weight: bold; }
.info-offre h3 { color: #2C3E50; margin: 10px 0 5px 0; }
.info-offre p { color: #7F8C8D; font-size: 0.9em; }
.btn-voir-pdf { background-color: #E67E22; color: white; text-decoration: none; padding: 10px 20px; border-radius: 5px; font-weight: bold; margin-top: 10px; transition: background-color 0.3s; }
.btn-voir-pdf:hover { background-color: #D35400; }

@media (max-width: 600px) {
    .carte-offre { flex-direction: column; align-items: flex-start; }
    .btn-voir-pdf { width: 100%; text-align: center; margin-top: 15px; }
}

/* =========================================
   6. CONTENEUR PRINCIPAL & SECTIONS DÉROULANTES
   ========================================= */
main { max-width: 900px; margin: 20px auto 40px auto; padding: 0 20px; }

details {
    background: white;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    overflow: hidden; 
    border-left: 4px solid #E67E22; 
}

summary { background-color: #ffffff; color: #2C3E50; padding: 20px; font-size: 1.2em; font-weight: bold; cursor: pointer; list-style: none; position: relative; transition: all 0.3s ease; }
summary:hover { background-color: #F9F9F9; }
summary::after { content: '+'; position: absolute; right: 20px; font-size: 1.5em; color: #E67E22; transition: transform 0.3s ease; }
details[open] summary::after { content: '-'; transform: rotate(180deg); }
details[open] summary { background-color: #FDF2E9; border-bottom: 1px solid #F5CBA7; }

.contenu-details { padding: 20px; background-color: #ffffff; animation: fadeIn 0.4s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.contenu-details p { margin-bottom: 10px; }
.contenu-details ul { margin-left: 20px; margin-top: 10px; }
.contenu-details li { margin-bottom: 8px; }

/* =========================================
   7. ESPACE CANDIDATS
   ========================================= */
.section-candidats { background-color: #ffffff; padding: 30px; border-radius: 8px; margin-top: 40px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); border: 1px solid #eee; }
.section-candidats h2 { color: #E67E22; text-align: center; margin-bottom: 20px; }
.compteur-box { background-color: #F1C40F; text-align: center; padding: 20px; border-radius: 8px; margin-bottom: 30px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.chiffre-compteur { font-size: 2.5em; font-weight: bold; color: #2C3E50; }
.compteur-box p { font-size: 1.2em; color: #2C3E50; font-weight: bold; }
.sous-titre-compteur { font-size: 0.9em !important; font-weight: normal !important; color: #555 !important; }
.titre-tableau { font-weight: bold; color: #E67E22; margin-bottom: 10px; }
.tableau-candidats { width: 100%; border-collapse: collapse; margin-top: 10px; }
.tableau-candidats th, .tableau-candidats td { border: 1px solid #ddd; padding: 12px; text-align: left; }
.tableau-candidats th { background-color: #E67E22; color: white; font-weight: bold; }
.tableau-candidats tr:nth-child(even) { background-color: #F9F9F9; }
.tableau-candidats tr:hover { background-color: #FDF2E9; }

/* =========================================
   8. FORMULAIRE DE CANDIDATURE (SÉPARÉ)
   ========================================= */
.section-postuler { background-color: #FDF2E9; border: 2px dashed #E67E22; padding: 30px; border-radius: 8px; margin-top: 40px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.section-postuler h2 { color: #E67E22; margin-bottom: 10px; text-align: center; font-size: 1.6em; }

.bloc-fichiers, .bloc-formulaire { background: #ffffff; padding: 20px; border-radius: 8px; margin-top: 15px; border: 1px solid #eee; }
.bloc-fichiers h3, .bloc-formulaire h3 { color: #2C3E50; margin-bottom: 5px; }
.texte-aide { font-size: 0.9em; color: #7F8C8D; margin-bottom: 15px; text-align: left; }
.separateur { border: 0; height: 2px; background: #E67E22; margin: 30px 0; opacity: 0.3; }

.bloc-fichiers input[type="file"] { padding: 10px; border: 1px solid #ccc; border-radius: 4px; width: 100%; margin-top: 5px; background: #F9F9F9; }
.btn-mail { background-color: #F1C40F; color: #2C3E50; border: none; padding: 12px; border-radius: 5px; font-size: 1em; font-weight: bold; cursor: pointer; width: 100%; margin-top: 20px; transition: all 0.3s; }
.btn-mail:hover { background-color: #F39C12; }

.bloc-formulaire form { display: flex; flex-direction: column; text-align: left; }
.bloc-formulaire label { margin-top: 15px; font-weight: bold; color: #2C3E50; font-size: 0.95em; }
.bloc-formulaire input { padding: 12px; margin-top: 5px; border: 1px solid #ccc; border-radius: 4px; font-size: 1em; background-color: #ffffff; transition: border-color 0.3s ease; }
.bloc-formulaire input:focus { outline: none; border-color: #E67E22; box-shadow: 0 0 5px rgba(230, 126, 34, 0.3); }
.bloc-formulaire button { margin-top: 25px; background-color: #E67E22; color: white; padding: 15px; border: none; border-radius: 5px; font-size: 1.1em; font-weight: bold; cursor: pointer; transition: background-color 0.3s, transform 0.2s; }
.bloc-formulaire button:hover { background-color: #D35400; transform: translateY(-2px); }

/* MESSAGE D'ERREUR */
.message-erreur {
    display: none; 
    background-color: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
}

/* =========================================
   9. PIED DE PAGE (FOOTER)
   ========================================= */
footer { text-align: center; padding: 20px; background-color: #2C3E50; color: white; margin-top: 50px; font-size: 0.9em; }