/* styles.css - version sans effets dynamiques */

html {
    height: 100%; /* S'assure que la racine du document peut servir de référence de hauteur */
}

/* Image de fond */
body {
    font-family: Arial, sans-serif;
    /* Propriété background unifiée pour plus de clarté et de performance */
    background: url('background.png') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100%; /* Le body prend au minimum toute la hauteur de la fenêtre */
    padding: 10px;
    box-sizing: border-box;
}

/* Styles pour améliorer la visibilité des éléments de formulaire */
.input-field {
    width: 100%;
    padding: 15px; /* Augmenter le padding pour les interactions tactiles */
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 5px;
    box-sizing: border-box;
    touch-action: manipulation; /* Optimiser pour les interactions tactiles */
}

.input-field select, .input-field input {
    width: 100%;
    padding: 12px; /* Augmenter le padding pour les cibles tactiles */
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    outline: none; /* Supprimer l'outline par défaut */
    transition: border-color 0.3s ease; /* Transition pour le focus */
}

.input-field select:focus, .input-field input:focus {
    border-color: #008CBA; /* Couleur de bordure pour le focus */
    box-shadow: 0 0 5px rgba(0, 140, 186, 0.5); /* Ombre pour indiquer le focus */
}

.input-field label {
    color: #000 !important;
    font-weight: bold;
    font-size: 1.2rem;
    pointer-events: none; /* Empêcher les interactions avec le label */
}

/* Boutons */
#initButton, #validateButton, #nextButton {
    width: 100%;
    padding: 10px 20px; /* Ajuster le padding pour créer de l'espace autour du texte */
    font-size: 1rem;
    margin: 10px 0;
    background-color: #008CBA;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-sizing: border-box;
    transition: background-color 0.3s ease;
    min-height: 50px;
    display: flex;
    justify-content: center; /* Centre le texte horizontalement */
    align-items: center; /* Centre le texte verticalement */
}

#initButton:disabled, #validateButton:disabled, #nextButton:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.btn {
    margin-top: 20px;
    width: 100%;
    max-width: 300px;
}

.card {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    box-sizing: border-box;
}

.selected {
    border: 3px solid black;
}

.correct {
    border: 3px solid green;
}

.incorrect {
    border: 3px solid red;
}

.dashed-correct {
    border: 3px dashed green;
}

button {
    margin: 10px;
    padding: 10px;
    font-size: 16px;
    width: 100%;
    max-width: 300px;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#progressBarContainer {
    width: 100%;
    background-color: #f3f3f3;
    border-radius: 5px;
}

#progressBar {
    height: 30px;
    background-color: #4caf50;
    border-radius: 5px;
    transition: width 0.5s;
}

#scoreDisplay {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 5px;
}

#question {
    background: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 5px;
}

#descriptionContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    max-width: 100%;
}

.description-box {
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
    font-family: Arial, sans-serif;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fefefe;
    padding: 20px;
    margin-left: 20px;
    width: 100%;
    max-width: 600px;
}

.center-align {
    text-align: center;
}

.question-text {
    font-size: 1.5rem;
}

.question-row {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
    flex-wrap: wrap; /* pour petits écrans */
}

.question-row .question-text {
    margin: 0;
}

#buttonContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

#buttonContainer button {
    margin: 0 10px;
    width: 100%;
    max-width: 150px;
}

.option-button {
    white-space: normal;
    word-wrap: break-word;
    text-align: left;
    width: 100%;
    max-width: 600px;
    height: auto;
}

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    display: none;
}

/***** Hint (ampoule) joli, accessible, SANS effets dynamiques *****/
:root {
    --hint-off: #9aa3af;      /* gris neutre (repos) */
    --hint-on: #f59e0b;       /* jaune ambré (actif) */
    --hint-glow: #fde68a;     /* halo (non utilisé ici) */
    --hint-bg: transparent;   /* fond du bouton au repos */
}

@media (prefers-color-scheme: dark) {
    :root {
        --hint-off: #cbd5e1;
        --hint-on: #fbbf24;
        --hint-glow: #f59e0b;
    }
}

/* Conteneur indices: aligne l’ampoule et le compteur */
.hints-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* Texte “Indices restants” */
.hint-count,
#hintCount {
    font-size: 0.95rem;
    background: rgba(255,255,255,0.8);
    padding: 4px 8px;
    border-radius: 4px;
    color: #374151;
}

/* Bouton circulaire pour l’ampoule */
.hint-btn {
    all: unset; /* reset propre */
    display: inline-grid;
    place-items: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--hint-bg);
    cursor: pointer;
}

/* Icône Font Awesome */
.hint-icon {
    font-size: 20px;
    color: var(--hint-off);
    margin: 0;
}

/* État: disponible (indices > 0) - couleur uniquement, pas de glow */
.hint-btn.is-available .hint-icon {
    color: var(--hint-on);
    filter: none;
    text-shadow: none;
    box-shadow: none;
}

/* Pas d’effet hover/focus/clic */
.hint-btn:hover,
.hint-btn:focus-visible {
    background: transparent;
    transform: none;
    box-shadow: none;
    outline: none;
}
.hint-btn:active {
    transform: none;
}

/* État: inactif (0 indice) */
.hint-btn.is-disabled {
    cursor: not-allowed;
    opacity: .55;
}
.hint-btn.is-disabled .hint-icon {
    color: var(--hint-off);
    filter: none;
    text-shadow: none;
}

/* Désactivation globale de transitions/animations pour ce bouton (anti-effets) */
.hint-btn,
.hint-btn * {
    transition: none !important;
    animation: none !important;
}

/* Adaptation responsive légère */
@media (max-width: 480px) {
    .hint-count { font-size: 0.9rem; }
}
