/* FDP Flashcard — table & fraction display styles */

/* ─── Fraction display helper ───────────────────────────────────── */
.fc-frac {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    line-height: 1.1;
}

.fc-frac-num {
    border-bottom: 1.5px solid currentColor;
    padding: 0 4px 2px;
}

.fc-frac-den {
    padding: 2px 4px 0;
}

/* ─── FDP Table ─────────────────────────────────────────────────── */
.fc-fdp-tbl {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0.8rem 0;
}

.fc-fdp-tbl th {
    background: rgba(168, 85, 247, 0.08);
    color: #7c3aed;
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    border-bottom: 2px solid rgba(168, 85, 247, 0.15);
}

.fc-fdp-tbl tbody tr + tr .fc-fdp-cell {
    border-top: 1px solid #e2e8f0;
}

.fc-fdp-cell {
    padding: 14px 10px;
    text-align: center;
    vertical-align: middle;
}

.fc-fdp-given {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #1e293b;
}

/* Field wrap for inline % label */
.fc-fdp-field-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.fc-fdp-pct-label {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #64748b;
}

/* MathLive field in table cell — used for ALL input columns */
.fc-fdp-math {
    width: 90px;
    min-height: 36px;
    font-size: 1.1rem;
    text-align: center;
    --caret-color: #a855f7;
    border-radius: 8px;
    border: 2px solid #cbd5e1;
    background: #fff;
}

.fc-fdp-math:focus-within {
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

/* Hide MathLive menu and keyboard toggle buttons */
.fc-fdp-math::part(menu-toggle) {
    display: none !important;
}

.fc-fdp-math::part(virtual-keyboard-toggle) {
    display: none !important;
}

/* Centre the content inside math-field */
.fc-fdp-math::part(content) {
    justify-content: center;
}

/* Cell feedback states */
.fc-fdp-correct {
    background: rgba(34, 197, 94, 0.06);
}

.fc-fdp-correct .fc-fdp-math {
    border-color: #22c55e !important;
}

.fc-fdp-wrong {
    background: rgba(239, 68, 68, 0.06);
}

.fc-fdp-wrong .fc-fdp-math {
    border-color: #ef4444 !important;
}

.fc-fdp-answer {
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #22c55e;
    margin-top: 6px;
}

/* ─── Mobile ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .fc-fdp-tbl th {
        font-size: 0.65rem;
        padding: 6px 6px;
    }

    .fc-fdp-cell {
        padding: 10px 4px;
    }

    .fc-fdp-math {
        width: 70px;
        font-size: 0.95rem;
    }

    .fc-fdp-given {
        font-size: 1rem;
    }
}
