/* --- 1. Variables et Reset de Base --- */
:root {
    --primary-color: #007bff; /* Bleu v vif pour les boutons/accents */
    --secondary-color: #0c1a3b; /* Bleu très foncé/nuit du logo */
    --accent-color: #ffffff; /* Blanc pour le texte principal */
    --dark-text: #333;
    --light-bg: #f4f4f4; /* Fond clair pour certaines sections */
    --font-family: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    background-color: var(--light-bg);
    color: var(--dark-text);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    font-weight: 700;
    margin-bottom: 10px;
}

p {
    margin-bottom: 20px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

/* --- 2. Header / Navigation --- */
header {
    background-color: var(--secondary-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 180px; 
    width: auto;
    /* La position est CRUCIALE pour le positionnement dynamique */
    position: absolute; 
    top: 0px; 
    left: 50px; 
    
    /* La position de départ de l'image (légèrement tirée vers le haut) */
    transform: translateY(-10%); 
    
    z-index: 1001; 
    border-radius: 20px;
    
    /* Le reste du style... */
    filter: drop-shadow(0px 0px 10px rgba(255, 255, 255, 0.3)) 
             drop-shadow(0px 0px 20px rgba(255, 255, 0, 0.3)); 
    
    transition: transform 0.5s ease-in-out; 
}

/* Règle pour l'effet de survol */
.logo:hover img {
    transform: translateY(-55%); 
}

/* Ajustez le padding du header pour ne pas que le logo ne gêne le contenu */
header .nav-content {
    padding-left: 100px; 
}

nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    color: var(--accent-color);
    font-weight: 600;
    transition: color 0.3s;
    padding-bottom: 5px; 
}

nav ul li a:hover {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

/* --- 3. Boutons --- */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    transition: background-color 0.3s, color 0.3s;
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--accent-color);
    border: 2px solid var(--primary-color);
}

.primary-btn:hover {
    background-color: #0056b3; 
    border-color: #0056b3;
}

.secondary-btn {
    background-color: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.secondary-btn:hover {
    background-color: var(--secondary-color);
    color: var(--accent-color);
}

/* --- 4. Hero Section --- */
.hero-section {
    background-image: url('images/fondbandeau.jpg'); 
    background-size: cover; 
    background-position: center center; 
    background-repeat: no-repeat; 
    padding: 150px 0;
    color: var(--accent-color);
    text-align: center;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3); 
    backdrop-filter: blur(2px); 
}

.hero-content {
    position: relative;
    z-index: 10;
}

.hero-content h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.hero-content h2 {
    font-size: 1.5em;
    font-weight: 400;
    margin-bottom: 30px;
}

/* --- 5. Sections Générales --- */
section {
    padding: 80px 0;
    text-align: center;
}

.section-description {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 40px;
}

/* --- 6. Services Section --- */
.services-section {
    background-color: var(--light-bg);
}

.service-cards {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    margin-top: 40px;
}

.card {
    background-color: var(--accent-color);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    flex: 1 1 300px; 
    max-width: 350px;
    /* text-align: left; - Gardé à gauche pour les paragraphes */
}

.card img {
    /* Rend l'image un élément de bloc pour que margin: 0 auto fonctionne */
    display: block; 
    max-width: 200px;
    height: auto;
    /* Centrage de l'élément de bloc */
    margin: 0 auto 15px auto; /* 0 haut, auto côtés (centrage), 15px bas */
    filter: drop-shadow(0 0 5px var(--primary-color));
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    /* Centrage du titre */
    text-align: center; 
}

/* --- 7. À Propos Section --- */
.about-section {
    background-color: var(--accent-color);
}

.about-content {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 50px;
}

.text-content {
    flex: 2;
}

.text-content h2 {
    color: var(--secondary-color);
}

.photo-content {
    flex: 1;
    text-align: center;
}

.photo-content img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.caption {
    margin-top: 10px;
    font-style: italic;
    color: #666;
}

/* --- 8. Contact Section --- */
.contact-section {
    background-color: var(--light-bg);
}

.contact-form {
    max-width: 600px;
    margin: 40px auto 0;
    padding: 30px;
    background-color: var(--accent-color);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    text-align: left;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary-color);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--font-family);
    font-size: 1em;
}

.contact-form textarea {
    resize: vertical;
}

.contact-form button {
    width: 100%;
}

/* --- 9. Footer --- */
footer {
    background-color: var(--secondary-color);
    color: var(--accent-color);
    padding: 40px 0 10px;
    font-size: 0.9em;
}

.footer-content {
    display: flex;
    justify-content: center;
    gap: 80px; 
    padding-bottom: 20px;
    border-bottom: 1px solid #3a4b6b;
    text-align: left; 
}

.footer-info, .footer-nav {
    width: 300px; 
    min-width: 200px; 
}

.footer-info h4, .footer-nav h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2em;
}

.footer-nav ul {
    list-style: none;
}

.footer-nav ul li a {
    color: var(--accent-color);
    display: block;
    margin-bottom: 5px;
    transition: color 0.3s;
}

.footer-nav ul li a:hover {
    color: var(--primary-color);
}

.copyright {
    text-align: center;
    padding-top: 15px;
}

.copyright a {
    color: var(--accent-color);
    margin: 0 5px;
}

.copyright a:hover {
    color: var(--primary-color);
}

/* --- Styles spécifiques au formulaire de la page contact (contact.html) --- */

.contact-form-page {
    max-width: 850px; 
    margin: 40px auto 0;
    padding: 30px;
    background-color: var(--accent-color);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    text-align: left;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1; 
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 0.95em;
}

.contact-form-page input[type="text"],
.contact-form-page input[type="email"],
.contact-form-page input[type="tel"],
.contact-form-page select,
.contact-form-page textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--font-family);
    font-size: 1em;
    box-sizing: border-box; 
}

.contact-form-page select {
    appearance: none; 
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M6%209l-4-4h8l-4%204z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.contact-form-page .full-width {
    flex: none; 
    width: 100%;
}

.contact-form-page .primary-btn {
    margin-top: 10px;
    letter-spacing: 1px;
}

.confirmation-message {
    text-align: center;
    margin: 15px 0 25px;
    padding: 10px;
    background-color: var(--light-bg);
    border: 1px dashed #ccc;
    color: var(--dark-text);
    border-radius: 4px;
}

/* --- Responsive pour le formulaire (Mobile) --- */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column; 
        gap: 0;
    }
    .contact-form-page {
        padding: 20px;
    }
}

/* --- Nouveaux Styles pour la page Services (services.html) --- */

.hero-section .text-only {
    padding-top: 50px;
    padding-bottom: 50px;
}

.hero-section .large-text {
    font-size: 1.15em;
    font-weight: 500;
    line-height: 1.8;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.service-item {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.service-item h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.4em;
    border-bottom: 2px solid var(--light-bg);
    padding-bottom: 5px;
}

.about-section.top-padding {
    padding-top: 80px; 
}

.text-content, .service-item {
    text-align: left; 
}

.text-content .btn {
    display: inline-block; 
    margin-top: 30px; 
}

.text-content ul {
    margin-bottom: 30px; 
}

.text-content ul li{
    margin-bottom: 20px;
}

/* --- 10. Responsive Design (Ajustements pour mobile) --- */
@media (max-width: 768px) {
    /* 1. CORRECTION DU LOGO (Doit être statique sur mobile) */
    .logo img {
        /* DÉSACTIVER l'effet dynamique du bureau */
        position: static; 
        transform: none; 
        left: unset; 
        top: unset;
        
        /* Ajuster la taille et le centrage */
        display: block; 
        margin: 10px auto; 
        height: 80px; 
        filter: none; 
    }

    .logo:hover img {
        transform: none; 
    }

    /* 2. RÉORGANISATION DU HEADER */
    header .nav-content {
        padding-left: 20px; /* Réduit le padding du header */
    }

    .nav-content {
        flex-direction: column;
        padding-top: 10px; 
    }

    nav ul {
        margin-top: 10px;
        justify-content: center;
    }

    nav ul li {
        margin: 0 10px;
    }

    /* 3. FORMULAIRE ET SECTIONS */
    .form-row {
        flex-direction: column; 
        gap: 0;
    }
    
    .contact-form-page {
        padding: 20px;
    }
    
    .hero-content h1 {
        font-size: 2.2em;
    }

    .service-cards {
        flex-direction: column;
        gap: 20px;
    }

    .card {
        max-width: 100%;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .photo-content {
        order: -1; 
        margin-bottom: 30px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* --- NOUVEAU STYLE POUR LE MESSAGE DE CONFIRMATION --- */
.success-message {
    padding: 20px;
    margin-bottom: 20px;
    background-color: #d4edda; 
    color: #155724; 
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    display: none; 
}

/* Style en cas d'erreur (si vous voulez l'ajouter plus tard) */
.error-message {
    padding: 15px;
    margin-bottom: 20px;
    background-color: #f8d7da; 
    color: #721c24; 
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    display: none;
}

/* ============================================== */
/* CSS POUR L'ADMINISTRATION (login.php, dashboard.php, add_article.php, etc.) */
/* ============================================== */

.login-container {
    max-width: 400px;
    margin: 100px auto; 
    padding: 30px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-container h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 25px;
    border-bottom: 2px solid #0056b3;
    padding-bottom: 10px;
}

.login-container label {
    display: block;
    text-align: left;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
}

.login-container .error-message {
    color: #d9534f;
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.primary-btn {
    background-color: #007bff;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.primary-btn:hover {
    background-color: #0056b3;
}

.full-width {
    width: 100%;
}

/* --- NOUVEAU STYLE POUR LES IMAGES DE DRAPEAUX --- */
.flag-icon {
    width: 25px; /* Taille désirée, ajustée pour des images de 512x512 */
    height: auto;
    vertical-align: middle; /* Aligne l'image au milieu de la ligne de texte */
    margin: 0 5px; /* Petit espacement autour du drapeau */
}