/* ── Editor Gutenberg: Quiz de Perguntas ── */

.mc-quiz-pergunta-editor {
    padding: 16px;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    background: #f9fafb;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mc-quiz-pergunta-editor__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.mc-quiz-pergunta-editor__badge {
    font-weight: 700;
    font-size: 13px;
    color: #374151;
}

.mc-quiz-pergunta-editor__mode {
    font-size: 11px;
    color: #6b7280;
    background: #e5e7eb;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Frontend: Quiz de Perguntas ── */

/* ─── Overlay: glass cobrindo tela inteira ─── */
.mqp-wrap--overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.mqp-wrap--overlay .mqp-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 0;
}

/* ─── Fullpage: cor sólida cobrindo tela inteira ─── */
.mqp-wrap--fullpage {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.mqp-backdrop-fullpage {
    position: fixed;
    inset: 0;
    z-index: 0;
}

/* ─── Inline: centralizado no conteúdo ─── */
.mqp-wrap--inline {
    margin: 32px auto;
    max-width: 700px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.mqp-wrap--inline .mqp-card {
    border-radius: 0;
    box-shadow: none;
    border: none;
}

/* ─── Card ─── */
.mqp-card {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    box-sizing: border-box;
    animation: mqpFadeIn 0.35s ease;
}

@keyframes mqpFadeIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ─── Progress bar ─── */
.mqp-progress {
    height: 4px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 32px;
}

.mqp-progress-bar {
    height: 100%;
    background: var(--color-scheme, #6d28d9);
    border-radius: 99px;
    transition: width 0.3s ease;
}

/* ─── Step ─── */
.mqp-step {
    display: none;
}

.mqp-step.mqp-step--active {
    display: block;
}

/* ─── Título da pergunta ─── */
.mqp-question-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 20px;
    line-height: 1.4;
}

/* ─── Opções ─── */
.mqp-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.mqp-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px;
    background: var(--color-scheme, #6d28d9);
    color: #fff !important;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease;
    min-height: 44px;
    touch-action: manipulation;
    text-align: left;
}

.mqp-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.mqp-btn:active {
    transform: scale(0.98);
}

.mqp-btn svg {
    flex-shrink: 0;
    margin-left: 12px;
}

/* ─── Processamento ─── */
.mqp-processing {
    display: none;
    text-align: center;
    padding: 60px 20px;
}

.mqp-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top-color: var(--color-scheme, #6d28d9);
    border-radius: 50%;
    animation: mqpSpin 0.9s linear infinite;
    margin: 0 auto 20px;
}

@keyframes mqpSpin {
    to { transform: rotate(360deg); }
}

.mqp-processing-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.mqp-processing-sub {
    font-size: 0.85rem;
    color: #9ca3af;
}

/* ─── Resultado ─── */
.mqp-result {
    display: none;
    text-align: center;
    padding: 40px 20px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.mqp-result.mqp-result--visible {
    opacity: 1;
    transform: translateY(0);
}

.mqp-result-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 24px;
    line-height: 1.4;
}

.mqp-reward-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: linear-gradient(135deg, var(--color-scheme, #6d28d9), #a855f7);
    color: #fff;
    padding: 18px 32px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    min-width: 260px;
    box-shadow: 0 8px 24px rgba(109, 40, 217, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    border: none;
}

.mqp-reward-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(109, 40, 217, 0.45);
    color: #fff;
    text-decoration: none;
}

.mqp-reward-btn .mqp-arrow {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.mqp-reward-btn:hover .mqp-arrow {
    transform: translateX(5px);
}

.mqp-disclaimer {
    margin-top: 18px;
    font-size: 0.82rem;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 8px;
    padding: 10px 16px;
}

/* ─── Animação saída ─── */
@keyframes mqpFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* ─── body bloqueado ─── */
body.quiz-active {
    overflow: hidden;
}

/* ─── Responsivo ─── */
@media (max-width: 768px) {
    .mqp-card {
        padding: 30px 20px;
        border-radius: 15px;
        max-height: 85vh;
    }
}

@media (max-width: 480px) {
    .mqp-wrap--overlay,
    .mqp-wrap--fullpage {
        padding: 10px;
        align-items: flex-start;
        padding-top: max(10px, 5vh);
    }

    .mqp-card {
        padding: 25px 15px;
        border-radius: 12px;
        max-height: 90vh;
    }

    .mqp-question-title {
        font-size: 1rem;
        line-height: 1.4;
    }

    .mqp-btn {
        font-size: 0.75rem;
        padding-left: 12px;
        padding-right: 12px;
    }

    .mqp-reward-btn {
        min-width: auto;
        width: 100%;
    }
}
