/* Quiz Specific Styles */

.quiz-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    min-height: 100vh;
    /* Ensure full height for centering */
}

.quiz-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeInUp 0.5s ease-out;
}

.icon-large {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    display: block;
}

.quiz-card h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.quiz-card p {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.action-btn {
    background: linear-gradient(135deg, var(--accent-color), #3a60cf);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(75, 123, 255, 0.3);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(75, 123, 255, 0.5);
    filter: brightness(1.1);
}

.action-btn:active {
    transform: translateY(0);
}

/* Quiz Screen Specifics */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #333;
    border-radius: 4px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.5s ease;
}

.question-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.question-text {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: white;
    min-height: 3.6rem;
    /* fixed height for 2 lines */
    display: flex;
    align-items: center;
    justify-content: center;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    padding: 1.5rem;
    border-radius: 15px;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.option-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.option-btn.selected {
    border-color: var(--accent-color);
    background: rgba(75, 123, 255, 0.1);
}

.option-btn.correct {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.2) !important;
    color: #2ecc71;
}

.option-btn.wrong {
    border-color: var(--danger-color);
    background: rgba(231, 76, 60, 0.2) !important;
    color: var(--danger-color);
    opacity: 0.8;
}

.option-btn:disabled {
    cursor: default;
    transform: none;
}

.feedback-msg {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    min-height: 1.5rem;
}

.feedback-msg.correct {
    color: #2ecc71;
}

.feedback-msg.wrong {
    color: var(--danger-color);
}

/* Final Score */
.final-score {
    font-size: 4rem;
    font-weight: 800;
    color: var(--accent-color);
    margin: 1rem 0 2rem;
    text-shadow: 0 0 30px rgba(75, 123, 255, 0.3);
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.5s ease-out forwards;
}

.hidden {
    display: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .quiz-container {
        padding: 1rem;
        align-items: flex-start;
        /* Allow scrolling from top */
        height: auto;
        min-height: 100vh;
    }

    .quiz-card {
        padding: 1.5rem;
        margin-top: 1rem;
        margin-bottom: 2rem;
        /* Space for scrolling */
        width: 100%;
        max-width: 100%;
    }

    .options-grid {
        grid-template-columns: 1fr;
        /* Stack buttons */
        gap: 1rem;
    }

    /* Keep 2 columns for flags if space permits, or maybe just stack for safety */
    .options-grid.flag-options {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .icon-large {
        font-size: 3rem;
        margin-bottom: 1rem;
    }

    .quiz-card h2 {
        font-size: 1.8rem;
    }

    .question-text {
        font-size: 1.4rem;
        min-height: auto;
        margin-bottom: 1.5rem;
    }

    .option-btn {
        padding: 1rem;
        font-size: 1.1rem;
        /* Readable text */
        min-height: 60px;
        /* Touch target */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .result-actions {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .action-btn {
        width: 100%;
        padding: 1rem;
    }

    .final-score {
        font-size: 3.5rem;
    }
}