/* =================================== */
/* STYLES GÉNÉRAUX ET PERSONNALISATION  */
/* =================================== */

/* --- Barre de navigation --- */
.navbar.bg-dark {
    background-color: #CC6600 !important;
}
.navbar-dark .navbar-nav .nav-link,
.navbar-dark .navbar-brand {
    color: #FFFFFF !important;
    font-weight: bold;
}
.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus,
.navbar-dark .navbar-nav .nav-link.active {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* --- Titres principaux --- */
h1, h2, h3, h4, h5 {
    display: inline-block;
    padding: 0.2em 0.5em;
    margin-bottom: 0.75rem;
    background-color: #CC6600;
    color: white;
    font-weight: bold;
    border-radius: 5px;
}
h3, h4 { font-size: 1.2rem; }
h5 { font-size: 1rem; }

/* --- Labels de formulaire --- */
.form-label {
    display: inline-block;
    padding: 0.2em 0.5em;
    margin-bottom: 0.5rem;
    background-color: #CC6600;
    color: white !important;
    font-weight: bold;
    border-radius: 5px;
}

/* --- Cartes statistiques du panel Admin --- */
.card.text-white .card-title,
.card.text-white .display-4 {
    background-color: transparent !important;
    display: block !important;
    padding: 0 !important;
    font-weight: bold !important;
}

/* --- Listes de sélection dans les formulaires --- */
form select[multiple] {
    white-space: nowrap;
    overflow: auto;
}

/* --- Badges --- */
.table .badge,
.flashcard-header .badge {
    white-space: normal;
    text-align: left;
    line-height: 1.2;
    height: auto;
    display: inline-block;
    max-width: 100%;
    padding: 0.5em 0.75em;
}
.flashcard-header .badge {
    text-align: center;
}


/* =================================== */
/* STYLES SPÉCIFIQUES AUX FLASHCARDS   */
/* =================================== */

.flashcard-container {
    perspective: 1000px;
    width: 100%;
}

.flashcard {
    transition: transform 0.6s;
    transform-style: preserve-3d;
    position: relative;
    width: 100%;
    min-height: 250px; 
}

.flashcard.is-flipped {
    transform: rotateY(180deg);
}

.flashcard-face {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,.125);
    overflow: hidden;
}

.flashcard-back {
    transform: rotateY(180deg);
}

.flashcard-header {
    background-color: var(--category-color, #0d6efd);
    color: white;
    padding: 1rem;
    border-bottom: 1px solid rgba(0,0,0,.125);
    flex-shrink: 0; /* Empêche le header de rétrécir */
}

.flashcard-body {
    flex-grow: 1; /* Prend tout l'espace vertical restant */
    display: flex;
    align-items: flex-start; /* CORRIGÉ : Aligne le texte en haut */
    justify-content: center;
    padding: 1.5rem;
    font-size: 1.25rem;
    background-color: #DDE2E7;
    font-weight: bold;
    overflow-y: auto; /* Affiche l'ascenseur si le contenu dépasse */
}

.flashcard-body p {
    margin-bottom: 0;
    width: 100%; /* S'assure que le paragraphe prend la largeur pour le centrage du texte */
    text-align: center; /* Maintient le centrage horizontal du texte */
}

.flashcard-footer.timer-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    z-index: 10;
}
/* Cible le texte .text-muted à l'intérieur de n'importe quelle carte (.card) */
.card .text-muted {
    color: white !important;
}