/* TEST FINAL A1 - STYLES COMPLETS AVEC PROTECTION CONTRE LA COPIE */

/* ======================================== */
/* PROTECTION CONTRE LA COPIE ET SÉLECTION */
/* ======================================== */
#a1-final-test-container * {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

#a1-final-test-container input[type="text"],
#a1-final-test-container input[type="number"],
#a1-final-test-container .matching-input {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

#a1-final-test-container {
    -webkit-touch-callout: none !important;
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
}

/* Masquer la sélection visuelle */
#a1-final-test-container ::selection {
    background: transparent !important;
    color: inherit !important;
}

#a1-final-test-container ::-moz-selection {
    background: transparent !important;
    color: inherit !important;
}

/* ======================================== */
/* STYLES PRINCIPAUX DU QUIZ */
/* ======================================== */
#a1-final-test-container .quiz-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#a1-final-test-container .quiz-header {
    background: linear-gradient(90deg, #1e3c72, #2a5298);
    color: white;
    padding: 25px;
    text-align: center;
}

#a1-final-test-container .quiz-header h1 {
    font-size: 24px;
    margin: 0 0 10px 0;
    font-weight: 700;
}

#a1-final-test-container .quiz-header .subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
    font-weight: 400;
}

/* ======================================== */
/* TIMER AMÉLIORÉ */
/* ======================================== */
.timer-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin: 20px;
    border: 2px solid #e9ecef;
    text-align: center;
}

#a1-final-test-container .timer {
    background: #2a5298;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 16px;
    display: inline-block;
    margin: 15px auto;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 200px;
}

#a1-final-test-container .timer.alert {
    animation: pulse 1s infinite;
    border: 2px solid #dc3545;
}

/* Animation pour le timer en alerte */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Message d'information pour soumission automatique */
.auto-submit-message {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    padding: 10px;
    margin: 10px 0;
    color: #856404;
    font-size: 14px;
}

/* ======================================== */
/* SECTION INSTRUCTIONS */
/* ======================================== */
.instructions-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin: 20px;
    border: 2px solid #e9ecef;
    text-align: center;
}

.instructions-section h2 {
    color: #2a5298;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 700;
}

.instructions-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
}

.instructions-list {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.instructions-list h3 {
    color: #2a5298;
    margin-top: 0;
    font-weight: 600;
}

.instructions-list ul {
    padding-left: 20px;
}

.instructions-list li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.audio-reminder {
    background: #e6f2ff;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #cfe2ff;
}

.btn-start-exam {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin: 20px 0;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-start-exam:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
    background: linear-gradient(135deg, #218838, #1e9e8a);
}

.btn-start-exam:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.start-instruction {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

/* ======================================== */
/* ANIMATIONS */
/* ======================================== */
#quiz-content {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes soundWave {
    0% { height: 5px; }
    100% { height: 20px; }
}

/* ======================================== */
/* QUESTIONS ET RÉPONSES */
/* ======================================== */
#a1-final-test-container .questions-container {
    padding: 25px;
}

#a1-final-test-container .question {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

#a1-final-test-container .question:hover {
    border-color: #2a5298;
    box-shadow: 0 5px 15px rgba(42, 82, 152, 0.1);
}

#a1-final-test-container .question-number {
    display: inline-block;
    background: #2a5298;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    margin-right: 10px;
    font-weight: bold;
}

#a1-final-test-container .question h3 {
    display: inline;
    color: #333;
    font-weight: 600;
}

#a1-final-test-container .options {
    margin: 15px 0 0 40px;
}

#a1-final-test-container .option {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

#a1-final-test-container .option:hover {
    background: #f0f7ff;
    border-color: #cfe2ff;
}

#a1-final-test-container .option.selected {
    background: #e6f2ff;
    border-left: 4px solid #2a5298;
}

#a1-final-test-container input[type="text"], 
#a1-final-test-container input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    margin-top: 10px;
    transition: all 0.3s;
}

#a1-final-test-container input[type="text"]:focus, 
#a1-final-test-container input[type="number"]:focus {
    border-color: #2a5298;
    outline: none;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

/* Option bullets */
.option-bullet {
    display: inline-block;
    background: #2a5298;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    margin-right: 10px;
    font-weight: bold;
    font-size: 14px;
}

.option-label {
    cursor: pointer;
    padding-left: 10px;
}

/* ======================================== */
/* QUESTIONS D'ASSOCIATION */
/* ======================================== */
.matching-options {
    margin: 15px 0;
}

.matching-pair {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s;
}

.matching-pair:hover {
    background: #f0f7ff;
}

.german-word {
    flex: 1;
    font-weight: bold;
    color: #2a5298;
}

.matching-equals {
    margin: 0 15px;
    font-size: 20px;
    color: #666;
}

.matching-input {
    flex: 2;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s;
}

.matching-input:focus {
    border-color: #2a5298;
    outline: none;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

/* ======================================== */
/* CONTROLES */
/* ======================================== */
#a1-final-test-container .controls {
    padding: 25px;
    background: #f8f9fa;
    border-top: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
}

#a1-final-test-container .btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

#a1-final-test-container .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

#a1-final-test-container .btn-primary {
    background: #2a5298;
    color: white;
}

#a1-final-test-container .btn-primary:hover {
    background: #1e3c72;
}

#a1-final-test-container .btn-secondary {
    background: #6c757d;
    color: white;
}

#a1-final-test-container .btn-secondary:hover {
    background: #5a6268;
}

/* ======================================== */
/* RÉSULTATS */
/* ======================================== */
#a1-final-test-container .result-container {
    padding: 40px;
    text-align: center;
}

#a1-final-test-container .score-circle {
    width: 150px;
    height: 150px;
    margin: 0 auto 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#a1-final-test-container .grade-pass {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

#a1-final-test-container .grade-fail {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

#a1-final-test-container .feedback {
    margin: 20px 0;
    padding: 20px;
    border-radius: 8px;
    background: #f8f9fa;
    text-align: left;
    max-height: 500px;
    overflow-y: auto;
}

/* Feedback items */
.feedback-item {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 5px;
}

.feedback-header {
    margin-bottom: 10px;
}

.feedback-icon {
    margin-right: 10px;
}

.feedback-content {
    padding-left: 30px;
}

#a1-final-test-container .certificate-btn {
    background: linear-gradient(135deg, #ff8c00, #ff4500);
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    display: inline-block;
    margin-top: 20px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

#a1-final-test-container .certificate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 69, 0, 0.3);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2a5298;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* ======================================== */
/* SECTION AUDIO ET SYNTHÈSE VOCALE */
/* ======================================== */
.audio-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin: 20px;
    border: 2px solid #e9ecef;
}

.audio-section h2 {
    color: #2a5298;
    margin-top: 0;
    font-weight: 700;
}

.audio-section p {
    color: #666;
    margin-bottom: 20px;
}

.audio-test {
    background: #e6f2ff;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    border: 1px solid #cfe2ff;
}

.btn-test-audio {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-test-audio:hover {
    background: #218838;
    transform: translateY(-1px);
}

.audio-test-info {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

.audio-controls {
    text-align: center;
    margin: 20px 0;
}

.btn-audio-main {
    background: #2a5298;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin: 5px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-audio-main:hover {
    background: #1e3c72;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(42, 82, 152, 0.3);
}

.btn-audio-stop {
    background: #dc3545;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin: 5px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-audio-stop:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.audio-status {
    text-align: center;
    margin: 20px 0;
}

#currentText {
    font-style: italic;
    color: #666;
    margin-bottom: 10px;
}

.audio-indicator {
    display: flex;
    justify-content: center;
    gap: 3px;
    height: 30px;
}

.sound-bar {
    width: 4px;
    background: #2a5298;
    border-radius: 2px;
    animation: soundWave 0.5s ease-in-out infinite alternate;
}

.sound-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.sound-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.attempts {
    text-align: center;
    font-weight: bold;
    color: #2a5298;
    margin-top: 15px;
}

/* ======================================== */
/* PAGE "DÉJÀ RÉUSSI" */
/* ======================================== */
.already-passed {
    text-align: center;
    padding: 30px;
}

.passed-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.score-circle-large {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.test-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px auto;
    max-width: 500px;
    text-align: left;
}

.test-details p {
    margin: 10px 0;
}

.certificate-actions {
    margin: 30px 0;
}

.btn-certificate {
    background: linear-gradient(135deg, #ff8c00, #ff4500);
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    display: inline-block;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-certificate:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 69, 0, 0.3);
}

/* ======================================== */
/* RESPONSIVE */
/* ======================================== */
@media (max-width: 768px) {
    #a1-final-test-container .quiz-container {
        margin: 10px;
        border-radius: 10px;
    }
    
    #a1-final-test-container .quiz-header {
        padding: 20px 15px;
    }
    
    #a1-final-test-container .quiz-header h1 {
        font-size: 20px;
    }
    
    .instructions-section {
        padding: 20px 15px;
        margin: 15px;
    }
    
    .timer-section, .audio-section {
        margin: 15px;
        padding: 15px;
    }
    
    #a1-final-test-container .questions-container {
        padding: 15px;
    }
    
    #a1-final-test-container .question {
        padding: 15px;
    }
    
    #a1-final-test-container .options {
        margin: 15px 0 0 20px;
    }
    
    #a1-final-test-container .controls {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    #a1-final-test-container .btn {
        width: 100%;
        text-align: center;
    }
    
    .matching-pair {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .matching-equals {
        margin: 10px 0;
        align-self: center;
    }
    
    .matching-input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    #a1-final-test-container .quiz-header h1 {
        font-size: 18px;
    }
    
    .btn-start-exam {
        padding: 12px 25px;
        font-size: 16px;
    }
    
    #a1-final-test-container .timer {
        font-size: 14px;
        padding: 10px 15px;
        min-width: 150px;
    }
    
    .btn-audio-main, .btn-audio-stop {
        padding: 12px 20px;
        font-size: 14px;
    }
}