/* Réinitialisation de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
}

/* --- Style de la Navbar --- */

.navbar {
    background-color: #3b5998; /* Un bleu classique et institutionnel */
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo {
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: block;
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    transition: background-color 0.3s;
    border-radius: 5px;
}

.nav-link:hover {
    background-color: #4c69a7;
}

/* Style spécial pour le bouton 'Candidater' */
.special-link {
    background-color: #f1c40f; /* Une couleur vive pour attirer l'attention */
    color: #333;
    font-weight: bold;
    margin-left: 10px;
}

.special-link:hover {
    background-color: #f39c12;
    color: white;
}

/* Masquer la case à cocher et l'icône de menu par défaut sur grand écran */
#menu-toggle, .menu-icon {
    display: none;
}

/* --- Réactivité (Media Query) --- */

@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
    }

    .menu-icon {
        display: block; /* Afficher l'icône de menu 'burger' */
        color: white;
        font-size: 1.5em;
        cursor: pointer;
    }

    .nav-links {
        /* Les liens sont masqués par défaut et prennent toute la largeur */
        display: none;
        flex-direction: column;
        width: 100%;
        text-align: center;
        background-color: #3b5998;
        padding-bottom: 10px;
    }
    
    .nav-links li {
        width: 100%;
    }

    .nav-link {
        padding: 15px 0;
        border-bottom: 1px solid #4c69a7;
    }

    .nav-link:last-child {
        border-bottom: none;
    }
    
    .special-link {
        margin-left: 0; /* Supprimer la marge latérale en mode mobile */
        margin-top: 10px;
    }

    /* Afficher les liens lorsque la case est cochée (menu ouvert) */
    #menu-toggle:checked ~ .nav-links {
        display: flex;
    }
}

/* --- Style du Contenu (non-navbar) --- */
.content {
    padding: 20px;
    text-align: center;
}

.content h1 {
    margin-bottom: 10px;
}

/* --- Style de la Section Principale (Hero) --- */
.hero {
    background-color: #e8f0fe; /* Couleur de fond légère */
    color: #3b5998;
    padding: 60px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.2em;
    color: #555;
}

/* --- Style de la Section Processus --- */
.process {
    padding: 50px 20px;
    text-align: center;
}

.process h2 {
    font-size: 2em;
    color: #333;
    margin-bottom: 40px;
}

.steps-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Permet aux étapes de passer à la ligne sur mobile */
    gap: 30px;
}

.step {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 25px;
    width: 280px; /* Largeur fixe pour les cartes */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.step:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.step-icon {
    font-size: 2.5em;
    color: #f39c12; /* Couleur orange/or pour l'icône MomoPay */
    margin-bottom: 15px;
    background: #fff8e1;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px auto;
    border: 2px solid #f1c40f;
}

.step h3 {
    color: #3b5998;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.step p {
    color: #666;
    font-size: 0.95em;
}

/* Ajustement des icônes de numéro FA */
.step-icon .fa-1:before { content: "1"; font-family: 'Arial', sans-serif; font-weight: bold; }
.step-icon .fa-2:before { content: "2"; font-family: 'Arial', sans-serif; font-weight: bold; }
.step-icon .fa-3:before { content: "3"; font-family: 'Arial', sans-serif; font-weight: bold; }
.step-icon .fa-4:before { content: "4"; font-family: 'Arial', sans-serif; font-weight: bold; }
.step-icon .fa-check-circle { color: #2ecc71; }


/* Réactivité pour le Processus sur petits écrans */
@media (max-width: 600px) {
    .steps-container {
        flex-direction: column;
        align-items: center;
    }
    .step {
        width: 100%; /* Les étapes prennent toute la largeur sur petit écran */
        max-width: 350px;
    }
    .hero h1 {
        font-size: 2em;
    }
}

/* --- Mise à jour du Hero (pour la note de prix) --- */
.hero {
    /* ... (conservez les styles existants) ... */
    padding: 60px 20px;
}

.hero p {
    font-size: 1.2em;
    color: #333;
    font-weight: bold; /* Mettre l'emphase sur le prix */
}


/* --- Mise à jour de la Section Processus --- */
.steps-container {
    /* ... (conservez les styles existants) ... */
    gap: 20px;
}

.step {
    /* ... (conservez les styles existants) ... */
    width: 300px; /* Légèrement plus large pour les détails */
}

/* Nouveau style pour les numéros d'étape */
.step-icon {
    font-size: 2.5em;
    color: white; 
    background-color: #3b5998; /* Bleu principal */
    border: 2px solid #3b5998;
    /* Conservez le reste des propriétés (width, height, etc.) */
}

/* Style spécifique pour le numéro de contact/alerte */
.step-icon.contact {
    background-color: #e74c3c; /* Rouge pour l'alerte */
    border-color: #e74c3c;
    font-size: 3em;
}

/* Style pour le code USSD */
.step p code {
    display: inline-block;
    background-color: #f0f0f0;
    color: #c0392b; /* Couleur rouge pour le code */
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1.1em;
    margin-top: 5px;
}

/* Style pour la liste dans l'étape 3 */
.step ul {
    list-style: disc;
    text-align: left;
    margin: 10px 0 0 20px;
    padding: 0;
    color: #666;
    font-size: 0.95em;
}

.step ul li {
    margin-bottom: 5px;
}

/* --- Style du Footer --- */
.footer {
    background-color: #222; /* Fond très sombre */
    color: #bbb; /* Texte gris clair */
    text-align: center;
    padding: 20px 0;
    font-size: 0.9em;
    width: 100%;
    border-top: 3px solid #3b5998; /* Bordure bleue pour lier à la couleur de la navbar */
    margin-top: 40px; /* Ajoute un espace au-dessus du footer */
}

.footer-link {
    color: #f1c40f; /* Couleur accent (la même que le bouton 'Candidater') */
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s, text-decoration 0.3s;
}

.footer-link:hover {
    color: #fff; /* Blanc au survol */
    text-decoration: underline;
}

/* --- Style de l'animation de Neige (À AJOUTER OU VÉRIFIER) --- */

#snowflake-container {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; 
    z-index: 1000; 
    overflow: hidden; 
}

.snowflake {
    color: red; 
    font-size: 1em;
    position: absolute;
    top: -50px; /* Commence au-dessus de l'écran */
    line-height: 1;
    opacity: 0.8;
    user-select: none; 
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.2)); 
    /* Les animations sont définies par JavaScript */
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* Clé d'animation pour la chute (le flocon tombe) */
@keyframes fall {
    to {
        transform: translateY(105vh); /* 105% pour s'assurer qu'il quitte l'écran */
    }
}

/* Clé d'animation pour le vent (Oscillation latérale) */
@keyframes wind0 {
    0% { transform: translateX(0) rotate(0deg); }
    50% { transform: translateX(20px) rotate(1deg); }
    100% { transform: translateX(0) rotate(0deg); }
}

@keyframes wind1 {
    0% { transform: translateX(0) rotate(0deg); }
    50% { transform: translateX(-20px) rotate(-1deg); }
    100% { transform: translateX(0) rotate(0deg); }
}

/* --- Style de la Liste des Candidats (Simplifié) --- */
.candidates-list {
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px; 
}

/* Base de la carte (plus de flip) */
.candidate-card {
    background-color: white; /* Fond blanc */
    width: 320px; 
    height: 680px; /* Hauteur ajustée pour le contenu direct */
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); 
    overflow: hidden; 
    text-align: center;
    position: relative;
    transition: transform 0.3s ease-out, box-shadow 0.3s;
    display: flex; /* Utilise flexbox pour l'alignement interne */
    flex-direction: column;
    align-items: center;
    justify-content: space-between; /* Aide à espacer les éléments */
    padding-bottom: 25px; /* Espace pour le bouton en bas */
    box-sizing: border-box; /* Inclure padding dans la hauteur */
}

.candidate-card:hover {
    transform: translateY(-8px) scale(1.02); 
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* --- Styles du Carrousel d'Images (inchangé) --- */
.carousel-container {
    position: relative;
    width: 100%;
    height: 500px; 
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 3px solid #f1c40f; 
}

.carousel-images {
    display: flex; 
    width: 300%; 
    height: 100%;
    transition: transform 0.5s ease-in-out; 
}

.carousel-images img {
    width: 100%; 
    height: 100%;
    object-fit: cover; 
    border-radius: 5px; 
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 1.5em;
    cursor: pointer;
    z-index: 10;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.carousel-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.carousel-button.prev {
    left: 10px;
}

.carousel-button.next {
    right: 10px;
}

/* --- Pastille du Nombre de Votes (inchangé) --- */
.vote-count-bubble {
    position: absolute; /* Reste absolu par rapport à la carte */
    top: 15px;
    right: 15px;
    background-color: #2ecc71; 
    color: white;
    border-radius: 50%;
    width: 70px; 
    height: 70px;
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.4);
    animation: bounce 2s infinite ease-in-out; 
    z-index: 10; /* S'assure qu'elle est au-dessus du carrousel */
}

.vote-count-bubble i {
    font-size: 1em;
    margin-bottom: 2px;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

h3 {
    color: #3b5998;
    font-size: 2em;
    margin-top: 10px; 
    margin-bottom: 5px;
}

.slogan {
    font-style: italic;
    color: #666;
    margin-bottom: 15px;
    font-size: 1.1em;
    flex-grow: 1; /* Permet au slogan de prendre l'espace */
    padding: 0 15px; /* Ajoute un peu de padding horizontal */
}

.card-meta {
    width: 100%;
    text-align: center;
    padding: 10px 0;
    border-top: 1px dashed #eee;
    margin-top: auto; 
    color: #555;
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 15px; /* Espace avant le bouton */
}

/* Bouton de vote (maintenant sur la face avant) */
.vote-button {
    background-color: #e74c3c; 
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.1s;
    /* Suppression des marges spécifiques au flip-card-back */
}

.vote-button:hover {
    background-color: #c0392b;
    transform: scale(1.02);
}

/* Les styles .view-more-button, .back-button, .flip-card-back .vote-button NE SONT PLUS NÉCESSAIRES */
/* Supprimez les règles CSS suivantes de votre fichier style.css si elles existent encore :
.view-more-button { ... }
.flip-card-back .description { ... }
.flip-card-back .vote-button { ... } (utilisez le .vote-button générique)
.back-button { ... }
*/

/* Réactivité mobile pour les cartes */
@media (max-width: 650px) {
    .candidate-card {
        width: 100%;
        max-width: 350px;
        height: 720px; 
    }
}
/* --- Styles de la Fenêtre Modale (Popup) --- */

.modal {
    display: none; /* Cache le modal par défaut */
    position: fixed; 
    z-index: 2000; /* Doit être au-dessus de la neige (z-index 1000) */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Permet le défilement si le contenu est trop long */
    background-color: rgba(0,0,0,0.6); /* Fond noir semi-transparent */
    padding-top: 50px;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* 5% du haut et centré horizontalement */
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px; /* Largeur maximale pour les grands écrans */
    position: relative;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 35px;
    font-weight: bold;
    line-height: 20px;
    cursor: pointer;
    transition: color 0.3s;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

/* Styles du Formulaire à l'intérieur du Modal */
.modal h2 {
    color: #3b5998;
    margin-top: 0;
}

.modal-info {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 0.8em;
}

.submit-button {
    width: 100%;
    background-color: #2ecc71; /* Vert pour la validation */
    color: white;
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s;
}

.submit-button:hover {
    background-color: #27ae60;
}

/* --- Style de la Section Votants --- */
.voters-section {
    padding: 40px 20px;
    max-width: 1100px;
    margin: 0 auto;
}

/* Style de la Barre de Recherche */
.search-container {
    position: relative;
    margin-bottom: 30px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 30px auto;
}

#searchInput {
    width: 100%;
    padding: 12px 15px 12px 45px; /* Espace pour l'icône */
    border: 2px solid #ddd;
    border-radius: 50px;
    font-size: 1em;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#searchInput:focus {
    border-color: #3b5998;
    box-shadow: 0 0 5px rgba(59, 89, 152, 0.3);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* Style du Tableau */
.table-responsive {
    overflow-x: auto; /* Permet le défilement horizontal sur les petits écrans */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: white;
}

.voters-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Assure une largeur minimale */
}

.voters-table th, .voters-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.voters-table thead th {
    background-color: #3b5998;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
}

.voters-table tbody tr:hover {
    background-color: #f9f9f9;
}

/* Styles des Statuts */
.status {
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.85em;
    display: inline-block;
}

.status.pending {
    background-color: #fdf3d3; /* Jaune clair */
    color: #f39c12; /* Orange pour En attente */
}

.status.validated {
    background-color: #d4f8e5; /* Vert clair */
    color: #2ecc71; /* Vert pour Validé */
}

.status.rejected {
    background-color: #f8d4d4; /* Rouge clair */
    color: #e74c3c; /* Rouge pour Rejeté */
}

.status i {
    margin-right: 5px;
}

/* Ajouter à style.css */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 15px;
}

.pagination-controls a.pagination-button {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
    border: none;
}

.pagination-controls a.pagination-button:hover:not([disabled]) {
    background-color: #0056b3;
}

.pagination-controls a.disabled {
    background-color: #ccc;
    cursor: not-allowed;
    pointer-events: none; /* Désactive le lien */
}

#pageInfo {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
}

/* Styles pour les statuts dans votants.php et verif.php */

.status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
}

/* Statut En attente (Jaune/Orange) */
.status.enattente {
    background-color: #ffc107; /* Jaune */
    color: #343a40; /* Texte foncé */
}

/* Statut Validé (Vert) */
.status.validé {
    background-color: #28a745; /* Vert */
    color: white;
}

/* Statut Rejeté (Rouge) */
.status.rejeté {
    background-color: #dc3545; /* Rouge */
    color: white;
}

/* Styles pour l'alignement du logo et du texte */
.navbar .logo {
    display: flex; /* Active Flexbox pour aligner les enfants (img et span) */
    align-items: center; /* Centre les éléments verticalement */
    gap: 10px; /* Ajoute un espace de 10px entre l'image et le texte */
    text-decoration: none; /* S'assure qu'il n'y ait pas de soulignement */
}

.navbar-logo {
    /* Taille du logo */
    height: 40px; 
    width: auto;
    margin: 0;
}

.logo-text {
    /* Style du texte à côté du logo */
    color: white; /* Ou la couleur que vous utilisez pour les liens de navigation */
    font-size: 1.2em; /* Rend le texte plus visible */
    font-weight: bold;
    /* Assurez-vous que le texte n'hérite pas des styles de liens standard si nécessaire */
}

/* Si votre classe .navbar a déjà une couleur pour les liens, assurez-vous que .logo-text l'utilise ou la remplace. */


/* Styles pour le Modal de la Galerie d'Images */

/* Le fond (noir, transparent) */
.modal-gallery {
    display: none; /* Masqué par défaut */
    position: fixed; /* Reste en place même au défilement */
    z-index: 100; /* Doit être au-dessus de tout */
    padding-top: 60px; /* Espace pour la croix de fermeture */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Permet le défilement si l'image est trop grande */
    background-color: rgba(0,0,0,0.9); /* Fond noir semi-transparent */
}

/* Le contenu de l'image (Modal Image) */
.modal-gallery-content {
    margin: auto;
    display: block;
    
    /* CRITIQUE : Définit la largeur et la hauteur sur 'auto' */
    width: auto;
    height: auto;
    
    /* Limite la taille maximale pour que l'image tienne dans l'écran de l'utilisateur */
    max-width: 90%; /* L'image ne dépassera jamais 90% de la largeur de l'écran */
    max-height: 90vh; /* L'image ne dépassera jamais 90% de la hauteur du viewport (vh) */
    
    /* S'assure que l'image conserve son ratio d'aspect */
    object-fit: contain; 
    
    border-radius: 10px;
}

/* Le bouton de fermeture (x) */
.close-gallery {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-gallery:hover,
.close-gallery:focus {
    color: #bbb;
    text-decoration: none;
}