/* ── Quiz Shared Styles (Outfit font loaded in HTML) ── */

.quiz-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    min-height: 100vh;
}

.quiz-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    animation: fadeInUp 0.5s ease-out;
}

.icon-large {
    font-size: 4.5rem;
    margin-bottom: 1.25rem;
    display: block;
    animation: iconBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes iconBounce {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.quiz-card h2 {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
    font-weight: 700;
}

.quiz-card > p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* ── Mode Selection ── */
.mode-selection {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.action-btn {
    background: linear-gradient(135deg, var(--accent-color), #3a60cf);
    color: white;
    border: none;
    padding: 0.9rem 2.5rem;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(75, 123, 255, 0.3);
    font-family: inherit;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(75, 123, 255, 0.5);
    filter: brightness(1.1);
}

.action-btn:active { transform: translateY(-1px); }

.action-btn:disabled {
    opacity: 0.4;
    cursor: default;
    filter: grayscale(0.6);
    transform: none !important;
    box-shadow: none !important;
}

/* ── Progress Bar ── */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #7c3aed);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(75, 123, 255, 0.4);
}

/* ── Question Header ── */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.question-text {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: white;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
}

/* ── Options ── */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    padding: 1.25rem;
    border-radius: 14px;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

.option-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(75, 123, 255, 0.2);
}

.option-btn.selected {
    border-color: var(--accent-color);
    background: rgba(75, 123, 255, 0.1);
}

/* Correct: green glow + bounce */
.option-btn.correct {
    border-color: #2ecc71 !important;
    background: rgba(46, 204, 113, 0.18) !important;
    color: #2ecc71 !important;
    animation: correctBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes correctBounce {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Wrong: red + shake */
.option-btn.wrong {
    border-color: var(--danger-color, #e74c3c) !important;
    background: rgba(231, 76, 60, 0.18) !important;
    color: var(--danger-color, #e74c3c) !important;
    animation: wrongShake 0.4s ease;
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    20%  { transform: translateX(-6px); }
    40%  { transform: translateX(6px); }
    60%  { transform: translateX(-4px); }
    80%  { transform: translateX(4px); }
}

.option-btn:disabled { cursor: default; transform: none; }

/* ── Feedback ── */
.feedback-msg {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    min-height: 1.5rem;
    animation: feedbackIn 0.3s ease;
}

@keyframes feedbackIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.feedback-msg.correct { color: #2ecc71; }
.feedback-msg.wrong   { color: var(--danger-color, #e74c3c); }

/* ── Final Score ── */
.final-score {
    font-size: 4.5rem;
    font-weight: 800;
    color: var(--accent-color);
    margin: 1rem 0 2rem;
    text-shadow: 0 0 40px rgba(75, 123, 255, 0.35);
    animation: scorePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

@keyframes scorePop {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.submit-section {
    margin-bottom: 1.5rem;
    min-height: 2rem;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* ── Animations ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeInUp 0.5s ease-out forwards; }
.hidden  { display: none !important; }

/* ── Navigation helpers (back links / quit row) ── */
.quiz-exit-row,
.card-back-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.quiz-exit-link,
.card-back-link {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.quiz-exit-link:hover,
.card-back-link:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.quiz-exit-sep {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .quiz-container {
        padding: 1rem;
        align-items: flex-start;
        height: auto;
        min-height: 100vh;
    }
    .quiz-card {
        padding: 1.5rem;
        margin-top: 1rem;
        margin-bottom: 2rem;
        width: 100%;
        border-radius: 18px;
    }
    .options-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .options-grid.flag-options {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }
    .icon-large { font-size: 3rem; margin-bottom: 1rem; }
    .quiz-card h2 { font-size: 1.7rem; }
    .question-text {
        font-size: 1.35rem;
        min-height: auto;
        margin-bottom: 1.25rem;
    }
    .option-btn {
        padding: 1rem;
        min-height: 56px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .result-actions {
        flex-direction: column;
        width: 100%;
    }
    .action-btn {
        width: 100%;
        padding: 1rem;
        text-align: center;
    }
    .final-score { font-size: 3.5rem; }
}
