/* Conteneur principal des flashcards */
.flashcard-container {
    perspective: 1000px;
    width: 100%;
    max-width: 600px;
    height: 400px;
    margin: 20px auto;
}

/* Style de base pour les flashcards */
.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s;
    cursor: pointer;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

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

/* Faces des flashcards */
.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 15px;
    background-color: #ffffff;
    border: 2px solid #e0e0e0;
}

.flashcard-back {
    transform: rotateY(180deg);
    background-color: #f8f9fa;
}

/* Contenu des flashcards */
.flashcard-content {
    text-align: center;
    max-width: 90%;
}

.flashcard-question, .flashcard-answer {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #333;
}

.flashcard svg {
    max-width: 200px;
    max-height: 150px;
    margin: 10px 0;
}

/* Contrôles et navigation */
.controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

/* Barre de progression */
.progress-container {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
}

.progress {
    height: 10px;
    border-radius: 5px;
}

/* Styles pour le quiz */
.quiz-container {
    max-width: 800px;
    margin: 30px auto;
}

.quiz-question {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.quiz-option {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-option:hover {
    background-color: #f8f9fa;
    border-color: #0d6efd;
}

.quiz-option.selected {
    background-color: #e7f1ff;
    border-color: #0d6efd;
}

.quiz-option.correct {
    background-color: #d4edda;
    border-color: #28a745;
}

.quiz-option.incorrect {
    background-color: #f8d7da;
    border-color: #dc3545;
}

/* Styles généraux pour les cartes */
.card {
    border: 1px solid rgba(0,0,0,.125);
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
}

.card-body {
    padding: 2rem;
}

.border {
    border-color: rgba(0,0,0,.125) !important;
}

.svg-container {
    margin-top: 1rem;
}

/* Styles responsifs */
@media (max-width: 768px) {
    .flashcard-container {
        height: 300px;
    }

    .flashcard-question, .flashcard-answer {
        font-size: 1rem;
    }

    .controls {
        flex-wrap: wrap;
    }
}

/* Animations */
.fade-enter-active, .fade-leave-active {
    transition: opacity 0.5s;
}

.fade-enter, .fade-leave-to {
    opacity: 0;
}

/* Mode édition */
.edit-mode .flashcard-front, .edit-mode .flashcard-back {
    cursor: text;
}

.edit-mode .flashcard-content {
    width: 100%;
}

.edit-mode textarea {
    width: 100%;
    min-height: 100px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    resize: vertical;
}

/* Navigation fixe */
.nav-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.nav-buttons button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Mode plein écran */
.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255,255,255,0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-mode .flashcard-container {
    width: 80%;
    height: 80vh;
    max-width: none;
}

/* Statistiques */
.stats-container {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #0d6efd;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Styles d'impression */
@media print {
    @page {
        margin: 2cm;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    /* Éléments à cacher */
    .navbar,
    .btn,
    form,
    .no-print,
    #printContainer {
        display: none !important;
    }

    /* Mise en page des flashcards */
    .card {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 30px !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }

    .card-body {
        padding: 20px !important;
    }

    .border {
        border: 1px solid #000 !important;
        padding: 15px !important;
    }

    /* Titres */
    h4 {
        font-size: 18pt;
        margin-bottom: 20px !important;
        page-break-after: avoid;
    }

    h5 {
        font-size: 16pt;
        margin-bottom: 15px !important;
        page-break-after: avoid;
    }

    h6 {
        font-size: 14pt;
        margin-bottom: 10px !important;
        page-break-after: avoid;
    }

    /* Contenu */
    p {
        margin-bottom: 10px !important;
    }

    /* Quiz */
    .form-check {
        margin-bottom: 10px !important;
        page-break-inside: avoid;
    }

    .question-text {
        font-weight: 500;
        margin-bottom: 15px !important;
    }

    /* Images et couleurs */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    svg, img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Sections et espacements */
    .flashcards-section,
    .quiz-section {
        margin-bottom: 40px !important;
    }

    .quiz-section {
        page-break-before: always;
    }

    .row {
        page-break-inside: avoid;
    }

    /* Maintien des styles spécifiques pour l'impression */
    .printable-flashcards .row,
    .printable-quiz,
    .quiz-question {
        page-break-inside: avoid;
    }
}