/* ---------------------------- */
/* STYLES GÉNÉRAUX              */
/* ---------------------------- */

body {
    background-color: white;
    font-family: Arial, sans-serif;
    padding: 0px;
}

.document h2 {
    text-align: center;
    font-weight: 600;
    font-size: 19px;
    color: #8b4513;

    padding: 0px 16px;
    border-bottom: 2px solid #d4a373; /* ligne simple */

    background: transparent;
    width: fit-content;
    margin: -10px auto 10px auto;
}

.document h3 {
    text-align: center;
    font-weight: 600;
    font-size: 19px;
    color: #8b4513;

    border-bottom: 2px solid #d4a373; /* ligne simple */

    background: transparent;
    width: fit-content;
    margin: 0px auto 20px auto;

}


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


/* Conteneur flexible pour TOUS les tableaux */
.table-wrapper {
    width: 100%;
    overflow-x: auto;  /* permet le scroll sur mobile */
}

/* Styles du tableau */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 2px solid #d98c40;
    margin: 20px 0;
}

thead tr {
    background-color: #f9e8d2;
    color: #b45f06;
    font-weight: bold;
    text-align: center;
    border-bottom: 2px solid #d98c40;
}

th, td {
    border: 1px solid #d6c2a3;
    padding: 11px;
    font-size: 25px;
    text-align: center;
}

/* Police arabe */
table tbody tr td {
    font-family: "Scheherazade", "Amiri", serif;
    font-size: 35px;
}

/* Lettres rouges */
.red {
    color: red;
    font-weight: bold;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

/* ---------------------------- */
/* ANIMATION AU CLIC            */
/* ---------------------------- */

.red.animate {
    transform: scale(1.35);
    background-color: rgba(255, 230, 180, 0.7); /* Couleur douce adaptée aux yeux */
    border-radius: 6px;
}

/* ---------------------------- */
/* RESPONSIVE                   */
/* ---------------------------- */

/* Tablette / mobiles moyens */
@media (max-width: 900px) {
    th, td {
        font-size: 24px;
        padding: 14px;
    }
    table tbody tr td {
        font-size: 30px;
    }
}

/* Petits smartphones */
@media (max-width: 600px) {
    th, td {
        font-size: 20px;
        padding: 12px;
    }
    table tbody tr td {
        font-size: 26px;
    }
    body {
        padding: 10px;
    }
}

/* Très petits écrans (anciens téléphones) */
@media (max-width: 420px) {
    th, td {
        font-size: 16px;
        padding: 8px;
    }
    table tbody tr td {
        font-size: 22px;
    }
    .red.animate {
        transform: scale(1.25); /* pour éviter de casser le tableau sur ultra-petit écran */
    }
}



/* ===== NOUVEAU : BARRE DE NAVIGATION AJOUTÉE À LA FIN ===== */
/* ===== SANS MODIFIER TES STYLES EXISTANTS ===== */

.cours-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 10px 15px;
    border-bottom: 2px solid #d98c40;  /* Harmonisé avec ta couleur */
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.navigation-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: white;
    color: #b45f06;  /* Harmonisé avec ta couleur */
    text-decoration: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid #d98c40;  /* Harmonisé avec ta couleur */
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-btn.disabled {
    opacity: 0.5;
    border-color: #ccc;
    color: #999;
    background: #f5f5f5;
    cursor: default;
    pointer-events: none;
}

.nav-btn:not(.disabled):hover {
    background: #d98c40;  /* Harmonisé avec ta couleur */
    color: white;
    border-color: #b45f06;
}


/* Adaptation mobile pour la barre de navigation */
@media screen and (max-width: 768px) {
    .cours-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
    }

    .navigation-buttons {
        justify-content: center;
        order: 2;
    }

    /* Ton .instruction reste inchangé */
    .document .instruction {
        order: 1;
        margin-bottom: 10px;
    }

    .nav-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .nav-btn span:not(.icon) {
        display: none;
    }

    .nav-btn {
        padding: 8px 10px;
    }

    .nav-btn .icon {
        font-size: 18px;
        margin: 0;
    }

    .page-indicator {
        font-size: 12px;
        padding: 4px 10px;
    }
}
