/* TVPS-4 - Styles pour les bonnes réponses et fonctionnalités avancées */

/* ============================================
   1. BONNES RÉPONSES - SIGNALEMENT
   ============================================ */

/* Bouton de bonne réponse pour l'examinateur */
.answer-btn.correct-answer {
    border: 2px solid #28a745 !important;
    background-color: rgba(40, 167, 69, 0.1) !important;
    position: relative;
}

.answer-btn.correct-answer::after {
    content: "✓";
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #28a745;
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Animation subtile au survol */
.answer-btn.correct-answer:hover {
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

/* Feedback dynamique : réponse correcte sélectionnée */
.answer-btn.answer-correct {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* Feedback dynamique : réponse incorrecte sélectionnée */
.answer-btn.answer-incorrect {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* ============================================
   2. EXEMPLES - VALIDATION
   ============================================ */

/* Message d'erreur pour exemples échoués */
.examples-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-top: 1rem;
    display: none;
}

.examples-error.show {
    display: block;
}

.examples-error-icon {
    color: #dc3545;
    margin-right: 0.5rem;
}

/* Section exemples avec statut */
.examples-section.examples-validated {
    border-left: 4px solid #28a745;
    padding-left: 1rem;
}

.examples-section.examples-failed {
    border-left: 4px solid #dc3545;
    padding-left: 1rem;
}

/* Badge de validation des exemples */
.examples-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.examples-badge.success {
    background-color: #d4edda;
    color: #155724;
}

.examples-badge.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* ============================================
   3. RÈGLE DU PLAFOND (5/7 ERREURS)
   ============================================ */

/* Compteur d'erreurs */
.error-counter {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-left: 1rem;
}

.error-counter.warning {
    background-color: #fff3cd;
    color: #856404;
}

.error-counter.danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* Question désactivée (plafond atteint) */
.question-item.ceiling-reached {
    opacity: 0.5;
    pointer-events: none;
}

.question-item.ceiling-reached .answer-btn {
    cursor: not-allowed;
}

/* Message de plafond atteint */
.ceiling-message {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-top: 1rem;
    display: none;
}

.ceiling-message.show {
    display: block;
}

.ceiling-message-icon {
    color: #856404;
    margin-right: 0.5rem;
}

/* ============================================
   4. DÉPART ITEM 4 POUR 12+ ANS
   ============================================ */

/* Items crédités automatiquement (1-3 pour 12+ ans) */
.question-item.auto-credited {
    opacity: 0.6;
    position: relative;
}

.question-item.auto-credited::before {
    content: "Crédité";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
    white-space: nowrap;
}

.question-item.auto-credited .answer-group {
    pointer-events: none;
}

/* Toggle pour activer les items 1-3 */
.start-point-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #e9ecef;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.start-point-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.start-point-toggle label {
    margin: 0;
    cursor: pointer;
    font-size: 0.875rem;
}

/* Badge indicateur d'âge */
.age-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background-color: #17a2b8;
    color: white;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* ============================================
   5. UTILITAIRES
   ============================================ */

/* Animation de fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Transition smooth */
.smooth-transition {
    transition: all 0.3s ease;
}

/* ============================================
   6. AIDE CONTEXTUELLE
   ============================================ */

/* Toggle global d'aide */
.help-toggle-container {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
}

.help-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
}

.help-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #17a2b8;
}

/* Panneau d'aide par subtest */
.help-panel {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 1px solid #90caf9;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.help-panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.help-panel-icon {
    font-size: 1.25rem;
}

.help-panel-header strong {
    color: #1565c0;
    font-size: 1rem;
}

.help-panel-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.help-section {
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 0.25rem;
}

.help-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.help-consigne {
    font-style: italic;
    color: #2e7d32;
    margin: 0.25rem 0 0 0;
    font-size: 0.9rem;
}

.help-definition {
    color: #424242;
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
}

.help-exemple {
    color: #6d4c41;
    margin: 0.25rem 0 0 0;
    font-size: 0.85rem;
    background-color: #fff8e1;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border-left: 3px solid #ffc107;
}

/* Responsive */
@media (max-width: 768px) {
    .help-toggle-container {
        top: auto;
        bottom: 10px;
        right: 10px;
    }

    .help-panel-content {
        font-size: 0.8rem;
    }
}