/* Quiz Container Styles */
.quiz-card {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    padding: 24px;
    margin: 20px 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.quiz-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.quiz-card.correct {
    border-color: #4caf50;
    background: linear-gradient(135deg, #f1f8e9 0%, #ffffff 100%);
}

.quiz-card.incorrect {
    border-color: #ff9800;
    background: linear-gradient(135deg, #fff3e0 0%, #ffffff 100%);
}

.quiz-card.failed {
    border-color: #f44336;
    background: linear-gradient(135deg, #ffebee 0%, #ffffff 100%);
}

/* Header */
.quiz-header-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.quiz-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.attempt-counter {
    font-size: 0.9em;
    color: #666;
    background: #f5f5f5;
    padding: 6px 12px;
    border-radius: 15px;
}

.attempt-counter.danger {
    color: #f44336;
    background: #ffebee;
    font-weight: bold;
}

/* Question */
.quiz-question {
    font-size: 1.15em;
    line-height: 1.7;
    color: #333;
    margin-bottom: 20px;
}

.quiz-question .blank {
    display: inline-block;
    min-width: 100px;
    border-bottom: 2px dashed #667eea;
    margin: 0 4px;
    text-align: center;
    font-weight: bold;
    color: #667eea;
    transition: all 0.3s ease;
}

.quiz-question .blank.filled {
    border-bottom-style: solid;
    color: #4caf50;
}

.quiz-question .blank.filled-wrong {
    border-bottom-color: #f44336;
    color: #f44336;
}

/* Input Area */
.quiz-input-area {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.quiz-input {
    flex: 1;
    min-width: 200px;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.quiz-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.quiz-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.quiz-input.shake {
    animation: shake 0.5s ease;
    border-color: #f44336;
}

/* Buttons */
.quiz-submit, .quiz-retry {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.quiz-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.quiz-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.quiz-retry {
    background: #ff9800;
    color: white;
}

.quiz-retry:hover {
    background: #f57c00;
    transform: translateY(-2px);
}

/* Multiple Choice Options */
.quiz-options {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.quiz-option {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.quiz-option:hover:not(.disabled):not(.selected) {
    background: #e3f2fd;
    border-color: #667eea;
    transform: translateX(5px);
}

.quiz-option.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.quiz-option.correct {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
    animation: pulse 0.5s ease;
}

.quiz-option.incorrect {
    background: #f44336;
    color: white;
    border-color: #f44336;
    animation: shake 0.5s ease;
}

.quiz-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.quiz-option .option-marker {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 2px solid currentColor;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    margin-right: 12px;
    font-size: 0.9em;
    font-weight: bold;
}

/* Hint */
.quiz-hint {
    background: #fff9c4;
    border-left: 4px solid #ffc107;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 8px;
    font-size: 0.95em;
    color: #5d4037;
    animation: slideDown 0.3s ease;
}

/* Feedback */
.quiz-feedback {
    margin-top: 16px;
    padding: 16px;
    border-radius: 12px;
    animation: slideDown 0.3s ease;
}

.quiz-feedback.success {
    background: #c8e6c9;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.quiz-feedback.error {
    background: #ffcdd2;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.quiz-feedback.warning {
    background: #ffe0b2;
    color: #e65100;
    border-left: 4px solid #ff9800;
}

.feedback-content {
    font-size: 1.05em;
    line-height: 1.6;
}

.correct-answer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(0,0,0,0.1);
    font-weight: bold;
}

/* Status Bar */
.quiz-status {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    color: #666;
}

.quiz-status .success { color: #4caf50; }
.quiz-status .error { color: #f44336; }
.quiz-status .warning { color: #ff9800; }

 
/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Confetti */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #f0f;
    pointer-events: none;
    z-index: 9999;
    animation: fall linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Progress Indicator for Article */
.quiz-progress {
    position: sticky;
    top: 20px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    z-index: 100;
}

.quiz-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.5s ease;
}

/* Quiz Section Toggle */
.quiz-section {
    margin: 30px 0;
}

.quiz-section h3 {
    margin-bottom: 16px;
 }

.quiz-reveal-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.quiz-reveal-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;
}

.quiz-reveal-btn:hover::before {
    left: 100%;
}

.quiz-reveal-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.quiz-reveal-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.quiz-reveal-btn .btn-icon {
    font-size: 1.4em;
    line-height: 1;
    order: -1;
}

.quiz-reveal-btn .btn-text {
    font-size: 1em;
    letter-spacing: 0.3px;
}

.quiz-section-content {
    margin-top: 20px;
    animation: slideDown 0.4s ease;
}

.quiz-section-content.hidden {
    display: none;
}

/* Dark Mode Support */
.dark .quiz-card {
    background: #1f2937;
    border-color: #374151;
}

.dark .quiz-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.dark .quiz-card.correct {
    border-color: #4caf50;
    background: linear-gradient(135deg, #1e3a20 0%, #1f2937 100%);
}

.dark .quiz-card.incorrect {
    border-color: #ff9800;
    background: linear-gradient(135deg, #3a2c1e 0%, #1f2937 100%);
}

.dark .quiz-card.failed {
    border-color: #f44336;
    background: linear-gradient(135deg, #3a1e1e 0%, #1f2937 100%);
}

.dark .quiz-badge {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
}

.dark .attempt-counter {
    color: #9ca3af;
    background: #374151;
}

.dark .attempt-counter.danger {
    color: #fca5a1;
    background: #7f1d1d;
}

.dark .quiz-question {
    color: #e5e7eb;
}

.dark .quiz-question .blank {
    border-bottom-color: #8b5cf6;
    color: #a78bfa;
}

.dark .quiz-input {
    background: #111827;
    border-color: #4b5563;
    color: #e5e7eb;
}

.dark .quiz-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.dark .quiz-input:disabled {
    background: #374151;
}

.dark .quiz-submit {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
}

.dark .quiz-submit:hover:not(:disabled) {
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.4);
}

.dark .quiz-submit:disabled {
    background: #6b7280;
}

.dark .quiz-option {
    background: #374151;
    border-color: #4b5563;
}

.dark .quiz-option:hover:not(.disabled):not(.selected) {
    background: #1e3a5f;
    border-color: #8b5cf6;
}

.dark .quiz-option.selected {
    background: #7c3aed;
    border-color: #7c3aed;
}

.dark .quiz-hint {
    background: #451a03;
    border-left-color: #f59e0b;
    color: #fef3c7;
}

.dark .quiz-feedback.success {
    background: #064e3b;
    color: #d1fae5;
    border-left-color: #10b981;
}

.dark .quiz-feedback.error {
    background: #7f1d1d;
    color: #fecaca;
    border-left-color: #ef4444;
}

.dark .quiz-feedback.warning {
    background: #451a03;
    color: #fed7aa;
    border-left-color: #f59e0b;
}

.dark .quiz-status {
    border-top-color: #374151;
    color: #9ca3af;
}

.dark .quiz-progress {
    background: #1f2937;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.dark .quiz-progress-bar {
    background: #374151;
}

.dark .quiz-section h3 {
    color: #e5e7eb;
}

.dark .quiz-reveal-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%) !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.dark .quiz-reveal-btn:hover {
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .quiz-card {
        padding: 16px;
    }
    
    .quiz-input-area {
        flex-direction: column;
    }
    
    .quiz-input {
        width: 100%;
    }
    
    .quiz-submit, .quiz-retry {
        width: 100%;
    }
    
    .quiz-reveal-btn {
        width: 100%;
        justify-content: center;
    }
}