/* ============================================= */
/* THÈME PRESTIGE - VERSION FINALE ET COMPLÈTE    */
/* ============================================= */

/* --------------------------------------------- */
/* 1. FONDATIONS ET VARIABLES                    */
/* --------------------------------------------- */
:root {
  /* Palette de couleurs raffinée */
  --couleur-orange: #D95F02; /* Un orange plus profond */
  --couleur-blanc: #FDFDFD;
  --couleur-vert: #00441B;   /* Un vert forêt très sombre */
  
  /* Police de caractères */
  --font-titre: 'Poppins', sans-serif;
  --font-texte: 'Open Sans', sans-serif;

  /* Rayon pour les bordures */
  --border-radius: 12px;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #f8f9fa;
  color: #333;
  font-family: var(--font-texte);
  margin: 0;
  line-height: 1.7;
}

h1, h2, h3 {
  font-family: var(--font-titre);
  color: var(--couleur-vert);
}

a, button {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

main {
  position: relative;
  z-index: 1; /* Assure que le contenu est sous le header */
}


/* --------------------------------------------- */
/* 2. HEADER FLOTTANT ET MODERNE                 */
/* --------------------------------------------- */
body > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);

  /* --- Modifications pour un positionnement robuste --- */
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box; /* Assure que le padding est inclus dans la largeur */
  z-index: 1000;
}

.logo a {
  text-decoration: none;
  color: var(--couleur-orange);
  font-size: 24px;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.logo-part2 {
  color: var(--couleur-vert);
}

nav ul { list-style: none; display: flex; margin: 0; padding: 0; }
nav li { margin-left: 20px; }
nav a { text-decoration: none; color: var(--couleur-orange); font-weight: bold; padding: 8px 12px; border-radius: 5px; font-size: 13px; }
nav a:hover {
  background-color: transparent;
  color: var(--couleur-vert);
  transform: translateY(-2px);
}


/* --------------------------------------------- */
/* 3. STYLES DES SECTIONS ET COMPOSANTS          */
/* --------------------------------------------- */

/* ... (Styles pour .hero, .candidat-ideal, etc. comme avant) ... */
.hero { background: linear-gradient(135deg, var(--couleur-vert), #002a11); color: var(--couleur-blanc); min-height: 100px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 40px 20px; }
.hero h1 { font-size: 48px; margin-bottom: 15px; text-shadow: 2px 2px 4px rgb(0, 0, 0, 0.2); animation: fadeInDown 1s ease-out; color: var(--couleur-orange) }
.hero p { font-size: 18px; max-width: 600px; margin-bottom: 30px; opacity: 0.9; }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

.candidat-ideal { background-color: var(--couleur-blanc); padding: 60px 20px; text-align: center; }
.candidat-ideal h2 { color: var(--couleur-vert); font-size: 36px; }

.cta-button { background-color: var(--couleur-orange); color: var(--couleur-blanc); padding: 15px 30px; border-radius: 50px; text-decoration: none; font-family: var(--font-titre); font-size: 18px; border: 2px solid var(--couleur-blanc); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.cta-button:hover { background-color: var(--couleur-blanc); color: var(--couleur-orange); box-shadow: 0 6px 20px rgba(0,0,0,0.15); transform: translateY(-3px); }

.cta-button-secondary { background-color: transparent; color: var(--couleur-orange); border: 2px solid var(--couleur-orange); padding: 15px 30px; border-radius: 50px; text-decoration: none; font-family: var(--font-titre); font-size: 18px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.cta-button-secondary:hover { background-color: var(--couleur-orange); color: var(--couleur-blanc); box-shadow: 0 6px 20px rgba(0,0,0,0.15); transform: translateY(-3px); }

/* ... (Styles pour les cartes candidats avec effets prestige) ... */
.presentation-candidats { padding: 60px 20px; background-color: #f8f9fa; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.presentation-candidats h2 { text-align: center; font-size: 36px; margin-bottom: 40px; }
.candidats-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; }
.candidate-card { background-color: var(--couleur-blanc); border-radius: var(--border-radius); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); overflow: hidden; width: 300px; transition: transform 0.4s ease, box-shadow 0.4s ease; }
.candidate-card:hover { transform: translateY(-12px) scale(1.02); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); }
.candidate-card img { width: 100%; height: 250px; object-fit: cover; display: block; transition: transform 0.4s ease; }
.candidate-card:hover img { transform: scale(1.05); }
.card-content { padding: 20px; text-align: center; }
.card-content h3 { margin: 0 0 5px 0; font-size: 22px; }
.parti-politique { color: var(--couleur-orange); font-style: italic; margin: 0 0 20px 0; min-height: 40px; }
.card-button { background-color: var(--couleur-vert); color: var(--couleur-blanc); text-decoration: none; padding: 10px 20px; border-radius: 50px; border: none; }
.card-button:hover { background-color: #007a4d; color: var(--couleur-blanc); transform: translateY(-3px); }

/* ... (Styles pour les pages de profil et pages statiques) ... */
.profile-container, .page-container { padding-top: 40px; padding-bottom: 40px; background-color: #f8f9fa; }
.profile-content, .page-content { background-color: var(--couleur-blanc); padding: 40px; border-radius: var(--border-radius); box-shadow: 0 4px 15px rgba(0, 158, 96, 0.1); max-width: 900px; margin: 0 auto; }
/* ... (Tous les autres styles pour h1, p, h2, h3 dans les pages) ... */
.profile-header { display: flex; align-items: center; flex-wrap: wrap; margin-bottom: 40px; padding-bottom: 30px; border-bottom: 2px solid #eee; }
.profile-photo { width: 150px; height: 150px; border-radius: 50%; border: 5px solid var(--couleur-vert); object-fit: cover; margin-right: 30px; }
/* ... (après la règle .profile-photo) ... */

/* En-tête pour les pages statiques (Comparateur, A Propos, etc.) */
.page-header {
  display: flex;
  flex-direction: column; /* La ligne la plus importante : empile les éléments */
  align-items: center;    /* Centre le tout horizontalement */
  text-align: center;
  border-bottom: 2px solid #eee;
  padding-bottom: 20px;
  margin-bottom: 30px;
}

.page-header h1 {
  font-size: 32px; /* Taille de police adaptée pour mobile */
  color: var(--couleur-vert);
  margin: 0 0 10px 0;
}

.page-header p {
  font-size: 16px;
  color: var(--couleur-orange);
  font-style: italic;
  margin: 0;
  max-width: 90%; /* Empêche le texte de devenir trop large sur mobile */
}

/* ... (la suite de vos styles) ... */
.page-section p { line-height: 1.8; }

/* ... (Styles pour le quiz graduel) ... */
#progress-bar-container { width: 100%; height: 12px; background-color: #eee; border-radius: 5px; margin-bottom: 30px; overflow: hidden; }
#progress-bar { width: 0%; height: 100%; background-color: var(--couleur-orange); border-radius: 5px; transition: width 0.3s ease-in-out; }
.question-block { display: none; animation: fadeIn 0.5s ease; border: none; padding-bottom: 0; margin-bottom: 30px;}
.question-block.active-question { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.answers { display: flex; flex-direction: column; gap: 10px; }
.answer { padding: 15px 20px; border: 2px solid #eee; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.answer:hover { transform: translateX(10px); border-color: var(--couleur-orange); }
.answer.selected { transform: translateX(10px); background-color: var(--couleur-vert); color: var(--couleur-blanc); border-color: var(--couleur-vert); font-weight: bold; box-shadow: 0 4px 15px rgba(0, 158, 96, 0.2); }

/* ... (Styles pour le résultat du quiz) ... */
#results-container { text-align: center; margin-top: 50px; border-top: 2px solid var(--couleur-orange); padding-top: 30px; animation: fadeIn 0.5s ease; }
/* ... (Tous les styles pour .top3-grid, .top3-item, etc.) ... */
.top3-grid { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; margin-bottom: 40px; }
.top3-item { text-align: center; width: 200px; padding: 15px; border-radius: 10px; box-shadow: 0 4px 10px rgba(0, 158, 96, 0.1); background-color: var(--couleur-blanc); }
.top3-item.first-place { transform: scale(1.1); border: 3px solid var(--couleur-vert); box-shadow: 0 6px 20px rgba(0, 158, 96, 0.2); }
.top3-item img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid var(--couleur-orange); margin-bottom: 10px; }
.top3-item h4 { margin: 5px 0; font-size: 18px; color: var(--couleur-vert); }
#first-place-explanation { background-color: #e6f7ef; padding: 30px; border-radius: 10px; border-left: 5px solid var(--couleur-vert); text-align: left; }

.hidden { display: none; }

footer { background-color: var(--couleur-vert); color: var(--couleur-blanc); text-align: center; padding: 40px 20px; font-size: 14px; margin-top: 60px; .contact-footer a {
    color: var(--couleur-blanc); /* Assure que le lien est blanc */
    text-decoration: underline; /* Souligne le lien pour le rendre évident */
    font-weight: bold;
    opacity: 0.9;
}

.contact-footer a:hover {
    opacity: 1;
    color: var(--couleur-orange); /* Change de couleur au survol */
}}


/* --------------------------------------------- */
/* 4. RESPONSIVE DESIGN ET MENU HAMBURGER        */
/* --------------------------------------------- */
.menu-toggle { display: none; z-index: 1001; }

@media (max-width: 768px) {
  header {
    padding: 15px 20px;
    /* La largeur est maintenant gérée par la règle principale, plus besoin de la redéfinir ici */
  }
  nav { display: none; } /* On cache la nav desktop */
    
  
  /* Style du bouton hamburger */
  .menu-toggle {
    display: flex;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    padding: 0;
  }
  .bar { display: block; width: 100%; height: 3px; background-color: var(--couleur-vert); border-radius: 3px; transition: all 0.3s ease-in-out; }

  /* Styles du menu mobile qui s'affiche */
  nav.nav-active {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    z-index: 999;
  }
  nav.nav-active ul { flex-direction: column; text-align: center; }
  nav.nav-active li { margin: 20px 0; }
  nav.nav-active a { font-size: 24px; }
  
  .menu-toggle.is-active .bar:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
  .menu-toggle.is-active .bar:nth-child(2) { opacity: 0; }
  .menu-toggle.is-active .bar:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

  /* Autres ajustements responsive */
  .hero h1 { font-size: 36px; }
  .candidat-ideal h2, .presentation-candidats h2 { font-size: 28px; }
  .profile-info h1, .page-header h1 { font-size: 32px; }
  .candidate-card { width: 100%; max-width: 340px; }
  .profile-content, .page-content { padding: 20px; }
  .profile-header { flex-direction: column; text-align: center; }
  .profile-photo { margin-right: 0; margin-bottom: 20px; }
  .top3-grid { flex-direction: column; align-items: center; }
  .top3-item { width: 80%; max-width: 250px; }
  .top3-item.first-place { transform: scale(1.05); }

  .cta-button-secondary {
    padding: 12px 20px; /* On réduit l'espace intérieur */
    font-size: 16px;   /* On réduit légèrement la taille du texte */
  }

  /* On ajuste le titre au-dessus du compteur */
  #countdown-section h2 {
    font-size: 22px;
  }

  /* On réduit la taille des boîtes du compteur */
  .countdown-item {
    padding: 10px;
    width: 65px; /* Plus petit que les 100px sur ordinateur */
    border-radius: 8px;
  }

  /* On réduit la taille des chiffres */
  .countdown-item span {
    font-size: 20px; /* Plus petit que les 42px sur ordinateur */
  }

  /* On réduit la taille du texte (Jours, Heures...) */
  .countdown-item p {
    font-size: 12px;
  }

  /* On réduit l'espace entre les boîtes */
  #countdown-timer {
    gap: 10px;
  }
}

/* ============================================= */
/* STYLE DES SCORES DÉTAILLÉS (QUIZ)             */
/* ============================================= */
#detailed-scores {
    max-width: 800px;
    margin: 40px auto 0 auto;
    text-align: left;
}

.score-item {
    margin-bottom: 15px;
}

.score-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.score-info .name {
    font-weight: bold;
    color: var(--couleur-vert);
}

.score-info .points {
    font-size: 14px;
    color: #555;
}

.score-bar-bg {
    width: 100%;
    height: 20px;
    background-color: #eee;
    border-radius: 10px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    width: 0%; /* La largeur sera définie par JavaScript */
    background: linear-gradient(90deg, var(--couleur-orange), #ff9a4d);
    border-radius: 10px;
    transition: width 0.8s ease-in-out;
    text-align: right;
    color: white;
    font-size: 12px;
    line-height: 20px;
    padding-right: 8px;
    box-sizing: border-box; /* Pour que le padding ne modifie pas la largeur */
}

/* Animation pour le message d'attente du bot */
.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #999;
    animation: bounce 1.4s infinite ease-in-out both;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}


/* ============================================= */
/* STYLE DE LA PAGE COMPARATEUR (INTERACTIF)     */
/* ============================================= */
#candidate-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.selector-card {
    width: 120px;
    padding: 10px;
    border: 3px solid transparent;
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.selector-card:hover {
    background-color: #f8f9fa;
    transform: translateY(-5px);
}

.selector-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.selector-card p {
    font-size: 14px;
    font-weight: bold;
    margin: 10px 0 0 0;
}

.selector-card .checkmark {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    background-color: var(--couleur-vert);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
}

.selector-card.selected {
    border-color: var(--couleur-vert);
    background-color: #e6f7ef;
}

.selector-card.selected .checkmark {
    opacity: 1;
    transform: scale(1);
}

.separator {
    border: none;
    height: 1px;
    background-color: #eee;
    margin: 40px 0;
}

.select-prompt {
    text-align: center;
    font-size: 18px;
    color: #6c757d;
    padding: 40px 0;
}

.theme-comparison {
    margin-bottom: 40px;
}
.theme-comparison h2 {
    font-size: 28px;
    color: var(--couleur-vert);
    margin-bottom: 25px;
}
.comparison-grid {
    display: grid;
    /* La grille s'adapte au nombre de colonnes défini par le JS */
    grid-template-columns: repeat(var(--num-columns, 2), 1fr);
    gap: 20px;
}
.candidate-position {
    background-color: #f8f9fa;
    border-left: 5px solid var(--couleur-orange);
    padding: 20px;
    border-radius: 8px;
}
.candidate-position h4 {
    margin-top: 0;
    margin-bottom: 10px;
}
.candidate-position p {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 0;
}

/* ============================================= */
/* STYLE DU COMPTE À REBOURS                     */
/* ============================================= */
#countdown-section {
    background-color: var(--couleur-vert);
    color: var(--couleur-blanc);
    padding: 40px 20px;
    text-align: center;
}

#countdown-section h2 {
    color: var(--couleur-blanc);
    font-size: 28px;
    margin-top: 0;
    margin-bottom: 30px;
}

#countdown-timer {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.countdown-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: var(--border-radius);
    width: 100px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.countdown-item span {
    display: block;
    font-size: 42px;
    font-family: var(--font-titre);
    font-weight: bold;
}

.countdown-item p {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.8;
}

/* Styles pour les nouvelles sections de la page "Comment Voter" */
.checklist {
    list-style: none;
    padding-left: 0;
}
.checklist li {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px !important; /* Pour surcharger le style de base */
}

.faq-item {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}
.faq-item h4 {
    margin-top: 0;
    color: var(--couleur-vert);
}

.official-links a {
    color: var(--couleur-orange);
    font-weight: bold;
}

.voter-en-paix {
    background-color: var(--couleur-blanc);
    text-align: center;
    padding: 50px 20px;
    border-top: 1px solid #eee;
    margin-top: 60px;
}
.voter-en-paix h2 {
    font-size: 32px;
}
.voter-en-paix p {
    max-width: 700px;
    margin: 15px auto 0 auto;
    font-size: 18px;
    color: #555;
}

.last-updated {
    text-align: center;
    padding: 10px;
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 14px;
    font-style: italic;
}

/* ============================================= */
/* STYLE DE LA SECTION REMERCIEMENTS             */
/* ============================================= */
.remerciements {
    background-color: var(--couleur-blanc);
    padding: 60px 20px;
    text-align: center;
    border-top: 1px solid #eee;
}

.remerciements h2 {
    font-size: 32px;
    margin-bottom: 25px;
}

.remerciements p {
    max-width: 800px;
    margin: 0 auto 15px auto;
    font-size: 18px;
    line-height: 1.8;
    color: #555;
}

/* Modifiez cette règle */
#logo-site {
  width: 45px; /* Une taille plus adaptée pour une icône */
  height: auto;
  margin-right: 10px; /* Ajoute un espace entre l'icône et le texte */
}

/* ============================================= */
/* STYLES POUR LE TABLEAU COMPARATIF             */
/* ============================================= */
.table-container {
  overflow-x: auto; /* Permet le défilement horizontal sur mobile */
  margin-top: 30px;
  margin-bottom: 30px;
  border: 1px solid #eee;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px; /* Force le défilement si l'écran est trop petit */
}

th, td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
  font-size: 15px;
}

thead th {
  background-color: #f8f9fa;
  font-family: var(--font-titre);
  color: var(--couleur-vert);
  font-size: 16px;
  position: sticky; /* En-têtes fixes lors du défilement */
  top: 0;
}

tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

tbody td:first-child strong {
  color: var(--couleur-orange);
}