/* Quiz Manager Frontend Styles */

.quiz-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.quiz-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #0073aa;
}

.quiz-title {
    color: #0073aa;
    margin-bottom: 15px;
}

.quiz-description {
    color: #666;
    line-height: 1.6;
}

.quiz-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 5px;
}

.quiz-info-item {
    font-size: 14px;
}

.quiz-timer {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
}

.timer-display {
    font-size: 24px;
    font-weight: bold;
    color: #d32f2f;
}

.quiz-question {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-left: 4px solid #0073aa;
    border-radius: 5px;
}

.question-header {
    margin-bottom: 15px;
}

.question-title {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.question-points {
    color: #0073aa;
    font-size: 14px;
    font-weight: normal;
}

.question-content {
    margin-bottom: 15px;
}

.question-description {
    color: #666;
    line-height: 1.6;
}

.question-answers {
    margin: 15px 0;
}

.answer-option {
    margin-bottom: 12px;
    padding: 12px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.answer-option:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.answer-option label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0;
}

.answer-option input[type="radio"],
.answer-option input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

.answer-image {
    max-width: 100px;
    height: auto;
    border-radius: 4px;
}

.answer-text {
    flex: 1;
}

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

.quiz-submit-btn {
    padding: 12px 40px;
    font-size: 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.quiz-submit-btn:hover {
    background: #005177;
}

/* Quiz results */
.quiz-results {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.results-summary {
    margin-bottom: 20px;
}

.result-status {
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
}

.result-status.passed {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result-status.failed {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.result-score {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.score-item {
    text-align: center;
    padding: 15px;
    background: #fff;
    border-radius: 5px;
    min-width: 120px;
}

.score-value {
    font-size: 32px;
    font-weight: bold;
    color: #0073aa;
    display: block;
}

.score-label {
    color: #666;
    font-size: 14px;
}

/* Question results */
.question-result {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 5px;
}

.question-result.correct {
    border-left: 4px solid #4caf50;
}

.question-result.incorrect {
    border-left: 4px solid #f44336;
}

.result-icon {
    display: inline-block;
    margin-right: 10px;
    font-weight: bold;
}

.result-icon.correct {
    color: #4caf50;
}

.result-icon.incorrect {
    color: #f44336;
}

.question-explanation {
    margin-top: 10px;
    padding: 10px;
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
    border-radius: 3px;
}

.quiz-retake-btn {
    display: block;
    margin: 20px auto 0;
    padding: 10px 30px;
}

/* Error messages */
.quiz-error {
    padding: 15px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    margin: 20px 0;
}

/* Correct answer highlighting */
.answer-option.user-answer {
    background: #e3f2fd;
    border-color: #2196f3;
}

.answer-option.correct-answer {
    background: #e8f5e9;
    border-color: #4caf50;
}

.answer-option.wrong-answer {
    background: #ffebee;
    border-color: #f44336;
}

/* Responsive design */
@media (max-width: 768px) {
    .quiz-container {
        padding: 15px;
        margin: 10px;
    }

    .quiz-info {
        flex-direction: column;
        gap: 10px;
    }

    .answer-option label {
        flex-direction: column;
        align-items: flex-start;
    }

    .answer-image {
        max-width: 100%;
    }
}

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

.quiz-submit-btn.loading::after {
    content: '...';
    animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}
