/* Styles généraux */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --panel-bg: #f8f9fa;
    --border-color: #dee2e6;
    --input-bg: #fff;
    --text-color: #343a40;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #f0f2f5;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100;
  color: var(--text-color);
  margin : 0 ;
}

h2, h3 {
    color: var(--text-color);
    margin-top: 0;
}

hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 20px 0;
}

#full-content { margin : 50px 50px ; }

main {
  flex-grow: 1; /* Permet au contenu principal de s'étendre et de pousser le footer vers le bas */
}


/* Styles du menu de navigation */
nav {position: relative;}
/* Styles du menu de navigation actuels */
nav ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #333;
}
nav li {
  float: left;
}
nav li a {
  display: block;
  color: white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
}
nav li a:hover {
  background-color: #111;
}

/* Style de l'élément "Mon compte" */
nav li.right {
  float: right;
}
nav li.right a {
  background-color: #555;
  font-size: 0.9em;
  padding: 14px 12px;
}
nav li.right a:hover {
  background-color: #777;
}

nav a.active {
    background-color: #4CAF50;
    color: white;
}

/* NOUVEAUX STYLES POUR LE MENU MOBILE */

/* Le bouton hamburger, qui sera caché sur les grands écrans */
.navbar-toggler {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    position: absolute;
    left: 20px;       /* Place le bouton à 20px du bord gauche */
    top: 10px;
}

/* Media Query pour les écrans plus petits (ex. : moins de 768px de large) */
@media screen and (max-width: 768px) {
    /* Cache les éléments de la barre de navigation par défaut */
    nav li {
        display: none;
    }

    /* Affiche le bouton hamburger */
    .navbar-toggler {
        display: block;
    }

    /* Affiche la liste des liens en colonne */
    nav ul.nav-links {
        display: flex;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 60px; /* Espace sous l'en-tête */
        left: 0;
        background-color: #444;
        transition: transform 0.3s ease-in-out;
        transform: translateY(-150%); /* Cache le menu en dehors de l'écran */
    }

    /* Le menu devient visible lorsque la classe 'active' est ajoutée */
    nav ul.nav-links.active {
        transform: translateY(0);
    }

    /* Affiche chaque élément de la liste, sur une ligne complète */
    nav ul.nav-links li {
        display: block;
        float: none;
        text-align: center;
    }

    /* Aligne l'élément "Mon compte" normalement dans la colonne */
    nav ul.nav-links li.right {
        float: none;
    }
}

.main-container {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 30px auto; /* Centrage du conteneur principal */
}

/* PAGINATION */
/* Styles pour le conteneur de pagination */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    font-size: 0.8em;
}

/* Styles pour les liens de page (par défaut) */
.pagination-controls a {
    text-decoration: none;
    color: black; /* Définit la couleur de tous les liens en noir */
    padding: 8px 16px;
    border: 1px solid #ddd;
    margin: 0 4px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

/* Effet au survol des liens */
.pagination-controls a:hover {
    background-color: #777;
    color: white;
    border-color: #777;
}

/* Style de la page active, qui est un <span> */
.pagination-controls .active-page {
    background-color: #777;
    color: white; /* Ceci est le style qui s'applique à la page actuelle */
    border: 1px solid #777;
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: 5px;
    font-weight: bold;
    cursor: default;
}

/* Transition fluide pour les champs de saisie */
#searchInput, #animal-guess {
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

/* Transition sur les boutons */
#submit-guess, #new-game-button {
    transition: background-color 0.3s ease, transform 0.1s ease;
}


/* Style champ de recherche creature input */
.suggestions-dropdown {
  position: absolute;
  background-color: white;
  border: 1px solid #ccc;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  width: 100%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  display: none; /* Cachée par défaut */
}

.suggestion-item {
  padding: 10px;
  cursor: pointer;
}

.suggestion-item:hover {
  background-color: #f1f1f1;
}

/* Règle CSS pour les petits écrans (optionnel mais recommandé) */
@media (max-width: 600px) {
  .suggestions-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 50vh;
  }
}

/* Styles pour le champ de recherche */
.search-container {
  margin-bottom: 20px;
}

#searchInput {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  box-sizing: border-box; /* S'assure que le padding n'augmente pas la largeur */
}

/* Styles pour le contenu de la page */
.container {
  max-width: 800px;
  margin: 20px auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.hero {
  background-color: #555;
  color: white;
  text-align: center;
  padding: 100px 20px;
  margin-bottom: 20px;
}
.hero h1 {
  margin: 0;
  font-size: 3em;
}
.hero p {
  font-size: 1.2em;
  margin-top: 10px;
}

h2 {
  margin: 0;
}

#ancetres {
  line-height: 1.2;
  font-style: italic;
  margin: 0;
}

#chart-container {
    width: 100%;
    margin-bottom: 50px;
}

.link {
    fill: none;
    stroke: #ccc;
    stroke-width: 1.5px;
}

.node circle {
    fill: #fff;
    stroke: steelblue;
    stroke-width: 2px;
}

.node text {
    font: 10px sans-serif;
    fill: #333;
}

#new-game-button {
    margin-bottom : 50px ;
    }

#input-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#input-form input {
    flex-grow: 1;
    padding: 8px;
    font-size: 14px;
}

#selected-nodes-list {
    list-style-type: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

#selected-nodes-list li {
    background-color: #e0e0e0;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
}


.game-container {
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px; /* Bords plus arrondis */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); /* Ombre plus douce */
    text-align: center;
    width: 90%;
    max-width: 600px;
}


.input-area {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    gap: 15px; /* Espace entre les éléments */
}

#animal-guess {
    padding: 12px 15px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px; /* Bords arrondis */
    flex-grow: 1; /* Le champ de saisie prend plus de place */
    outline: none; /* Enlève la bordure au focus */
    transition: border-color 0.3s ease;
}

#animal-guess:focus {
    border-color: #4a90e2;
}

#submit-guess {
    padding: 12px 25px;
    font-size: 1rem;
    background-color: #4a90e2; /* Couleur d'accent moderne */
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

#submit-guess:hover {
    background-color: #357bd8;
    transform: translateY(-2px); /* Petit effet de survol */
}

/* Le reste du CSS pour les résultats et messages */
.error-message {
    color: #e53e3e; /* Un rouge un peu plus doux */
    font-size: 0.9em;
    margin-top: 10px;
    font-weight: 500;
}

.hidden {
    display: none;
}


/* Styles pour l'arbre généalogique */
#taxonomy-tree {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    text-align: left;
}

.taxonomy-level {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    padding-left: 20px; /* Indentation pour la hiérarchie */
    position: relative;
}

.taxonomy-level.correct:before {
    background-color: #28a745; /* Ligne verte pour une bonne réponse */
}

#full-content a {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 20px;
  background-color: #333;
  color: white;
  border: white solid 1px ;
  text-decoration: none;
  border-radius: 5px;
}

#full-content a:hover {background-color: #111;}


/******************************************
*********  FOOTER  ************************
*******************************************/

/* Améliorations du footer */
footer {
    background-color: #333;
    color: #f0f0f0;
    padding: 2rem 1.5rem;
    font-family: 'Inter', sans-serif;
}

.footer-container {
    display: flex; /* Utilise Flexbox */
    justify-content: space-around; /* Distribué l'espace entre les sections */
    flex-wrap: wrap;

    /* C'est la ligne la plus importante pour le centrage */
    max-width: 1000px; /* Limite la largeur du conteneur */
    margin: 0 auto; /* Centre le conteneur lui-même */
}

.footer-section {
    flex-basis: 250px;
    margin: 0 20px ;
    text-align:center ;
}

/* Le reste des styles reste inchangé */
.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color : #fff ;
    text-decoration: none;
}

.footer-section a:hover {
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #444;
    color: #999;
}

/* Média-query pour les petits écrans */
@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr; /* Une seule colonne sur les petits écrans */
        text-align: center;
    }

    .footer-section h3 {
        border-bottom: none; /* Supprime la bordure du titre sur mobile pour un look plus simple */
    }
}

