/* =========================================================
   EPINOZIA | SHARED CALCULATOR STYLES
   Reusable across Finance, Physics, and future disciplines.
   Finance-specific components remain in finance/css/calculators.css.
========================================================= */

/* ========================================
   CALCULATOR PAGE
======================================== */

.calculator-page {
    background-color: #f8fafc;
}

/* ========================================
   CALCULATOR HEADER
======================================== */

.calculator-header {
    width: min(92%, 800px);
    margin-inline: auto;
    padding-block: clamp(35px, 5vw, 55px);
    text-align: center;
}

.calculator-eyebrow {
    margin-bottom: 10px;

    color: #2563eb;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.calculator-header h1 {
    margin-bottom: 14px;

    color: #123a63;

    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.15;
}

.calculator-intro,
.calculator-instruction {
    max-width: 720px;

    margin-left: auto;
    margin-right: auto;

    text-align: justify;

    line-height: 1.7;
}

.calculator-intro {
    margin-top: 18px;

    color: #475569;

    font-size: clamp(15px, 1.5vw, 16px);
}

.calculator-instruction {
    margin-top: 32px;

    color: #64748b;

    font-size: clamp(14px, 1.4vw, 15px);
}


/* ========================================
   CALCULATOR LAYOUT
======================================== */

.calculator-layout {
    width: min(92%, 1600px);
    margin-inline: auto;
    padding-block: clamp(15px, 3vw, 70px);

    display: grid;
    grid-template-columns:
        160px
        minmax(0, 1200px)
        160px;

    justify-content: center;
    align-items: start;
    gap: 20px;
}


/* ========================================
   AD SPACES
======================================== */

.calculator-ad {
    min-height: 600px;

    display: flex;
    justify-content: center;
    align-items: flex-start;

    padding-top: 10px;

    color: #94a3b8;
    font-size: 10px;
    letter-spacing: 0.5px;
}


/* ========================================
   CALCULATOR TOOL
======================================== */

.calculator-tool {
    width: 100%;

    display: grid;

    grid-template-columns:
        minmax(240px, 0.8fr)
        minmax(0, 1.4fr);

    background-color: #ffffff;

    border: 1px solid #e2e8f0;
    border-radius: 14px;

    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.07);

    overflow: hidden;
}


/* ========================================
   INPUT SIDE
======================================== */

.calculator-inputs {
    padding: clamp(20px, 3vw, 32px);

    background-color: #ffffff;

    border-right: 1px solid #e2e8f0;
}

.calculator-inputs h2 {
    margin-bottom: 28px;

    color: #0f172a;

    font-size: clamp(18px, 2vw, 20px);
}


/* ========================================
   INPUT GROUPS
======================================== */

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;

    margin-bottom: 8px;

    color: #475569;

    font-size: 13px;
    font-weight: 600;
}


/* ========================================
   INPUT BOXES
======================================== */

.money-input,
.percent-input,
.years-input {
    height: 48px;

    display: flex;
    align-items: center;

    background-color: #ffffff;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.money-input:focus-within,
.percent-input:focus-within,
.years-input:focus-within {
    border-color: #2563eb;

    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.money-input span {
    padding-left: 14px;
    padding-right: 6px;
}

.money-input input {
    padding-left: 6px;
}
.percent-input span,
.years-input span {
    padding: 0 14px;

    color: #64748b;

    font-size: 14px;
}

.money-input input,
.percent-input input,
.years-input input {
    width: 100%;
    height: 100%;

    padding: 0 12px;

    border: 0;
    outline: 0;

    background: transparent;

    color: #0f172a;

    font-size: 16px;
    font-weight: 600;
}


/* ========================================
   RESULTS SIDE
======================================== */

.calculator-results {
    min-width: 0;

    padding: clamp(20px, 3vw, 32px);
}

.result-main {
    margin-bottom: 25px;
}

.result-main span {
    display: block;

    margin-bottom: 5px;

    color: #64748b;

    font-size: 13px;
}

.result-main strong {
    color: #123a63;

    font-size: clamp(30px, 3vw, 38px);
    line-height: 1.1;
}


/* ========================================
   RESULT SUMMARY
======================================== */

.result-summary {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(160px, 1fr));

    gap: 15px;

    margin-bottom: 28px;
}

.result-summary > div {
    padding: 15px;

    background-color: #f8fafc;

    border-radius: 8px;
}

.result-summary span {
    display: block;

    margin-bottom: 5px;

    color: #64748b;

    font-size: 12px;
}

.result-summary strong {
    color: #0f172a;

    font-size: clamp(16px, 1.6vw, 18px);
}


/* ========================================
   CHART
======================================== */

.calculator-chart {
    width: 100%;

    min-height: clamp(240px, 30vw, 320px);

    background-color: #f8fafc;

    border-radius: 10px;

    overflow: hidden;
}

.calculator-chart canvas {
    width: 100%;
    height: clamp(240px, 30vw, 320px);
    display: block;
}

/* ========================================
   BOTTOM AD
======================================== */

.calculator-mobile-ad {
    display: none;
}

/* ========================================
   DESKTOP / LAPTOP
   1024px - 1599px
======================================== */

@media (max-width: 1599px) {

    .calculator-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .calculator-ad-left,
    .calculator-ad-right {
        display: none;
    }

}

/* ========================================
   TABLET
   600px - 1023px
======================================== */

@media (min-width: 600px) and (max-width: 1023px) {

    .calculator-header {
        max-width: 720px;
    }

    .calculator-tool {
        grid-template-columns: minmax(0, 1fr);
    }

    .calculator-inputs {
        border-right: 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .calculator-mobile-ad {
        display: flex;
        width: min(92%, 728px);
        min-height: 90px;
        margin: 20px auto 32px;
        justify-content: center;
        align-items: flex-start;
    }

}

/* ========================================
   PHONE
   BELOW 600px
======================================== */

@media (max-width: 599px) {

    .calculator-header,
    .calculator-layout {
        width: calc(100% - 32px);
    }

    .calculator-tool {
        grid-template-columns: minmax(0, 1fr);
    }

    .calculator-inputs {
        border-right: 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .calculator-mobile-ad {
        display: flex;
        width: min(calc(100% - 32px), 320px);
        min-height: 100px;
        margin: 20px auto 28px;
        justify-content: center;
        align-items: flex-start;
    }

}

.calculator-inputs input::placeholder {
    color: #94a3b8;
    opacity: 1;
    font-weight: 500;
}

/* ========================================
   REINVEST INTEREST SWITCH
/* ========================================
   CHART EXPLANATION
======================================== */

.chart-explanation {
    margin-top: 22px;
}

.chart-explanation h3 {
    margin-bottom: 8px;

    color: #0f172a;

    font-size: 15px;
}

.chart-explanation p {
    margin: 0;

    color: #64748b;

    font-size: 13px;
    line-height: 1.6;
}

.calculator-learn-more {
    margin-top: 24px;
}

.calculator-learn-more p {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.6;
    color: #475569;
}

.calculator-learn-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;
    padding: 9px 16px;

    border-radius: 8px;

    background: #123a63;
    color: #ffffff;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;

    text-decoration: none;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.calculator-learn-button:hover {
    background: #0d2f52;
}

.calculator-learn-button:focus-visible {
    outline: 3px solid rgba(18, 58, 99, 0.22);
    outline-offset: 2px;
}
/* =========================================================
   EPINOZIA VISUAL CONSISTENCY — ABOUT PAGE STANDARD
   Shared typography, cards, and calculator hub
   ========================================================= */

.calculator-page,
.calculator-hub-header,
.calculator-hub-layout {
    color: #0f172a;
}

/* Shared page introduction hierarchy. */
.calculator-header {
    padding-block: clamp(45px, 6vw, 70px) clamp(30px, 4vw, 45px);
}

.calculator-header h1,
.calculator-hub-header h1 {
    margin-bottom: 18px;
    color: #123a63;
    font-size: clamp(32px, 4.5vw, 46px);
    line-height: 1.15;
}

.calculator-intro,
.calculator-hub-header > p:not(.calculator-eyebrow) {
    max-width: 720px;
    margin-inline: auto;
    color: #475569;
    font-size: clamp(15px, 1.5vw, 17px);
    line-height: 1.7;
    text-align: center;
}

.calculator-instruction {
    color: #64748b;
    font-size: 15px;
    line-height: 1.7;
    text-align: center;
}

/* Preserve the two-panel calculator and its working controls. */
.calculator-tool {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: none;
}

.calculator-inputs h2 {
    color: #0f172a;
    font-size: clamp(23px, 3vw, 30px);
    line-height: 1.25;
}

.calculator-inputs h3,
.chart-explanation h3 {
    color: #123a63;
    font-size: 16px;
    line-height: 1.3;
}

.input-group label {
    color: #475569;
    font-size: 14px;
}

.chart-explanation p,
.calculator-learn-more p {
    color: #475569;
    font-size: 15px;
    line-height: 1.75;
}

.result-main span,
.result-summary span {
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.result-summary > div {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.calculator-learn-button {
    border-radius: 10px;
    background-color: #123a63;
    font-size: 14px;
}

.calculator-learn-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 3px;
}

/* Calculator directory / hub: matching About feature cards. */
.calculator-hub-header {
    width: min(90%, 900px);
    margin-inline: auto;
    padding-block: clamp(45px, 6vw, 70px) clamp(30px, 4vw, 45px);
    text-align: center;
}

.calculator-hub-header .calculator-eyebrow {
    margin-bottom: 10px;
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.calculator-hub-layout {
    display: block;
    width: min(92%, 1000px);
    margin-inline: auto;
    padding-bottom: clamp(55px, 6vw, 80px);
}

.calculator-hub {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.calculator-card {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 185px;
    padding: clamp(22px, 3vw, 28px);
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease,
                box-shadow 0.2s ease, background-color 0.2s ease;
	min-height: 0;
    height: auto;
    padding: 26px 28px;
}

.calculator-card h2 {
    margin: 0 0 10px;
    color: #123a63;
    font-size: 20px;
    line-height: 1.3;
}

.calculator-card p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.65;
}

.calculator-card-active:hover {
    transform: translateY(-3px);
    background-color: #ffffff;
    border-color: #93c5fd;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.calculator-card:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 3px;
}

/* The directory is ad-free; individual calculators keep their placeholders. */
.calculator-hub-layout .hub-side-ad,
main:has(.calculator-hub-layout) > .calculator-mobile-ad {
    display: none;
}

@media (max-width: 1023px) {
    .calculator-tool {
        grid-template-columns: minmax(0, 1fr);
    }
    .calculator-inputs {
        border-right: 0;
        border-bottom: 1px solid #e2e8f0;
    }
}

@media (max-width: 650px) {
    .calculator-hub {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 599px) {
    .calculator-hub-header,
    .calculator-hub-layout {
        width: calc(100% - 32px);
    }
    .calculator-card {
        padding: 19px;
    }
    .calculator-inputs,
    .calculator-results {
        padding: 19px;
    }
}

/* ========================================
   CALCULATOR HUB — EPINOZIA STANDARDS
======================================== */

.calculator-hub-layout {
    width: min(92%, var(--site-max-width, 1200px));
    margin-inline: auto;
    display: block;
}

.calculator-hub {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(18px, 2vw, 24px);
}

.calculator-card {
    min-width: 0;
    box-sizing: border-box;
}

/* TABLET */
@media (max-width: 1023px) {
    .calculator-hub {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* PHONE */
@media (max-width: 599px) {
    .calculator-hub-layout {
        width: calc(100% - 32px);
    }

    .calculator-hub {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* Shared calculator error panel */

.calculator-error-panel {
    margin: 16px 0 20px;
    padding: 16px 18px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #991b1b;
}

.calculator-error-panel[hidden] {
    display: none !important;
}

.calculator-error-panel h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: #991b1b;
}

.calculator-error-panel p {
    margin: 0 0 7px;
    line-height: 1.5;
    color: #991b1b;
}

.calculator-error-panel p:last-child {
    margin-bottom: 0;
}

.calculator-error-panel p[hidden] {
    display: none !important;
}


/* =========================================================
   PROJECTILE MOTION — RESULT STATUS PANELS
   ========================================================= */

#projectile-error,
#projectile-conflict,
#projectile-insufficient {
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px solid;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.65;
}

#projectile-error[hidden],
#projectile-conflict[hidden],
#projectile-insufficient[hidden],
#projectile-conflict-details[hidden] {
    display: none !important;
}

#projectile-error h3,
#projectile-conflict h3,
#projectile-insufficient h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}

#projectile-error p,
#projectile-conflict p,
#projectile-insufficient p {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.65;
}

#projectile-error p:last-child,
#projectile-conflict p:last-child,
#projectile-insufficient p:last-child {
    margin-bottom: 0;
}

/* Invalid values or impossible calculations */
#projectile-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

#projectile-error h3 {
    color: #b91c1c;
}

/* Incompatible but individually valid values */
#projectile-conflict {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

#projectile-conflict h3 {
    color: #b45309;
}

/* Missing information */
#projectile-insufficient {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

#projectile-insufficient h3 {
    color: #1d4ed8;
}

/* Expandable conflict diagnostics */
#projectile-conflict-details {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #fcd34d;
}

#projectile-conflict-details summary {
    cursor: pointer;
    color: #92400e;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

#projectile-conflict-details summary:focus-visible {
    outline: 3px solid rgba(180, 83, 9, 0.2);
    outline-offset: 4px;
    border-radius: 4px;
}

#projectile-conflict-alternatives {
    margin-top: 14px;
}

#projectile-conflict-alternatives .conflict-item {
    margin-top: 10px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #f3d9a5;
    border-radius: 8px;
}

#projectile-conflict-alternatives .conflict-value {
    display: block;
    margin-bottom: 5px;
    color: #123a63;
    font-size: 14px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

#projectile-conflict-alternatives .conflict-description {
    display: block;
    color: #475569;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* Mobile adjustments */
@media (max-width: 599px) {
    #projectile-error,
    #projectile-conflict,
    #projectile-insufficient {
        padding: 14px;
    }

    #projectile-conflict-alternatives .conflict-item {
        padding: 10px 12px;
    }
}



/* =========================================================
   PHYSICS — CALCULATION STATUS PANELS
   Shared by Projectile Motion and Inclined Plane.
   ========================================================= */

.calculator-error-panel,
.calculator-warning-panel,
.calculator-info-panel {
    margin: 18px 0 24px;
    padding: 20px;
    border: 1px solid;
    border-radius: 10px;
    overflow-wrap: anywhere;
}

.calculator-error-panel {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.calculator-warning-panel {
    background-color: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

.calculator-info-panel {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.calculator-error-panel h3,
.calculator-warning-panel h3,
.calculator-info-panel h3 {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: inherit;
}

.calculator-error-panel p,
.calculator-warning-panel p,
.calculator-info-panel p {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.7;
    color: inherit;
}

.calculator-error-panel p:last-child,
.calculator-warning-panel p:last-child,
.calculator-info-panel p:last-child {
    margin-bottom: 0;
}

/* Hidden states must override display rules. */
.calculator-error-panel[hidden],
.calculator-warning-panel[hidden],
.calculator-info-panel[hidden],
.calculator-results .result-main[hidden],
.calculator-results #incline-extra-results[hidden] {
    display: none !important;
}

@media (max-width: 599px) {
    .calculator-error-panel,
    .calculator-warning-panel,
    .calculator-info-panel {
        padding: 16px;
        margin: 16px 0 20px;
    }
}


/* Kinetic & Potential Energy — Result Status Panels */

#energy-status[hidden] {
    display: none !important;
}

#energy-status {
    margin: 16px 0 22px;
    padding: 18px 20px;
    border: 1px solid;
    border-radius: 9px;
    line-height: 1.6;
}

#energy-status strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 700;
}

#energy-status p {
    margin: 0 0 10px;
    font-size: 0.92rem;
}

#energy-status p:last-child {
    margin-bottom: 0;
}

#energy-status-equation {
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* Blue — More Information Needed */
#energy-status.energy-status-info {
    background: #eef5ff;
    border-color: #b6d4ff;
    color: #1644bd;
}

/* Orange — Conflicting Values */
#energy-status.energy-status-conflict {
    background: #fffbeb;
    border-color: #fbbf24;
    color: #92400e;
}

/* Red — Calculation Not Possible */
#energy-status.energy-status-error {
    background: #fff1f2;
    border-color: #fecaca;
    color: #991b1b;
}

