:root {
    --primary: #2e7d32;
    --primary-hover: #1b5e20;
    --primary-light: #e8f5e9;
    --accent: #ed8936;
    --accent-hover: #dd6b20;
    --dark: #1a202c;
    --dark-surface: #2d3748;
    --light: #f8fafc;
    --border: #e2e8f0;
    --text-main: #2d3748;
    --text-muted: #718096;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --radius: 12px;
    --radius-sm: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.02), 0 10px 15px -3px rgba(0,0,0,0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.06), 0 10px 10px -5px rgba(0,0,0,0.04);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    background: var(--light); 
    color: var(--text-main); 
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
}

header { 
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow); 
    position: sticky; 
    top: 0; 
    z-index: 999; 
    border-bottom: 1px solid var(--border);
}

header.admin-header {
    background: var(--dark);
    color: white;
}

.nav-container { 
    max-width: 1200px; 
    margin: 0 auto; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 15px 20px; 
}

.nav-brand-title {
    font-weight: 700; 
    font-size: 18px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.nav-user-meta {
    display: flex; 
    align-items: center; 
    gap: 20px;
}

.nav-logout-btn {
    color: #fc8181; 
    font-weight: 600; 
    text-decoration: none;
    transition: var(--transition);
}

.logo img { 
    height: 50px; 
    object-fit: contain; 
}

.nav-links { 
    display: flex; 
    gap: 25px; 
    list-style: none; 
    align-items: center; 
}

.nav-links a { 
    text-decoration: none; 
    color: var(--text-main); 
    font-weight: 500; 
    font-size: 0.95rem;
}

.btn-header { 
    background: var(--primary); 
    color: white !important; 
    padding: 10px 20px; 
    border-radius: 30px; 
    font-weight: 600 !important;
}

/* --- SECTION HERO AMÉLIORÉE : ARRIÈRE-PLAN ANIMÉ DE COULEURS FLUIDES --- */
.hero { 
    width: 100%;
    /* Dégradé de 4 couleurs (Noir adouci, Anthracite et Vert CPEEDI très sombre pour l'harmonie) */
    background: linear-gradient(-45deg, #1e1e1e, #121212, #142416, #1c1a1a);
    background-size: 400% 400%; /* Permet aux couleurs de voyager */
    animation: fondAnime 15s ease infinite; /* Animation douce infinie */
    padding: 80px 0; 
    border-bottom: 1px solid #2d2d2d;
    position: relative;
    overflow: hidden;
}

/* Script de l'animation de translation du dégradé de fond */
@keyframes fondAnime {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-internal-box { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
    position: relative;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    min-height: 300px; 
    z-index: 2; /* S'assure que le contenu reste bien au-dessus du fond animé */
}

.slide-item { 
    width: 100%;
    max-width: 900px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    padding: 25px;
}

.slide-text { 
    animation: fadeSlider 10s infinite ease-in-out;
    animation-delay: 0s;
}

.slide-logo { 
    animation: fadeSlider 10s infinite ease-in-out;
    animation-delay: 5s;
}

.slide-text h1 { 
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2.8rem; 
    color: #ffffff; 
    font-weight: 700; 
    line-height: 1.3; 
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5); /* Ombre portée pour détacher le texte du fond mouvant */
}

.text-accent { color: var(--accent); }

.slide-text p { 
    color: #cccccc; 
    font-size: 1.2rem; 
    max-width: 750px;
    margin: 0 auto;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.slide-logo img { 
    max-height: 180px; 
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4)); /* Met en valeur l'emblème */
}

@keyframes fadeSlider {
    0%, 5% { opacity: 0; visibility: hidden; }
    10%, 45% { opacity: 1; visibility: visible; }
    50%, 95% { opacity: 0; visibility: hidden; }
    100% { opacity: 0; visibility: hidden; }
}
/* --------------------------------------------------------- */

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 60px 20px; 
}

.section-title { 
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2.25rem; 
    margin-bottom: 40px; 
    text-align: center; 
    color: var(--dark);
}

.grid-publications { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); 
    gap: 30px; 
}

.pub-card { 
    background: white; 
    border-radius: var(--radius); 
    overflow: hidden; 
    box-shadow: var(--shadow); 
    border: 1px solid var(--border); 
    display: flex; 
    flex-direction: column; 
}

.pub-media { 
    position: relative;
    width: 100%;
    height: 220px; 
    background: #edf2f7; 
    overflow: hidden; 
}

.pub-media img, .pub-media video { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.pub-content { 
    padding: 25px; 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
}

.pub-title { 
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.35rem; 
    margin-bottom: 15px; 
    color: var(--dark); 
}

.pub-text {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.05rem;
    color: #2d3748;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: justify; 
}

.text-short { display: block; }
.text-full { display: none; }

.toggle-text-btn { 
    background: none; 
    border: none; 
    color: var(--primary); 
    font-weight: 600; 
    cursor: pointer; 
    margin-bottom: 15px;
    font-family: 'Inter', sans-serif;
}

.pub-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #edf2f7;
}

.pub-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.share-container {
    position: relative;
    display: inline-block;
}

.btn-share-trigger {
    background: #edf2f7;
    border: none;
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-share-trigger:hover {
    background: #e2e8f0;
}

.share-dropdown {
    position: absolute;
    bottom: 45px;
    right: 0;
    background: white;
    padding: 8px;
    border-radius: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 10;
    border: 1px solid var(--border);
}

.share-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.share-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white !important;
    text-decoration: none;
    transition: transform 0.2s;
}

.share-btn:hover {
    transform: scale(1.1);
}

.share-fb { background: #1877f2; }
.share-wa { background: #25d366; }
.share-x { background: #000000; }
.share-in { background: #0077b5; }
.share-tg { background: #229ed9; }

.form-card { 
    background: white; 
    padding: 35px; 
    border-radius: var(--radius); 
    box-shadow: var(--shadow); 
    border: 1px solid var(--border); 
    max-width: 550px; 
    margin: 0 auto; 
}

.form-title-center {
    color: var(--primary); 
    text-align: center; 
    margin-bottom: 25px;
}

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.form-control { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    background: #f8fafc; 
}

.btn-block { 
    width: 100%; 
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 12px; 
    border-radius: 8px; 
    font-weight: 600; 
    cursor: pointer; 
}

.btn-outline { 
    display: block; 
    text-align: center; 
    width: 100%; 
    background: transparent; 
    color: #4e73df; 
    padding: 10px; 
    border: 1px solid #4e73df; 
    border-radius: var(--radius-sm); 
    font-weight: 600; 
    margin-top: 15px; 
    text-decoration: none; 
}

.auth-wrapper {
    background: #f4f6f9; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    min-height: 100vh;
}
.auth-card {
    background: white; 
    padding: 35px; 
    border-radius: var(--radius); 
    width: 100%; 
    max-width: 400px; 
    box-shadow: var(--shadow-lg); 
    border: 1px solid var(--border);
}
.auth-logo-area { text-align: center; margin-bottom: 20px; }
.auth-logo-area img { max-height: 80px; }
.auth-title { text-align: center; margin-bottom: 20px; color: var(--text-main); font-size: 22px; }
.alert-box { display: block; padding: 10px; background: var(--danger-light); color: var(--danger); border-radius: var(--radius-sm); text-align: center; margin-bottom: 15px; }

.admin-layout { 
    display: grid; 
    grid-template-columns: 1fr 2fr; 
    gap: 30px; 
    max-width: 1400px; 
    margin: 30px auto; 
    padding: 0 20px; 
}

.table-wrapper { max-width: 100%; overflow-x: auto; }
.table-title { margin-bottom: 25px; }

table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 15px; 
    background: white;
}
th, td { padding: 14px; border: 1px solid var(--border); text-align: left; }
th { background: #f8fafc; font-weight: 600; }

.badge-type-demande { background: var(--primary-light); color: var(--primary); padding: 4px 8px; border-radius: 4px; font-weight: 700; font-size: 11px; }
.td-message-paragraph { font-size: 13px; max-width: 250px; word-wrap: break-word; }

.modal { display: none; position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); align-items: center; justify-content: center; }
.modal-content { background: white; padding: 30px; border-radius: 12px; max-width: 400px; width: 90%; text-align: center; }

footer { 
    background: var(--dark); 
    color: #a0aec0; 
    padding: 40px 20px; 
    margin-top: 60px; 
    border-top: 4px solid var(--primary);
}
.footer-container { 
    max-width: 1200px; 
    margin: 0 auto; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 20px; 
}
.footer-credits a { color: var(--accent); text-decoration: none; font-weight: 600; }
.footer-socials { display: flex; gap: 20px; }
.footer-socials a { color: #718096; font-size: 1.3rem; }

@media (max-width: 1024px) { 
    .admin-layout { grid-template-columns: 1fr; } 
    .hero-internal-box { min-height: 220px; }
    .slide-text h1 { font-size: 2.2rem; }
}

@media (max-width: 768px) {
    .nav-container { flex-direction: column; gap: 15px; text-align: center; }
    .nav-links { gap: 15px; flex-wrap: wrap; justify-content: center; }
    .hero-internal-box { min-height: 260px; }
    .slide-text h1 { font-size: 1.75rem; }
    .slide-logo img { max-height: 100px; }
    .grid-publications { grid-template-columns: 1fr; }
    .footer-container { flex-direction: column; text-align: center; }
}

/* ================================================================= */
/* STYLISATION DU PIED DE PAGE (FOOTER PROFESSIONNEL COORDONNÉ)     */
/* ================================================================= */

footer {
    background-color: #111827; /* Fond sombre moderne */
    color: #9ca3af;            /* Texte gris clair discret */
    padding: 60px 0 30px 0;
    margin-top: 60px;
    border-top: 4px solid #2e7d32; /* Rappel de la couleur principale */
    font-family: 'Inter', sans-serif;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Grille principale : Disposition automatique en 3 colonnes */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

/* Styles communs pour les titres des colonnes */
.footer-grid h3 {
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 8px;
}

/* Ligne décorative discrète sous les titres du footer */
.footer-grid h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 3px;
    background-color: #ed8936; /* Rappel de votre couleur d'accent */
    border-radius: 2px;
}

/* Colonne 1 : À propos */
.footer-col-about p {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Colonne 2 : Liens de navigation */
.footer-col-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col-links li {
    margin-bottom: 12px;
}

.footer-col-links a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.footer-col-links a:hover {
    color: #ffffff;
    transform: translateX(4px); /* Léger effet dynamique au survol */
}

/* Colonne 3 : Contacts */
.footer-col-contact p {
    margin-bottom: 14px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-col-contact i {
    color: #ed8936; /* Icônes en couleur d'accent */
    width: 16px;
    text-align: center;
}

.footer-col-contact a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-col-contact a:hover {
    color: #ffffff;
}

/* Séparateur horizontal */
.footer-divider {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 30px 0;
}

/* Ligne du bas : Droits, Crédits et Réseaux */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 0.88rem;
}

.footer-credits a {
    color: #ed8936;
    text-decoration: none;
    font-weight: 600;
}

.footer-credits a:hover {
    text-decoration: underline;
}

/* Zone des réseaux sociaux */
.footer-socials {
    display: flex;
    gap: 15px;
}

.footer-socials a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.footer-socials a:hover {
    background: #2e7d32; /* Fond vert au survol */
    transform: translateY(-3px);
}

/* Ajustements pour écrans mobiles (Smartphones) - Version Centrée */
@media (max-width: 768px) {
    footer {
        padding: 40px 0 20px 0;
    }
    
    .footer-grid {
        gap: 40px;
        text-align: center; /* Centre le texte des colonnes */
    }
    
    /* Centre la petite ligne décorative colorée sous les titres */
    .footer-grid h3::after {
        left: 50%;
        transform: translateX(-50%);
    }

    /* Aligne parfaitement les icônes de contact avec le texte au centre */
    .footer-col-contact p {
        justify-content: center;
    }

    /* Centre la zone du bas (droits, crédits, réseaux sociaux) */
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-socials {
        justify-content: center;
    }
}