/* =========================================================
   Mixed Numbers and Improper Fractions Practice
   File:
   /interactive-learning-tools/mixed-numbers-improper-fractions/
   mixed-numbers-improper-fractions.css
   ========================================================= */

.mixed-number-page {
    font-family: "Inter", sans-serif;
    background: #ffffff;
    color: #1f2937;
}

.mixed-number-page *,
.mixed-number-page *::before,
.mixed-number-page *::after {
    box-sizing: border-box;
}


/* =========================================================
   Shared section styles
   ========================================================= */

.mixed-overview,
.mixed-practice-section,
.mixed-reminders,
.mixed-final-cta {
    padding: 5rem 0;
}

.mixed-overview,
.mixed-reminders {
    background: #f7f9fc;
}

.mixed-practice-section,
.mixed-final-cta {
    background: #ffffff;
}

.mixed-section-heading {
    max-width: 760px;
    margin: 0 auto 2.25rem;
    text-align: center;
}

.mixed-section-heading h2 {
    margin-bottom: 1rem;
    color: #101827;
    font-size: clamp(1.75rem, 3vw, 2.4rem);
    font-weight: 800;
}

.mixed-section-heading > p:last-child {
    margin-bottom: 0;
    color: #5b6678;
    font-size: 1.05rem;
    line-height: 1.75;
}

.mixed-eyebrow {
    margin-bottom: 0.65rem;
    color: #0f766e;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}


/* =========================================================
   Overview cards
   ========================================================= */

.mixed-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.mixed-overview-card {
    position: relative;
    min-height: 100%;
    border: 1px solid #dce3eb;
    border-radius: 1rem;
    background: #ffffff;
    padding: 1.5rem;
    box-shadow: 0 12px 30px rgba(16, 24, 39, 0.05);
}

.mixed-overview-card h3 {
    margin-bottom: 0.75rem;
    color: #101827;
    font-size: 1.1rem;
    font-weight: 800;
}

.mixed-overview-card p {
    margin-bottom: 0;
    color: #5b6678;
    line-height: 1.65;
}

.mixed-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.65rem;
    height: 2.65rem;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: #0f766e;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
}


/* =========================================================
   Main tool shell
   ========================================================= */

.mixed-tool {
    max-width: 1050px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #dce3eb;
    border-radius: 1.25rem;
    background: #ffffff;
    box-shadow: 0 22px 55px rgba(16, 24, 39, 0.1);
}

.mixed-tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    border-bottom: 1px solid #dce3eb;
    background: #101827;
    color: #ffffff;
    padding: 1.75rem 2rem;
}

.mixed-tool-header h2 {
    margin-bottom: 0;
    color: #ffffff;
    font-size: clamp(1.45rem, 3vw, 2rem);
    font-weight: 800;
}

.mixed-tool-header .mixed-eyebrow {
    color: #5eead4;
}


/* =========================================================
   Scoreboard
   ========================================================= */

.mixed-scoreboard {
    display: grid;
    grid-template-columns: repeat(3, minmax(80px, 1fr));
    gap: 0.75rem;
}

.mixed-score-item {
    min-width: 90px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.75rem 0.9rem;
    text-align: center;
}

.mixed-score-label {
    display: block;
    margin-bottom: 0.2rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mixed-score-item strong {
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 800;
}


/* =========================================================
   Settings
   ========================================================= */

.mixed-settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    gap: 1rem;
    align-items: end;
    border-bottom: 1px solid #dce3eb;
    background: #f7f9fc;
    padding: 1.5rem 2rem;
}

.mixed-setting-group label {
    display: block;
    margin-bottom: 0.45rem;
    color: #273449;
    font-size: 0.9rem;
    font-weight: 700;
}

.mixed-setting-group .form-select {
    min-height: 3rem;
    border-color: #cfd8e3;
    border-radius: 0.75rem;
}

.mixed-setting-group .form-select:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.14);
}

#newProblemButton {
    min-height: 3rem;
    white-space: nowrap;
}


/* =========================================================
   Problem display
   ========================================================= */

.mixed-problem-area {
    border-bottom: 1px solid #dce3eb;
    padding: 2.25rem 2rem;
    text-align: center;
}

.mixed-problem-label {
    margin-bottom: 0.8rem;
    color: #657184;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mixed-expression {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    min-height: 5.5rem;
    color: #101827;
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 800;
}


/* =========================================================
   Fraction and mixed-number displays
   ========================================================= */

.display-fraction {
    display: inline-grid;
    grid-template-rows: auto auto;
    min-width: 3.5rem;
    line-height: 1.05;
    text-align: center;
}

.display-fraction .fraction-numerator {
    border-bottom: 3px solid currentColor;
    padding: 0 0.6rem 0.35rem;
}

.display-fraction .fraction-denominator {
    padding: 0.35rem 0.6rem 0;
}

.mixed-number-display {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.mixed-whole-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    font-size: 1em;
    font-weight: 800;
}

.mixed-conversion-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    color: #0f766e;
    font-size: 2rem;
    font-weight: 800;
}


/* =========================================================
   Buttons
   ========================================================= */

.mixed-number-page .btn-teal {
    border-color: #0f766e;
    background: #0f766e;
    color: #ffffff;
}

.mixed-number-page .btn-teal:hover,
.mixed-number-page .btn-teal:focus {
    border-color: #0b5f59;
    background: #0b5f59;
    color: #ffffff;
}

.mixed-number-page .btn-outline-teal {
    border-color: #0f766e;
    color: #0f766e;
}

.mixed-number-page .btn-outline-teal:hover,
.mixed-number-page .btn-outline-teal:focus {
    border-color: #0f766e;
    background: #0f766e;
    color: #ffffff;
}


/* =========================================================
   Progress tracker
   ========================================================= */

.mixed-progress {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    border-bottom: 1px solid #dce3eb;
    background: #ffffff;
    padding: 1.75rem 2rem;
}

.mixed-progress-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
    color: #8a95a6;
    text-align: center;
}

.mixed-progress-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 2px solid #cfd8e3;
    border-radius: 50%;
    background: #ffffff;
    color: #7a8698;
    font-size: 0.95rem;
    font-weight: 800;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}

.mixed-progress-number {
    display: inline;
}

.mixed-progress-step p {
    margin: 0.55rem 0 0;
    font-size: 0.8rem;
    font-weight: 700;
}

.mixed-progress-step.active {
    color: #0f766e;
}

.mixed-progress-step.active .mixed-progress-circle {
    border-color: #0f766e;
    background: #0f766e;
    color: #ffffff;
}

.mixed-progress-step.complete {
    color: #0f766e;
}

.mixed-progress-step.complete .mixed-progress-circle {
    border-color: #0f766e;
    background: #dff7f3;
    color: #0f766e;
}

.mixed-progress-line {
    width: 110px;
    height: 2px;
    margin-top: 1.2rem;
    background: #d8e0e9;
}

.mixed-progress-line.complete {
    background: #0f766e;
}


/* =========================================================
   Workspace
   ========================================================= */

.mixed-workspace {
    padding: 2rem;
}

.mixed-work-step {
    max-width: 820px;
    margin: 0 auto;
    border: 1px solid #dce3eb;
    border-radius: 1rem;
    background: #ffffff;
    padding: 2rem;
    box-shadow: 0 12px 30px rgba(16, 24, 39, 0.06);
}

.mixed-work-step + .mixed-work-step {
    margin-top: 1.25rem;
}

.mixed-work-step.active {
    border-color: #7dd3c7;
    box-shadow:
        0 0 0 3px rgba(15, 118, 110, 0.08),
        0 14px 32px rgba(16, 24, 39, 0.08);
}

.mixed-work-step.complete {
    border-color: #86cda9;
    background: #f7fdf9;
}

.mixed-work-step[hidden] {
    display: none;
}

.mixed-work-label {
    margin-bottom: 0.5rem;
    color: #0f766e;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.mixed-work-step h3 {
    margin-bottom: 0.75rem;
    color: #101827;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    font-weight: 800;
}

.mixed-step-instruction {
    max-width: 700px;
    margin-bottom: 1.5rem;
    color: #5b6678;
    line-height: 1.7;
}


/* =========================================================
   Equation cards and rows
   ========================================================= */

.mixed-equation-card {
    max-width: 560px;
    margin-bottom: 1.5rem;
    border: 1px solid #dce3eb;
    border-radius: 0.9rem;
    background: #f7f9fc;
    padding: 1.4rem;
}

.mixed-equation-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    color: #101827;
    font-size: 1.35rem;
    font-weight: 800;
}


/* =========================================================
   Number inputs
   ========================================================= */

.mixed-number-input {
    width: 90px;
    height: 56px;
    border: 2px solid #cfd8e3;
    border-radius: 0.75rem;
    background: #ffffff;
    color: #101827;
    font-size: 1.25rem;
    font-weight: 800;
    text-align: center;
}

.mixed-number-input:focus {
    border-color: #0f766e;
    outline: none;
    box-shadow: 0 0 0 0.22rem rgba(15, 118, 110, 0.14);
}


/* =========================================================
   Fraction inputs
   ========================================================= */

.fraction-input {
    display: inline-grid;
    grid-template-rows: auto 3px auto;
    justify-items: center;
    gap: 0.35rem;
}

.fraction-input > span {
    display: block;
    width: 82px;
    height: 3px;
    background: #101827;
}

.fraction-input input {
    width: 82px;
    height: 54px;
    border: 2px solid #cfd8e3;
    border-radius: 0.65rem;
    background: #ffffff;
    color: #101827;
    font-size: 1.25rem;
    font-weight: 800;
    text-align: center;
}

.fraction-input input:focus {
    border-color: #0f766e;
    outline: none;
    box-shadow: 0 0 0 0.22rem rgba(15, 118, 110, 0.14);
}


/* =========================================================
   Final conversion rows
   ========================================================= */

.mixed-final-conversion-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    max-width: 680px;
    margin: 0 auto 1.75rem;
    color: #101827;
    font-size: 1.6rem;
    font-weight: 800;
}

.mixed-answer-input-group {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}

.mixed-whole-input {
    width: 82px;
    height: 58px;
    border: 2px solid #cfd8e3;
    border-radius: 0.65rem;
    background: #ffffff;
    color: #101827;
    font-size: 1.3rem;
    font-weight: 800;
    text-align: center;
}

.mixed-whole-input:focus {
    border-color: #0f766e;
    outline: none;
    box-shadow: 0 0 0 0.22rem rgba(15, 118, 110, 0.14);
}


/* =========================================================
   Division workspace
   ========================================================= */

.mixed-division-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.75fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mixed-division-card {
    border: 1px solid #dce3eb;
    border-radius: 0.9rem;
    background: #f7f9fc;
    padding: 1.25rem;
}

.mixed-division-card > label {
    display: block;
    margin-bottom: 0.85rem;
    color: #5b6678;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}


/* =========================================================
   Remainder workspace
   ========================================================= */

.mixed-remainder-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    max-width: 620px;
    margin: 0 auto 1.75rem;
    color: #101827;
    font-size: 1.4rem;
    font-weight: 800;
}

.mixed-helper-text {
    color: #657184;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: lowercase;
}


/* =========================================================
   Input states
   ========================================================= */

.mixed-number-input.is-correct,
.mixed-fraction-input.is-correct,
.mixed-whole-input.is-correct {
    border-color: #15803d;
    background: #f0fdf4;
}

.mixed-number-input.is-incorrect,
.mixed-fraction-input.is-incorrect,
.mixed-whole-input.is-incorrect {
    border-color: #dc2626;
    background: #fef2f2;
}

.mixed-number-input:disabled,
.mixed-fraction-input:disabled,
.mixed-whole-input:disabled {
    cursor: not-allowed;
    background: #f3f5f8;
    color: #687386;
    opacity: 1;
}


/* =========================================================
   Feedback
   ========================================================= */

.mixed-feedback {
    max-width: 820px;
    margin: 1.25rem auto 0;
    border: 1px solid #cfd8e3;
    border-radius: 0.85rem;
    padding: 1rem 1.15rem;
    color: #273449;
    font-weight: 700;
    line-height: 1.6;
}

.mixed-feedback.success {
    border-color: #86cda9;
    background: #f0fdf4;
    color: #166534;
}

.mixed-feedback.error {
    border-color: #f0a7a7;
    background: #fef2f2;
    color: #991b1b;
}

.mixed-feedback.info {
    border-color: #9cc8df;
    background: #f0f9ff;
    color: #075985;
}

.mixed-feedback[hidden] {
    display: none;
}


/* =========================================================
   Hint
   ========================================================= */

.mixed-hint-button {
    display: block;
    margin: 1.25rem auto 0;
    border: 0;
    background: transparent;
    color: #0f766e;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 0.2rem;
}

.mixed-hint-button:hover,
.mixed-hint-button:focus {
    color: #0b5f59;
}

.mixed-hint {
    max-width: 820px;
    margin: 1rem auto 0;
    border-left: 4px solid #0f766e;
    border-radius: 0.25rem 0.75rem 0.75rem 0.25rem;
    background: #ecfdf8;
    padding: 1rem 1.15rem;
    color: #33504d;
    line-height: 1.65;
}

.mixed-hint[hidden] {
    display: none;
}


/* =========================================================
   Completion
   ========================================================= */

.mixed-completion {
    max-width: 820px;
    margin: 1.5rem auto 0;
    border: 1px solid #86cda9;
    border-radius: 1rem;
    background: #f0fdf4;
    padding: 2rem;
    text-align: center;
}

.mixed-completion[hidden] {
    display: none;
}

.mixed-completion-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: #15803d;
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 800;
}

.mixed-completion h3 {
    margin-bottom: 0.65rem;
    color: #14532d;
    font-size: 1.65rem;
    font-weight: 800;
}

.mixed-completion p {
    color: #3f624b;
}

.mixed-final-answer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    color: #101827;
    font-size: 1.75rem;
    font-weight: 800;
}

.mixed-completion-explanation {
    max-width: 620px;
    margin: 0 auto 1.5rem;
    line-height: 1.65;
}


/* =========================================================
   Reminder cards
   ========================================================= */

.mixed-reminders-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.mixed-reminder-card {
    min-height: 100%;
    border: 1px solid #dce3eb;
    border-radius: 1rem;
    background: #ffffff;
    padding: 1.5rem;
    box-shadow: 0 12px 30px rgba(16, 24, 39, 0.05);
}

.mixed-reminder-card h3 {
    margin-bottom: 0.75rem;
    color: #101827;
    font-size: 1.15rem;
    font-weight: 800;
}

.mixed-reminder-card p {
    margin-bottom: 1rem;
    color: #5b6678;
    line-height: 1.65;
}

.mixed-example {
    border-radius: 0.75rem;
    background: #ecfdf8;
    padding: 0.9rem 1rem;
    color: #0f766e;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.55;
    text-align: center;
}


/* =========================================================
   Final CTA
   ========================================================= */

.mixed-final-cta-card {
    max-width: 900px;
    margin: 0 auto;
    border-radius: 1.25rem;
    background: #101827;
    padding: 3rem;
    color: #ffffff;
    text-align: center;
    box-shadow: 0 22px 55px rgba(16, 24, 39, 0.16);
}

.mixed-final-cta-card .mixed-eyebrow {
    color: #5eead4;
}

.mixed-final-cta-card h2 {
    margin-bottom: 1rem;
    color: #ffffff;
    font-size: clamp(1.75rem, 3vw, 2.4rem);
    font-weight: 800;
}

.mixed-final-cta-card p {
    max-width: 680px;
    margin: 0 auto 1.5rem;
    color: rgba(255, 255, 255, 0.76);
    font-size: 1.05rem;
    line-height: 1.75;
}


/* =========================================================
   Animation
   ========================================================= */

.mixed-pop {
    animation: mixedPop 0.35s ease;
}

@keyframes mixedPop {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 991.98px) {
    .mixed-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mixed-tool-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .mixed-scoreboard {
        width: 100%;
    }

    .mixed-settings {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #newProblemButton {
        grid-column: 1 / -1;
    }

    .mixed-reminders-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 767.98px) {
    .mixed-overview,
    .mixed-practice-section,
    .mixed-reminders,
    .mixed-final-cta {
        padding: 3.75rem 0;
    }

    .mixed-overview-grid,
    .mixed-reminders-grid {
        grid-template-columns: 1fr;
    }

    .mixed-tool {
        border-radius: 1rem;
    }

    .mixed-tool-header,
    .mixed-settings,
    .mixed-problem-area,
    .mixed-progress,
    .mixed-workspace {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .mixed-settings {
        grid-template-columns: 1fr;
    }

    #newProblemButton {
        grid-column: auto;
        width: 100%;
    }

    .mixed-progress-step {
        min-width: 68px;
    }

    .mixed-progress-line {
        width: 55px;
    }

    .mixed-work-step {
        padding: 1.4rem;
    }

    .mixed-division-grid {
        grid-template-columns: 1fr;
    }

    .mixed-final-conversion-row {
        gap: 1rem;
    }

    .mixed-final-cta-card {
        padding: 2rem 1.35rem;
    }
}


/* =========================================================
   Small mobile
   ========================================================= */

@media (max-width: 479.98px) {
    .mixed-scoreboard {
        gap: 0.4rem;
    }

    .mixed-score-item {
        min-width: 0;
        padding: 0.65rem 0.4rem;
    }

    .mixed-score-label {
        font-size: 0.65rem;
    }

    .mixed-score-item strong {
        font-size: 1.2rem;
    }

    .mixed-expression {
        gap: 0.75rem;
    }

    .mixed-progress {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .mixed-progress-step {
        min-width: 60px;
    }

    .mixed-progress-circle {
        width: 2.25rem;
        height: 2.25rem;
    }

    .mixed-progress-line {
        width: 32px;
        margin-top: 1.08rem;
    }

    .mixed-progress-step p {
        font-size: 0.7rem;
    }

    .mixed-equation-row {
        justify-content: center;
        font-size: 1.1rem;
    }

    .mixed-number-input {
        width: 76px;
        height: 52px;
    }

    .mixed-final-conversion-row {
        flex-direction: column;
    }

    .mixed-conversion-symbol {
        transform: rotate(90deg);
    }

    .mixed-answer-input-group {
        justify-content: center;
    }

    .mixed-remainder-row {
        flex-direction: column;
    }
}


/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .mixed-pop {
        animation: none;
    }

    .mixed-progress-circle {
        transition: none;
    }
}