/* Quiz Specific Styles */
.back-link {
    display: inline-block;
    margin-top: 1rem;
    color: #5a4fcf;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

#quiz-container {
    max-width: 700px;
    margin: 1rem auto;
    padding: 1rem;
}

.quiz-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.quiz-card h2 {
    color: #5a4fcf;
    margin-bottom: 1rem;
    text-align: center;
}

/* High Score Display */
.high-score-box {
    text-align: center;
    padding: 0.75rem;
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    border-radius: 10px;
    margin-bottom: 1rem;
    color: #5d4037;
}

/* Settings */
.settings-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.setting-item label {
    font-weight: 500;
    color: #555;
}

.setting-item select {
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Weak Tenses Box */
.weak-tenses-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fff3e0;
    border-radius: 10px;
    border-left: 4px solid #ff9800;
}

.weak-tenses-box h4 {
    color: #e65100;
    margin-bottom: 0.5rem;
}

#weak-tenses-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.weak-tense-tag {
    padding: 0.3rem 0.6rem;
    background: #ffe0b2;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #e65100;
}

/* Tense Selector */
.tense-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.tense-btn {
    padding: 0.6rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.tense-btn:hover {
    border-color: #5a4fcf;
    color: #5a4fcf;
}

.tense-btn.selected {
    background: #5a4fcf;
    color: white;
    border-color: #5a4fcf;
}

/* Question Count */
.question-count {
    text-align: center;
    margin: 1.5rem 0;
}

.question-count label {
    margin-right: 0.5rem;
    font-weight: 500;
}

.question-count select {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

/* Buttons */
.primary-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 1.5rem auto 0;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.secondary-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 1rem auto 0;
    padding: 1rem 2rem;
    background: white;
    color: #5a4fcf;
    border: 2px solid #5a4fcf;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: #f0f0ff;
}

/* Quiz Header */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#question-counter {
    font-weight: 600;
    color: #666;
}

#score-display {
    font-weight: 600;
    color: #5a4fcf;
}

/* Streak Badge */
.streak-badge {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-weight: 600;
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Timer */
.timer-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    margin-bottom: 0.25rem;
    overflow: hidden;
}

.timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #ffc107 50%, #dc3545 100%);
    border-radius: 3px;
    transition: width 0.1s linear;
    width: 100%;
}

.timer-fill.warning {
    background: #ffc107;
}

.timer-fill.danger {
    background: #dc3545;
    animation: blink 0.5s ease infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.timer-text {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Question Area */
#question-area {
    margin-bottom: 1.5rem;
}

.question {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.context {
    color: #666;
    font-style: italic;
    font-size: 0.95rem;
}

/* Options */
.options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-btn {
    padding: 1rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-btn:hover:not(.disabled) {
    border-color: #5a4fcf;
    background: #f8f9ff;
}

.option-btn.selected {
    border-color: #5a4fcf;
    background: #f0f0ff;
}

.option-btn.correct {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
}

.option-btn.wrong {
    border-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
}

.option-btn.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.option-btn.show-correct {
    border-color: #28a745;
    background: #d4edda;
}

/* Feedback Area */
.feedback {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.feedback.correct {
    background: #d4edda;
    border: 2px solid #28a745;
}

.feedback.wrong {
    background: #f8d7da;
    border: 2px solid #dc3545;
}

#feedback-icon {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

#feedback-text {
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
}

/* Streak Bonus */
.streak-bonus {
    text-align: center;
    font-weight: 600;
    color: #ff6b6b;
    margin-bottom: 0.5rem;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Tense Info */
.tense-info {
    text-align: center;
    padding: 0.5rem;
    background: rgba(90, 79, 207, 0.1);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    color: #5a4fcf;
    font-weight: 500;
}

#explanation {
    font-size: 0.95rem;
    line-height: 1.6;
    padding: 1rem;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

/* Learn More Link */
.learn-more-link {
    display: block;
    text-align: center;
    color: #5a4fcf;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem;
    background: rgba(90, 79, 207, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.learn-more-link:hover {
    background: #5a4fcf;
    color: white;
}

/* Result Screen */
#result-screen {
    text-align: center;
}

#result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

#result-title {
    margin-bottom: 0.5rem;
}

#result-score {
    font-size: 1.5rem;
    color: #5a4fcf;
    font-weight: 700;
    margin-bottom: 1rem;
}

#result-message {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

#result-breakdown {
    text-align: left;
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9ff;
    border-radius: 12px;
}

#result-breakdown h3 {
    color: #5a4fcf;
    margin-bottom: 1rem;
}

#answers-summary {
    max-height: 300px;
    overflow-y: auto;
}

.answer-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.answer-item.correct {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.answer-item.wrong {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.answer-item .q-text {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.answer-item .a-text {
    font-size: 0.85rem;
    color: #555;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Responsive */
@media (max-width: 600px) {
    .quiz-card {
        padding: 1.5rem;
    }
    
    .quiz-header {
        font-size: 0.9rem;
    }
    
    .question {
        font-size: 1.1rem;
    }
    
    .tense-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }
}


/* New High Score Badge */
.new-high-score {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    color: #5d4037;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    animation: bounceIn 0.5s ease, glow 1.5s ease infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

/* Result Stats */
.result-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9ff;
    border-radius: 12px;
    min-width: 80px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #5a4fcf;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
}

/* Tense Tag in Answer Summary */
.a-info {
    margin: 0.25rem 0;
}

.tense-tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Result Recommendation */
.result-recommendation {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fff3e0;
    border-radius: 10px;
    border-left: 4px solid #ff9800;
}

.result-recommendation h4 {
    color: #e65100;
    margin-bottom: 0.5rem;
}

.result-recommendation p {
    color: #5d4037;
    margin-bottom: 0.75rem;
}

.recommend-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.recommend-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #ff9800;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.recommend-link:hover {
    background: #f57c00;
    transform: translateY(-2px);
}

/* Timer improvements */
.timer-fill.warning {
    background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%) !important;
}

.timer-fill.danger {
    background: linear-gradient(90deg, #dc3545 0%, #c62828 100%) !important;
    animation: blink 0.5s ease infinite;
}

/* Question type indicators */
.question::before {
    margin-right: 0.5rem;
}

/* Responsive improvements */
@media (max-width: 600px) {
    .result-stats {
        gap: 0.75rem;
    }
    
    .stat-item {
        min-width: 70px;
        padding: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .tense-selector {
        gap: 0.4rem;
    }
    
    .tense-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
}
