/* =========================================================
   Numorify.com - Calculator Styles
   File: /assets/css/calculator.css
   ========================================================= */


/* =========================================================
   1. Calculator Layout
   ========================================================= */

.calculator-wrapper {
    width: 100%;
}

.calculator-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

@media (min-width: 640px) {
    .calculator-card {
        padding: 2rem;
    }
}


/* =========================================================
   2. Calculator Inputs
   ========================================================= */

.calc-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    background: #ffffff;
    color: #111827;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.calc-input:hover {
    border-color: #9ca3af;
}

.calc-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.10);
    outline: none;
}

.calc-input::placeholder {
    color: #9ca3af;
}

.calc-input:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}


/* =========================================================
   3. Calculator Labels
   ========================================================= */

.calc-label {
    display: block;
    margin-bottom: 0.375rem;
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
}

.calc-help {
    margin-top: 0.25rem;
    color: #9ca3af;
    font-size: 0.75rem;
    line-height: 1rem;
}


/* =========================================================
   4. Calculator Button
   ========================================================= */

.calc-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.875rem 1rem;
    color: #ffffff;
    background: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.1s ease;
}

.calc-button:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.08);
}

.calc-button:active {
    background: #1e40af;
    border-color: #1e40af;
    transform: translateY(1px);
}

.calc-button:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}


/* =========================================================
   5. Reset / Clear Button
   ========================================================= */

.calc-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 0.875rem;
    color: #4b5563;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.calc-reset:hover {
    color: #2563eb;
    background: #eff6ff;
    border-color: #93c5fd;
}


/* =========================================================
   6. Results Container
   ========================================================= */

.calculator-results {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f3f4f6;
}

.result-container {
    width: 100%;
}


/* =========================================================
   7. Result Cards
   ========================================================= */

.result-card {
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
}

.result-label {
    margin-bottom: 0.25rem;
    color: #6b7280;
    font-size: 0.6875rem;
    line-height: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.result-value {
    color: #111827;
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 700;
}

.result-value-primary {
    color: #2563eb;
}

.result-value-success {
    color: #059669;
}


/* =========================================================
   8. Result Grid
   ========================================================= */

/*
   Two-column result layout.
   Example:
   Monthly EMI      | Total Interest
   Total Repayment  | Total Cost
*/
.result-grid-2 {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 640px) {
    .result-grid-2 {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   9. Result Summary
   ========================================================= */

.result-summary {
    background: #f9fafb;
    border-radius: 0.75rem;
    padding: 1rem;
}

.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.25rem 0;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.result-row-label {
    color: #6b7280;
}

.result-row-value {
    color: #111827;
    font-weight: 500;
    text-align: right;
}

.result-row-highlight {
    color: #2563eb;
    font-weight: 600;
}

.result-row-success {
    color: #059669;
    font-weight: 600;
}


/* =========================================================
   9. Result Divider
   ========================================================= */

.result-divider {
    margin: 0.5rem 0;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
}


/* =========================================================
   10. Formula Block
   ========================================================= */

.formula-block {
    padding: 1rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: #374151;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
}


/* =========================================================
   11. Calculation Error / Warning
   ========================================================= */

.calc-error {
    padding: 1rem;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.calc-warning {
    padding: 1rem;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.calc-success {
    padding: 1rem;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}


/* =========================================================
   12. Projection / Amortization Table
   ========================================================= */

.amort-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.amort-scroll::-webkit-scrollbar {
    height: 5px;
}

.amort-scroll table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.amort-scroll th {
    color: #374151;
    background: #f9fafb;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.amort-scroll td {
    color: #4b5563;
    font-size: 0.75rem;
    white-space: nowrap;
}

.amort-row {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
}

.amort-row:hover {
    background: #f9fafb;
}

.amort-row:last-child {
    border-bottom: 0;
}


/* =========================================================
   13. FAQ
   ========================================================= */

.faq-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
}

.faq-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: #111827;
    background: #ffffff;
    border: 0;
    text-align: left;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.faq-toggle:hover {
    background: #f9fafb;
}

.faq-icon {
    flex-shrink: 0;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.faq-answer {
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.6;
}


/* =========================================================
   14. Related Calculators
   ========================================================= */

.related-calculator {
    display: block;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem;
    transition:
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.related-calculator:hover {
    border-color: #bfdbfe;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.08);
    transform: translateY(-1px);
}

.related-calculator h3 {
    color: #111827;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
}

.related-calculator p {
    margin-top: 0.125rem;
    color: #6b7280;
    font-size: 0.75rem;
    line-height: 1rem;
}


/* =========================================================
   15. Calculator Step Number
   ========================================================= */

.step-num {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 9999px;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 700;
}


/* =========================================================
   16. Download / Print
   ========================================================= */

.download-pdf,
.print-result {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 0.875rem;
    color: #374151;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    line-height: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.download-pdf:hover,
.print-result:hover {
    color: #2563eb;
    background: #eff6ff;
    border-color: #93c5fd;
}


/* =========================================================
   17. Select / Dropdown
   ========================================================= */

.calc-select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    color: #111827;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    cursor: pointer;
    appearance: auto;
}

.calc-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.10);
    outline: none;
}


/* =========================================================
   18. Input With Unit
   ========================================================= */

.input-unit-wrapper {
    position: relative;
}

.input-unit-wrapper .calc-input {
    padding-right: 4rem;
}

.input-unit {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.875rem;
    line-height: 1.25rem;
    pointer-events: none;
}


/* =========================================================
   19. Calculator Section
   ========================================================= */

.calculator-section {
    padding-bottom: 3rem;
}

.calculator-section-title {
    margin-bottom: 1rem;
    color: #111827;
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-weight: 700;
}

.calculator-section-description {
    margin-bottom: 1.5rem;
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.6;
}


/* =========================================================
   20. Print
   ========================================================= */

@media print {

    body {
        background: #ffffff !important;
    }

    #site-header,
    .site-footer,
    .no-print,
    .download-pdf,
    .print-result,
    .calc-button,
    .calc-reset {
        display: none !important;
    }

    .calculator-card {
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .calculator-results {
        border-top: 0 !important;
    }

    .result-card {
        break-inside: avoid;
    }

}


/* =========================================================
   21. Mobile
   ========================================================= */

@media (max-width: 640px) {

    .calculator-card {
        padding: 1rem;
        border-radius: 0.875rem;
    }

    .result-card {
        padding: 0.75rem;
    }

    .result-value {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }

    .result-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.125rem;
    }

    .result-row-value {
        text-align: left;
    }

    .formula-block {
        font-size: 0.75rem;
    }

    .faq-toggle {
        padding: 0.875rem 1rem;
    }

}


/* =========================================================
   END OF CALCULATOR STYLES
   ========================================================= */