/* Styles CSS */

body {
    font-family: Arial, sans-serif;
    background-color: #f1f1f1;
    margin: 0;
    padding: 0;
}

#game-container {
    width: 95%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

h1 {
    text-align: center;
    color: #333;
    font-size: 2.5rem;
}

#instructions, #results {
    font-size: 1.5rem;
    line-height: 1.6;
}

#instructions p {
    margin-bottom: 10px;
}

/* Boutons de sélection des modules AF */
.af-button {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 10px auto;
    padding: 15px 25px;
    font-size: 1.4rem;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-align: center;
}

/* Classes spécifiques pour chaque module AF */
.af-green {
    background-color: #28a745; /* Vert */
}

.af-green:hover {
    background-color: #218838;
}

.af-lightblue {
    background-color: #17a2b8; /* Bleu Clair */
}

.af-lightblue:hover {
    background-color: #138496;
}

.af-purple {
    background-color: #6f42c1; /* Violet */
}

.af-purple:hover {
    background-color: #5936a0;
}

.af-pink {
    background-color: #e83e8c; /* Rose */
}

.af-pink:hover {
    background-color: #d63384;
}

.af-orange {
    background-color: #fd7e14; /* Orange */
}

.af-orange:hover {
    background-color: #e06c13;
}

.af-yellow {
    background-color: #ffc107; /* Jaune */
    color: #212529; /* Texte noir pour meilleure lisibilité */
}

.af-yellow:hover {
    background-color: #e0a800;
}

/* Bouton de démarrage du quiz */
#start-button {
    display: block;
    margin: 20px auto;
    padding: 20px 40px;
    font-size: 1.5rem;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#start-button:hover {
    background-color: #218838;
}

#start-button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Nouveaux conteneurs pour la sélection de série */
#select-series {
    display: none;
    text-align: center;
    margin-top: 20px;
}

/* Barre de temps */
#timer-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 20px;
}

#timer-bar {
    height: 25px;
    background-color: #28a745;
    width: 100%;
    transition: width 0.1s linear, background-color 0.3s ease;
}

.question {
    margin-bottom: 30px;
}

.question h2 {
    margin-bottom: 10px;
    color: #007bff;
    font-size: 2.6rem;
}

.question-text {
    font-size: 2.4rem;
    margin-bottom: 20px;
}

.options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(45%, 1fr));
    gap: 15px;
}

.option-button {
    background-color: rgba(0, 123, 255, 0.1); /* Bleu léger par défaut */
    border: 2px solid #007bff;
    color: #007bff;
    padding: 20px;
    margin: 0;
    font-size: 2.2rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    width: 100%;
    box-sizing: border-box;
}

/* Couleurs transparentes pour les options */
.option-button[data-option="A"] {
    background-color: rgba(220, 53, 69, 0.1); /* Rouge léger */
    border-color: #dc3545;
    color: #dc3545;
}

.option-button[data-option="B"] {
    background-color: rgba(255, 193, 7, 0.1); /* Jaune léger */
    border-color: #ffc107;
    color: #ffc107;
}

.option-button[data-option="C"] {
    background-color: rgba(23, 162, 184, 0.1); /* Bleu clair léger */
    border-color: #17a2b8;
    color: #17a2b8;
}

.option-button[data-option="D"] {
    background-color: rgba(40, 167, 69, 0.1); /* Vert léger */
    border-color: #28a745;
    color: #28a745;
}

#results {
    margin-top: 20px;
    text-align: center;
    position: relative;
}

#results-summary {
    font-size: 2.0rem;
    margin-bottom: 20px;
}

.green-text {
    color: #28a745;
}

.red-text {
    color: #dc3545;
}

/* Responsive Table */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px auto;
    min-width: 600px;
}

table, th, td {
    border: 1px solid #dee2e6;
}

th, td {
    padding: 15px;
    text-align: left;
    font-size: 1.4rem;
}

.correct {
    background-color: #d4edda;
}

.incorrect {
    background-color: #f8d7da;
}

#export-button, #restart-button {
    display: inline-block;
    margin: 10px 10px;
    padding: 18px 30px;
    font-size: 1.3rem;
    background-color: #17a2b8;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#export-button:hover {
    background-color: #138496;
}

#restart-button {
    background-color: #6c757d; /* Gris pour différencier */
}

#restart-button:hover {
    background-color: #5a6268;
}

/* Barre de progression */
#progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

#progress-bar {
    height: 10px;
    background-color: #007bff;
    width: 0%;
    transition: width 0.3s ease;
}

/* Célébration Simple */
.celebration {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #28a745;
    color: #fff;
    padding: 15px 25px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    font-size: 1.6rem;
    z-index: 1000;
    animation: fadeInOut 5s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-20px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

/* Compatibilité Mobile */
@media (max-width: 600px) {
    #game-container {
        width: 95%;
    }

    h1 {
        font-size: 2rem;
    }

    .question-text {
        font-size: 2.6rem;
    }

    .option-button {
        font-size: 2.2rem;
        padding: 20px;
        margin: 0;
    }

    .question h2 {
        font-size: 3.2rem;
    }

    #start-button, #export-button, #restart-button {
        font-size: 1.6rem;
        padding: 22px 35px;
    }

    #timer-bar {
        height: 30px;
    }

    th, td {
        font-size: 1.6rem;
        padding: 20px;
    }

    .af-button {
        font-size: 1.6rem;
        padding: 18px 30px;
    }
}

/* Styles pour l'écran d'accès */
#access-screen {
    display: none; /* Initialement caché; affiché si non déverrouillé */
    text-align: center;
    margin-top: 50px;
}

#access-screen h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

#code-display {
    font-size: 2.5rem;
    letter-spacing: 10px;
    margin-bottom: 20px;
}

#digit-buttons {
    display: grid;
    grid-template-columns: repeat(3, 80px);
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.digit-button {
    width: 80px;
    height: 80px;
    font-size: 2rem;
    border: none;
    border-radius: 10px;
    background-color: #17a2b8; /* Bleu */
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.digit-button:hover {
    background-color: #138496;
}

#erase-button {
    padding: 10px 20px;
    font-size: 1.5rem;
    background-color: #dc3545; /* Rouge */
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#erase-button:hover {
    background-color: #c82333;
}

#access-feedback {
    margin-top: 10px;
    font-size: 1.5rem;
}
