/* =========================================================
   PERCENTAGE CALCULATOR
========================================================= */

.percentage-calculator-page {
    padding: 26px 0 32px;
}

.percentage-calculator-container {
    width: min(1200px, 92%);
    margin: 0 auto;
}

.percentage-calculator-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}


/* =========================================================
   CALCULATOR HEADER
========================================================= */

.percentage-calculator-heading {
    padding: 22px 26px 20px;
    border-bottom: 1px solid var(--border);
}

.percentage-calculator-heading h2 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 22px;
    line-height: 1.3;
    font-weight: 700;
}

.percentage-calculator-heading p {
    margin: 0;
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
}


/* =========================================================
   EACH CALCULATION ROW
========================================================= */

.percentage-calculation {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(310px, .78fr);

    gap: 24px;

    min-height: 225px;

    padding: 24px 26px;

    border-bottom: 1px solid var(--border);

    box-sizing: border-box;
}


/* =========================================================
   LEFT
========================================================= */

.percentage-calculation-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.percentage-calculation-left h3 {
    margin: 0 0 18px;

    color: var(--text);

    font-size: 17px;
    line-height: 1.4;
    font-weight: 700;
}


/* =========================================================
   QUESTION
========================================================= */

.percentage-question {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;

    color: var(--text);

    font-size: 15px;
    line-height: 1.5;
}

.percentage-question span {
    white-space: nowrap;
}

.percentage-question input {
    width: 145px;
    height: 42px;

    padding: 0 11px;

    border: 1px solid var(--border);
    border-radius: 6px;

    background: var(--bg);
    color: var(--text);

    font-family: inherit;
    font-size: 14px;

    outline: none;

    box-sizing: border-box;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background .15s ease,
        color .15s ease;
}

.percentage-question input:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(29, 114, 255, .10);
}

.percentage-question input::placeholder {
    color: var(--text-light);
    opacity: .75;
}


/* =========================================================
   RESULT
========================================================= */

.percentage-answer-line {
    display: flex;
    align-items: baseline;
    gap: 8px;

    margin-top: 20px;

    color: var(--text);

    font-size: 15px;
}

.percentage-answer {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.percentage-result-text {
    margin-top: 7px;

    color: var(--text-light);

    font-size: 13px;
    line-height: 1.55;
}


/* =========================================================
   RIGHT CALCULATION
========================================================= */

.percentage-calculation-right {
    display: flex;
    align-items: stretch;
    min-width: 0;
}

.calculation-box {
    position: relative;

    width: 100%;
    min-height: 100%;

    padding: 43px 18px 18px;

    background: var(--bg-soft);

    border: 1px solid var(--border);
    border-radius: 8px;

    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    justify-content: center;

    font-family: Consolas, Monaco, monospace;

    font-size: 14px;
    line-height: 2;

    color: var(--text);

    overflow-x: auto;
}


/* =========================================================
   CALCULATION HEADING
========================================================= */

.calculation-box::before {
    content: "Calculation:";

    position: absolute;

    top: 15px;
    left: 18px;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 14px;
    font-weight: 700;

    color: var(--text);
}


/* =========================================================
   CALCULATION LINES
========================================================= */

.calculation-box div {
    color: var(--text);
    white-space: nowrap;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 760px) {

    .percentage-calculator-page {
        padding: 16px 10px 25px;
    }

    .percentage-calculation {
        grid-template-columns: 1fr;

        gap: 18px;

        min-height: auto;

        padding: 21px 18px;
    }

    .percentage-calculation-right {
        min-height: 170px;
    }

    .calculation-box {
        min-height: 170px;
    }

}


@media (max-width: 480px) {

    .percentage-calculator-heading {
        padding: 18px;
    }

    .percentage-calculator-heading h2 {
        font-size: 20px;
    }

    .percentage-question {
        align-items: flex-start;
    }

    .percentage-question input {
        width: 100%;
        max-width: 180px;
    }

}
