/* Frontend Quiz Styles */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.quiz-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f1f1;
}

.quiz-header h3 {
    color: #333;
    font-size: 28px;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.quiz-timer {
    background: #ff6b6b;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    display: inline-block;
    font-size: 16px;
}

.quiz-timer.warning {
    background: #ff9500;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Question Styles */
.quiz-question {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.quiz-question:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #007cba;
}

.quiz-question h4 {
    color: #007cba;
    font-size: 18px;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.quiz-question p {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin: 0 0 20px 0;
}

/* Options Styles */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-options label {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    line-height: 1.4;
}

.quiz-options label:hover {
    background: #e3f2fd;
    border-color: #2196f3;
}

.quiz-options input[type="radio"] {
    margin: 0 12px 0 0;
    transform: scale(1.2);
    accent-color: #007cba;
}

.quiz-options label:has(input[type="radio"]:checked) {
    background: #e7f3ff;
    border-color: #007cba;
    font-weight: 600;
}

/* Submit Button */
.quiz-submit {
    text-align: center;
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px solid #f1f1f1;
}

.quiz-submit-btn {
    background: linear-gradient(135deg, #007cba, #005a87);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,124,186,0.3);
}

.quiz-submit-btn:hover {
    background: linear-gradient(135deg, #005a87, #004065);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,124,186,0.4);
}

.quiz-submit-btn:active {
    transform: translateY(0);
}

.quiz-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Results Styles */
.quiz-results {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

.quiz-results h3 {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
}

.results-content {
    margin: 20px 0;
}

.score-display {
    font-size: 48px;
    font-weight: bold;
    margin: 20px 0;
    padding: 20px;
    border-radius: 8px;
}

.score-excellent {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
}

.score-good {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
}

.score-average {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
}

.score-poor {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
}

.results-message {
    font-size: 18px;
    margin: 15px 0;
    line-height: 1.6;
}

.quiz-restart-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.quiz-restart-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* Loading States */
.quiz-loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.quiz-loading:after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #007cba;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error States */
.quiz-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    margin: 15px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .quiz-container {
        margin: 10px;
        padding: 15px;
    }
    
    .quiz-header h3 {
        font-size: 24px;
    }
    
    .quiz-question {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .quiz-question h4 {
        font-size: 16px;
    }
    
    .quiz-question p {
        font-size: 15px;
    }
    
    .quiz-options label {
        padding: 12px;
        font-size: 14px;
    }
    
    .quiz-submit-btn {
        padding: 12px 30px;
        font-size: 16px;
    }
    
    .quiz-timer {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .score-display {
        font-size: 36px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .quiz-options {
        gap: 10px;
    }
    
    .quiz-options label {
        padding: 10px;
        font-size: 13px;
    }
    
    .quiz-question {
        padding: 15px;
    }
    
    .quiz-submit-btn {
        width: 100%;
        padding: 15px;
    }
    
    .quiz-restart-btn {
        width: 100%;
        padding: 12px;
    }
}

/* Animation for question transitions */
.quiz-question {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus styles for accessibility */
.quiz-options input[type="radio"]:focus + label {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.quiz-submit-btn:focus,
.quiz-restart-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .quiz-timer,
    .quiz-submit,
    .quiz-restart-btn {
        display: none;
    }
    
    .quiz-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}