/* Renderização refinada de fórmulas KaTeX e Notação Química */
.katex {
    font-size: 1.05em !important;
    text-rendering: auto;
}

.katex-display {
    margin: 0.75em 0 !important;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.25rem 0;
}

/* Suporte visual para Tabelas Químicas na íntegra */
.math-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.825rem;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
}

.math-content th {
    background-color: #f8fafc;
    color: #0f172a;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    padding: 0.5rem 0.75rem;
    text-align: center;
}

.math-content td {
    border: 1px solid #e2e8f0;
    padding: 0.45rem 0.75rem;
    color: #334155;
}

.math-content tr:nth-child(even) td {
    background-color: #f8fafc;
}

/* Suporte visual para Imagens, Gráficos e Diagramas Estruturais */
.math-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 0.5rem 0;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    display: block;
}

.math-content figure {
    margin: 0.75rem 0;
    text-align: center;
}

.math-content figcaption {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
    font-style: italic;
}

.math-content sub, .math-content sup {
    font-size: 0.75em;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

.math-content sub {
    bottom: -0.25em;
}

.math-content sup {
    top: -0.5em;
}

/* Transições suaves */
.transition-smooth {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}


/* Estilo para alternativas clicáveis */
.alt-btn {
    transition: all 0.15s ease-in-out;
}

.alt-btn:hover:not(.disabled) {
    border-color: #94a3b8;
    background-color: #f8fafc;
    transform: translateX(2px);
}

.alt-btn.correct {
    border-color: #22c55e !important;
    background-color: #f0fdf4 !important;
    color: #15803d !important;
}

.alt-btn.correct .alt-badge {
    background-color: #22c55e !important;
    color: #ffffff !important;
}

.alt-btn.wrong {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    color: #b91c1c !important;
}

.alt-btn.wrong .alt-badge {
    background-color: #ef4444 !important;
    color: #ffffff !important;
}

/* Animação suave para toasts */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast {
    animation: slideInUp 0.25s ease-out forwards;
}

/* Análise de Distratores */
.distrator-item {
    border-left-width: 3px;
    padding-left: 0.75rem;
    margin-top: 0.35rem;
}

.distrator-item.correct {
    border-color: #22c55e;
    background-color: rgba(34, 197, 94, 0.05);
}

.distrator-item.wrong {
    border-color: #f87171;
    background-color: rgba(248, 113, 113, 0.05);
}

/* Estilos Especiais para Impressão em PDF / Folha de Prova */
@media print {
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt !important;
    }

    header, footer, section:first-of-type, #simulado-floating-bar, #pagination-wrapper, .topic-pill, button, #toast-container {
        display: none !important;
    }

    .no-print {
        display: none !important;
    }

    .page-break {
        page-break-before: always;
    }

    article {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #cccccc !important;
        margin-bottom: 1.5rem !important;
        padding: 1rem !important;
    }
}
