/* Enhanced Quiz Styling - Add to your existing CSS */

/* Improved Quiz Progress Bar */
.quiz-progress-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.quiz-progress-track {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 4px;
}

.quiz-progress-segment {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.quiz-progress-segment.completed {
    background: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
}

.quiz-progress-segment.current {
    background: #ffc107;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.4);
    animation: pulse 2s infinite;
}

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

/* Enhanced Question Cards */
.quiz-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.quiz-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(0,123,255,0.1), rgba(0,123,255,0.05));
    transition: width 0.3s ease;
}

.quiz-option:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
}

.quiz-option:hover::before {
    width: 100%;
}

.quiz-option.selected {
    border-color: #007bff;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    box-shadow: 0 4px 15px rgba(0,123,255,0.2);
}

.quiz-option.selected::before {
    width: 100%;
    background: linear-gradient(90deg, rgba(0,123,255,0.2), rgba(0,123,255,0.1));
}

/* Improved Result Cards */
.quiz-score-display {
    position: relative;
    overflow: hidden;
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    margin-bottom: 25px;
}

.quiz-score-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #28a745, #20c997, #17a2b8);
}

.score-percentage {
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #007bff, #0056b3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin: 20px 0 !important;
}

/* Navigation Buttons Enhancement */
.nav-btn {
    position: relative;
    overflow: hidden;
    border-radius: 8px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease !important;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.nav-btn:hover::before {
    left: 100%;
}

/* Loading Animation Enhancement */
#quizLoading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Welcome Modal Enhancements */
#welcomeModal {
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 20px 25px;
}

/* Review Section Improvements */
.review-item {
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    border-left: 4px solid #dee2e6;
}

.review-item.correct-answer {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
}

.review-item.incorrect-answer {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
}

.review-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Answer Filter Buttons */
.filter-btn {
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.875rem;
    border: 2px solid #dee2e6;
    background: white;
    color: #6c757d;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

.filter-btn:hover:not(.active) {
    border-color: #007bff;
    color: #007bff;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .quiz-option {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .score-percentage {
        font-size: 2rem !important;
    }
    
    .nav-btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .navigation-options {
        flex-direction: column;
        gap: 10px;
    }
}

/* Accessibility Improvements */
.quiz-option:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

.nav-btn:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

/* Animations for better UX */
.quiz-card-enter {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.result-enter {
    animation: fadeInScale 0.6s ease-out;
}

@keyframes fadeInScale {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
