/* Quiz Styles - WordPress Compatible */

/* Quiz Container */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Quiz Header */
.quiz-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.quiz-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.quiz-subtitle {
    color: #6b7280;
    font-size: 1rem;
}

/* Quiz Progress */
.quiz-progress {
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Question Section */
.question-section {
    margin-bottom: 2rem;
}

.question-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 0.5rem;
}

.question-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.question-image {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Options */
.options-container {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.option {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.option:hover {
    border-color: #3b82f6;
    background-color: #eff6ff;
    transform: translateY(-1px);
}

.option.selected {
    border-color: #3b82f6;
    background-color: #dbeafe;
}

.option.correct {
    border-color: #10b981;
    background-color: #d1fae5;
}

.option.incorrect {
    border-color: #ef4444;
    background-color: #fee2e2;
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background-color: #f3f4f6;
    border-radius: 50%;
    font-weight: 600;
    color: #374151;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.option.selected .option-letter {
    background-color: #3b82f6;
    color: white;
}

.option.correct .option-letter {
    background-color: #10b981;
    color: white;
}

.option.incorrect .option-letter {
    background-color: #ef4444;
    color: white;
}

.option-text {
    flex: 1;
    font-size: 1rem;
    color: #374151;
    line-height: 1.5;
}

/* Timer */
.timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: #374151;
}

.timer.warning {
    background-color: #fef3c7;
    color: #d97706;
}

.timer.danger {
    background-color: #fee2e2;
    color: #dc2626;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Navigation Buttons */
.quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.nav-button {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 0.875rem;
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #4b5563;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #059669;
}

/* Results Section */
.results-container {
    text-align: center;
    padding: 2rem;
}

.results-score {
    font-size: 3rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.results-message {
    font-size: 1.25rem;
    color: #374151;
    margin-bottom: 2rem;
}

.results-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-item {
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.result-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.error-message {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Explanation */
.explanation {
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.explanation-title {
    font-weight: 600;
    color: #0369a1;
    margin-bottom: 0.5rem;
}

.explanation-text {
    color: #374151;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .quiz-container {
        padding: 1rem;
        margin: 1rem;
    }
    
    .quiz-title {
        font-size: 1.5rem;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    .option {
        padding: 0.75rem;
    }
    
    .option-text {
        font-size: 0.875rem;
    }
    
    .quiz-navigation {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .nav-button {
        width: 100%;
    }
    
    .results-details {
        grid-template-columns: 1fr;
    }
}

/* WordPress Integration Utilities */
.wp-quiz-wrapper {
    margin: 2rem 0;
}

.wp-quiz-wrapper .quiz-container {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* RTL Support */
[dir="rtl"] .option-letter {
    margin-left: 0;
    margin-right: 0.75rem;
}

[dir="rtl"] .quiz-navigation {
    direction: rtl;
}

/* Accessibility */
.option:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.nav-button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .quiz-navigation,
    .timer {
        display: none;
    }
    
    .quiz-container {
        box-shadow: none;
        border: 1px solid #000;
    }
}