/**
 * Quiz Frontend Styles
 * 
 * @package InspireCorp_ELearning
 * @since 1.1.0
 */

/* Quiz Container */
.inspirecorp-quiz {
    background: #f9f9f9;
    border: 2px solid #ddd;
    padding: 30px;
    margin: 40px 0;
    border-radius: 8px;
}

/* Quiz Already Passed */
.quiz-already-passed {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #d4edda;
    border: 2px solid #28a745;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.quiz-passed-icon {
    font-size: 48px;
    color: #28a745;
    font-weight: bold;
}

.passed-title {
    display: block;
    font-size: 18px;
    color: #155724;
    margin-bottom: 8px;
}

.passed-score {
    font-size: 16px;
    color: #155724;
}

.score-value {
    font-weight: bold;
    font-size: 20px;
}

/* Quiz Questions */
.quiz-question {
    background: white;
    padding: 25px;
    margin-bottom: 25px;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.question-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.6;
    color: #333;
}

/* Quiz Answers */
.quiz-answers {
    margin-top: 15px;
}

.quiz-answer-label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin: 8px 0;
    cursor: pointer;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    transition: all 0.2s ease;
}

.quiz-answer-label:hover {
    background: #f0f0f0;
    border-color: #0073aa;
}

.quiz-answer-input {
    margin: 0 12px 0 0;
    cursor: pointer;
}

.answer-text {
    flex: 1;
    font-size: 16px;
    line-height: 1.5;
}

/* Quiz Actions */
.quiz-actions {
    margin-top: 30px;
    text-align: center;
}

.submit-quiz-btn,
.try-again-btn,
.mark-finished-btn {
    background: #0073aa;
    color: white;
    padding: 14px 40px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.submit-quiz-btn:hover,
.try-again-btn:hover {
    background: #005a87;
}

.submit-quiz-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.mark-finished-btn {
    background: #28a745;
}

.mark-finished-btn:hover {
    background: #218838;
}

/* Quiz Results */
.quiz-results {
    margin-top: 30px;
}

.quiz-score-display {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.quiz-results.passed .quiz-score-display {
    background: #d4edda;
    border: 2px solid #28a745;
}

.quiz-results.failed .quiz-score-display {
    background: #f8d7da;
    border: 2px solid #dc3545;
}

.score-icon {
    font-size: 48px;
    font-weight: bold;
}

.quiz-results.passed .score-icon::before {
    content: "✓";
    color: #28a745;
}

.quiz-results.failed .score-icon::before {
    content: "✗";
    color: #dc3545;
}

.score-info {
    flex: 1;
}

.score-main {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 8px;
}

.quiz-results.passed .score-main {
    color: #155724;
}

.quiz-results.failed .score-main {
    color: #721c24;
}

.score-percentage {
    margin-left: 8px;
}

.score-message {
    font-size: 16px;
    margin: 8px 0;
}

.quiz-results.passed .score-message {
    color: #155724;
}

.quiz-results.failed .score-message {
    color: #721c24;
}

.min-score-info {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
}

.min-score-value {
    font-weight: bold;
}

/* Result Actions */
.result-actions {
    text-align: center;
}

/* Mark as Finished */
.mark-finished-wrapper {
    margin-top: 30px;
    text-align: center;
}

.module-completed-notice {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
}

/* Loading State */
.quiz-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* RTL Support (for .contentrtl class) */
.contentrtl .inspirecorp-quiz {
    direction: rtl;
    text-align: right;
}

.contentrtl .quiz-answer-label {
    flex-direction: row-reverse;
}

.contentrtl .quiz-answer-input {
    margin: 0 0 0 12px;
}

.contentrtl .quiz-question {
    border-left: none;
    border-right: 4px solid #0073aa;
}

.contentrtl .quiz-score-display {
    flex-direction: row-reverse;
}

/* Responsive */
@media (max-width: 768px) {
    .inspirecorp-quiz {
        padding: 20px;
        margin: 20px 0;
    }
    
    .quiz-question {
        padding: 20px;
    }
    
    .question-text {
        font-size: 16px;
    }
    
    .answer-text {
        font-size: 15px;
    }
    
    .submit-quiz-btn,
    .try-again-btn,
    .mark-finished-btn {
        width: 100%;
        padding: 12px;
    }
    
    .quiz-score-display {
        flex-direction: column;
        text-align: center;
    }
}
