/* Page-specific styles: loan-calculator.css */

body {
    font-family: 'Alibaba-PuHuiTi', sans-serif;
    background-color: var(--white);
    color: var(--dark-green);
    width: 100%;
    margin: 0 auto;
    overflow-x: hidden;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--medium-green) 0%, var(--teal-green) 100%);
    padding: 20px 5%;
    text-align: center;
    color: var(--white);
    position: relative;
}

.breadcrumb {
    display: none !important;
}

.hero h1 {
    font-size: clamp(32px, 8vw, 56px);
    color: var(--dark-green);
    margin-bottom: 16px;
}

.hero h2 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 10px;
}

.hero p {
    font-size: 18px;
    opacity: 0.9;
}

/* Calculator Section */
.repayment-details-section {
    background-color: var(--light-cream);
    padding: 10px 5%;
}


.calc-title {
    font-size: 32px;
    color: var(--dark-green);
    margin-bottom: 40px;
    font-weight: 700;
}

.input-group {
    margin-bottom: 35px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.label-row label {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-green);
}

.input-box {
    padding: 10px 15px;
    border: 2px solid var(--teal-green);
    border-radius: 8px;
    width: 180px;
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-green);
    text-align: right;
    font-family: inherit;
}

.range-slider {
    width: 100%;
    height: 8px;
    background: var(--light-cream);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--teal-green);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border: 2px solid var(--white);
}

.dropdown {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--teal-green);
    border-radius: 12px;
    font-size: 18px;
    color: var(--dark-green);
    font-family: inherit;
    background: var(--white);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2377bfa3%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 20px top 50%;
    background-size: 16px auto;
}

.loan-calc-btn {
    width: 100%;
    padding: 20px;
    font-size: 20px;
    background: var(--teal-green);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 20px;
}

.loan-calc-btn:hover {
    background: var(--dark-green);
}

.loan-calc-results {
    background-color: var(--light-cream);
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

.loan-result-card {
    background: var(--white);
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 2px solid var(--teal-green);
    position: relative;
    min-width: 260px;
}

.loan-result-header {
    font-size: 16px;
    color: var(--dark-green);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loan-result-value-lg {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    color: var(--teal-green);
}

.loan-result-value-md {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark-green);
}

.loan-result-grid {
    display: flex;
    /*grid-template-columns: 1fr 1fr;*/
    gap: 100px;
    flex-wrap: wrap;
}

.chart-container {
    display: flex;
    align-items: center;
    gap: 30px;
    background: var(--white);
    padding: 20px;
    border-radius: 16px;
}

.pie-chart {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--teal-green) 0% 90%, var(--medium-green) 90% 100%);
    position: relative;
}

.pie-chart::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: var(--white);
    border-radius: 50%;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.teal {
    background: var(--teal-green);
}

.dot.green {
    background: var(--medium-green);
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 10px;
}

.schedule-table th {
    text-align: left;
    padding: 10px;
    color: var(--teal-green);
    border-bottom: 2px solid var(--teal-green);
}

.schedule-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    color: var(--dark-green);
}

/* Loan schedule table (injected by JS) - responsive with always-visible custom scrollbar */
.loan-schedule-wrapper {
    /* Use 'scroll' (not 'auto') so WebKit/Chrome renders a classic persistent
       scrollbar that does not fade out after inactivity (overlay-scrollbar mode). */
    overflow-x: scroll;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    /* Reserve space for the scrollbar so the layout never shifts */
    scrollbar-gutter: stable;
    border: 1px solid #eee;
    border-radius: 8px;
    background: var(--white);
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--teal-green) var(--light-cream);
}

/* Webkit / Chromium / Edge - always visible custom scrollbar */
.loan-schedule-wrapper::-webkit-scrollbar {
    height: 10px;
    -webkit-appearance: none;
    appearance: none;
}

.loan-schedule-wrapper::-webkit-scrollbar-track {
    background: var(--light-cream);
    border-radius: 5px;
}

.loan-schedule-wrapper::-webkit-scrollbar-thumb {
    background: var(--teal-green);
    border-radius: 5px;
    border: 2px solid var(--light-cream);
    min-width: 30px;
}

.loan-schedule-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--medium-green);
}

/* Keep the thumb visible in Chrome (prevent fade-in/out on inactivity) */
.loan-schedule-wrapper::-webkit-scrollbar-thumb:window-inactive {
    background: var(--teal-green);
}

/* When the table doesn't overflow, the scrollbar still shows but appears
   idle. Style the corner / horizontal-only state so it stays tidy. */
.loan-schedule-wrapper::-webkit-scrollbar-track:window-inactive {
    background: var(--light-cream);
}

.loan-schedule-wrapper table {
    width: 100%;
    min-width: 640px; /* force horizontal scroll on small screens */
    border-collapse: collapse;
    font-size: 14px;
    color: var(--dark-green);
}

.loan-schedule-wrapper thead th {
    text-align: left;
    padding: 12px 14px;
    color: var(--teal-green);
    border-bottom: 2px solid var(--teal-green);
    font-weight: 600;
    background: var(--white);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

.loan-schedule-wrapper tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    color: var(--dark-green);
    white-space: nowrap;
}

.loan-schedule-wrapper tbody tr:last-child td {
    border-bottom: none;
}

/* Sticky first column (Month) so user can scroll right while still seeing the month */
.loan-schedule-wrapper th:first-child,
.loan-schedule-wrapper td:first-child {
    position: sticky;
    left: 0;
    background: var(--white);
    z-index: 1;
    font-weight: 600;
    border-right: 1px solid #eee;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.04);
}

.loan-schedule-wrapper thead th:first-child {
    z-index: 3;
}

/* Examples Section */
.examples-section {
    background-color: var(--pale-green);
    padding: 80px 5%;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 40px;
    color: var(--dark-green);
    margin-bottom: 15px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.example-card {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
}

.example-card:hover {
    transform: translateY(-10px);
}

.ex-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--teal-green);
    border-bottom: 2px solid var(--light-cream);
    padding-bottom: 15px;
}

.ex-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 16px;
}

.ex-label {
    color: #666;
}

.ex-val {
    font-weight: 600;
    color: var(--dark-green);
}

.ex-highlight {
    background: var(--light-cream);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.try-btn {
    margin-top: auto;
    width: 100%;
    padding: 15px;
    background: var(--white);
    color: var(--teal-green);
    border: 2px solid var(--teal-green);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.try-btn:hover {
    background: var(--teal-green);
    color: var(--white);
}

/* How It Works */
.how-it-works {
    padding: 80px 5%;
    background: var(--white);
    text-align: center;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
    max-width: 1400px;
    margin: 60px auto 0;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-icon {
    width: 100px;
    height: 100px;
    background: var(--light-cream);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    color: var(--teal-green);
    font-size: 40px;
}

.step-item h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--dark-green);
}

.step-item p {
    color: #666;
    line-height: 1.6;
    font-size: 16px;
    max-width: 300px;
}

/* FAQ */
.faq-section {
    background: var(--light-cream);
    padding: 80px 5%;
}

.faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.faq-item {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    border-left: 5px solid var(--teal-green);
}

.faq-q {
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 18px;
    display: flex;
    justify-content: space-between;
}

.faq-q i {
    color: var(--teal-green);
}

.faq-a {
    color: #555;
    font-size: 15px;
    line-height: 1.5;
}

/* CTA */


.cta-content {
    max-width: 800px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: clamp(32px, 6vw, 48px);
    margin-bottom: 20px;
}

.cta-content p {
    font-size: 20px;
    margin-bottom: 40px;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Disclaimer */
.disclaimer {
    background: var(--white);
    padding: 30px 5%;
    text-align: center;
    font-size: 14px;
    color: #888;
    border-top: 1px solid #eee;
}

/* Footer */
footer {
    background: var(--dark-green);
    color: var(--white);
    padding: 80px 5% 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 60px;
}

.footer-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--teal-green);
    margin-bottom: 20px;
    display: block;
}

.footer-desc {
    color: #aaa;
    line-height: 1.6;
    max-width: 300px;
}

.footer-col h4 {
    font-size: 18px;
    margin-bottom: 25px;
    color: var(--soft-sage);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #ccc;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--teal-green);
}

.copyright {
    text-align: center;
    padding-top: 40px;
    color: #666;
    font-size: 14px;
}

/* Table Section */
.table-container {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.section-title {
    font-family: 'MiSans-Bold', sans-serif;
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--heading-color);
    /* display: flex; */
    align-items: center;
    gap: 12px;
    text-align: center;
}

.section-title span {
    width: 8px;
    height: 24px;
    background: var(--accent-color);
    border-radius: 4px;
    display: inline-block;
}


/* Responsive Adjustments */
@media (max-width: 1024px) {
    .loan-calculator-wrapper {
        grid-template-columns: 1fr;
    }

    .loan-calc-form {
        border-right: none;
        border-bottom: 1px solid var(--light-cream);
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .nav-links {
        gap: 15px;
        font-size: 14px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .cards-grid,
    .steps-container {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .loan-result-grid {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .loan-calculator-wrapper {
        width: 100%;
    }

    * {
        /*font-size: 8px!important;*/
        /* font-size: calc(1% + 1vw + 1vh) !important; */
        /* font-size: 14px; */
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .loan-calc-form,
    .loan-calc-results {
        padding: 20px;
    }
}

/* Accordion Styles */
.accordion-item {
    /*background-color: var(--white);*/
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}


.section-bg-cream .accordion-item {
    background-color: var(--white);
    border-color: rgba(0, 0, 0, 0.05);
}

.section-bg-pale-green .accordion-item {
    background-color: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.05);
}

.accordion-header {
    padding: 25px 30px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.accordion-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark-color);
    font-family: 'MiSans-Bold', sans-serif;
}

.accordion-icon {
    color: var(--teal-green);
    font-size: 24px;
    transition: transform 0.3s;
}

.accordion-content {
    padding: 0 30px 25px;
    font-size: 16px;
    line-height: 1.6;
    color: #5a6b7c;
    display: none;
}

/* Expanded State Simulation */
.accordion-item.expanded {
    border-left: 5px solid var(--teal-green);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.accordion-item.expanded .accordion-content {
    display: block;
}

.accordion-item.expanded .accordion-icon {
    transform: rotate(180deg);
}

/**/
input {
    width: 100%;
    padding: 16px 16px 16px 45px;
    border: 2px solid transparent;
    border-radius: 12px;
    font-family: 'MiSans-Medium', sans-serif;
    font-size: 16px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    color: var(--primary-color);
}

input:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
}

#calculate-btn {
    width: 170px;
    font-size: 16px;
    background: rgb(128, 136, 129);
    font-size: 1.5em;
    padding: 5px;
    margin: 8px 0;
    color: #fff;
}

#calculate-btn.active {
    background: var(--medium-green);
}

#calculate-btn :hover {
    background: var(--teal-green);
}

#calculate-btn :disabled {
    background: var(--light-cream);
    color: #aaa;
    cursor: not-allowed;
}

.loan-section {
    padding: 10px 5%;
}

.is-visible {
    opacity: 1;
    /* Final state: fully visible */
}

.loan-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Mobile-first loan fields */
.loan-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 0;
}

.loan-fields label {
    width: 42%;
    flex-shrink: 0;
    padding: 5px 0;
    font-weight: 600;
}

.loan-fields input,
.loan-fields select {
    flex: 1;
    min-width: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 12px 8px;
    font-size: 16px;
}

.loan-fields b {
    flex-basis: 100%;
    width: 100%;
}

/* Desktop layout for loan fields */
@media (min-width: 768px) {
    .loan-fields {
        flex-direction: row;
        gap: 10px;
        align-items: center;
    }

    .loan-fields label {
        width: 210px;
        padding: 10px 0;
        flex-shrink: 0;
    }

    .loan-fields input,
    .loan-fields select {
        width: 250px;
        flex-shrink: 0;
    }
}

input::placeholder {
    padding: 5px;
    font-weight: bolder;
}

input[readonly],
input[disabled] {
    font-size: 16px;
    font-weight: bolder;
    border-radius: 10px;
    text-align: end;
    background-color: #f5f5f5;
    cursor: not-allowed;
}

input[required],
select[required] {
    font-size: 16px;
    font-weight: bolder;
    border-radius: 10px;
    text-align: end;
    border: 2px solid #088760;
}

/* Better focus states for accessibility */
button:focus,
input:focus,
select:focus {
    outline: 2px solid var(--teal-green);
    outline-offset: 2px;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Prevent horizontal overflow on mobile */
.loan-calculator-wrapper,
.calculator-wrapper,
.container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Mobile-friendly animations */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.d-none {
    display: none;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .loan-calculator-wrapper {
        grid-template-columns: 1fr;
        /*margin: -60px 3% 80px;*/
    }

    .loan-calc-form {
        border-right: none;
        border-bottom: 1px solid var(--light-cream);
    }
}

@media (max-width: 1200px) {

    .hero,
    .quick-links,
    .loan-section,
    .still-questions,
    footer {
        /* padding-left: 40px;
                padding-right: 40px; */
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .calculator-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .container {
        grid-template-columns: 1fr;
    }

    .input-section {
        border-radius: 20px 20px 0 0;
    }

    .results-section {
        border-radius: 0 0 20px 20px;
    }
}

@media (max-width: 992px) {

    .nav-links,
    .header-actions {
        display: none;
    }

    .hero h1 {
        font-size: 42px;
    }

    .quick-links {
        padding: 30px 20px;
    }

    .loan-fields {
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    .loan-fields label {
        width: 42%;
        flex-shrink: 0;
    }

    .loan-fields input,
    .loan-fields select {
        flex: 1;
        min-width: 0;
    }

    .loan-fields b {
        flex-basis: 100%;
        width: 100%;
    }

    .summary-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .loan-result-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 768px) {

    input[readonly],
    input[disabled] {
        font-size: 14px;

        text-align: start;

    }

    input[required],
    select[required] {
        font-size: 14px;

        text-align: start;

    }



    .hero {
        padding: 60px 20px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero p {
        font-size: 18px;
    }

    .search-input {
        padding: 15px 50px 15px 20px;
        font-size: 16px;
    }

    .loan-section {
        /* padding: 60px 20px; */
    }

    .section-title {
        font-size: 24px;
    }

    .still-questions {
        padding: 60px 20px;
    }

    .still-questions h2 {
        font-size: 28px;
    }

    .cta-group {
        flex-direction: column;
        align-items: center;
    }

    .cta-group button {
        width: 100%;
        max-width: 300px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-brand p {
        max-width: 100%;
    }

    .accordion-title {
        font-size: 16px;
    }

    /* Mobile calculator improvements */
    .loan-calculator-wrapper {
        /*margin: -40px 2% 60px;*/
        border-radius: 16px;
    }

    .loan-calc-form,
    .loan-calc-results {
        padding: 30px 20px;
    }

    .calc-title {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .input-box {
        width: 120px;
        font-size: 16px;
    }

    .loan-result-value-lg {
        font-size: 28px;
    }

    .loan-result-value-md {
        font-size: 24px;
    }

    .chart-container {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

}

@media (max-width: 576px) {
    .hero {
        padding: 40px 15px;
    }

    .hero h1 {
        font-size: 28px;
        line-height: 1.2;
    }

    .hero p {
        font-size: 16px;
    }

    .search-input {
        padding: 12px 45px 12px 15px;
        font-size: 14px;
    }

    .loan-section {
        /* padding: 40px 15px; */
    }

    .still-questions {
        padding: 40px 15px;
    }

    .still-questions h2 {
        font-size: 24px;
    }

    .quick-links {
        padding: 20px 15px;
        flex-direction: column;
        align-items: stretch;
    }

    .quick-label {
        margin-right: 0;
        margin-bottom: 10px;
        text-align: center;
    }

    .loan-calculator-wrapper {
        /*margin: -10px 1% 40px;*/
        border-radius: 12px;
    }

    .loan-calc-form,
    .loan-calc-results {
        padding: 20px 15px;
    }

    .calc-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .input-group {
        margin-bottom: 25px;
    }

    .input-box {
        width: 100%;
        font-size: 14px;
        padding: 8px 12px;
    }

    .loan-result-value-lg {
        font-size: 24px;
    }

    .loan-result-value-md {
        font-size: 20px;
    }

    .loan-result-header {
        font-size: 14px;
    }

    /* Mobile table responsiveness */
    .schedule-table,
    .amortizationTable,
    .amortizationTable2 {
        font-size: 12px;
    }

    .schedule-table th,
    .schedule-table td,
    .amortizationTable th,
    .amortizationTable td,
    .amortizationTable2 th,
    .amortizationTable2 td {
        padding: 8px 4px;
    }

    /* Make tables scrollable on mobile */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Loan schedule: compact layout on small screens */
    .loan-schedule-wrapper table {
        font-size: 12px;
        min-width: 560px;
    }

    .loan-schedule-wrapper thead th,
    .loan-schedule-wrapper tbody td {
        padding: 8px 10px;
    }

    /* Slightly thicker scrollbar thumb on touch devices for easier grabbing */
    .loan-schedule-wrapper::-webkit-scrollbar {
        height: 12px;
    }

    /* Form improvements */
    input[type="number"],
    select {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    button {
        padding: 16px;
        font-size: 16px;
    }

    .btn {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 24px;
    }

    .section-title {
        font-size: 20px;
    }

    .accordion-header {
        padding: 20px 15px;
    }

    .accordion-content {
        /*padding: 0 15px 20px;*/
    }

    .loan-result-value-lg {
        font-size: 20px;
    }

    .loan-result-value-md {
        font-size: 18px;
    }

    /* Hide some columns on very small screens */
    .amortizationTable th:nth-child(2),
    .amortizationTable td:nth-child(2),
    .amortizationTable2 th:nth-child(2),
    .amortizationTable2 td:nth-child(2) {
        display: none;
    }
}

/* Landscape orientation fixes */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        padding: 30px 20px;
    }

    .hero h1 {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .hero p {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .loan-calculator-wrapper {
        /*margin: -20px 2% 30px;*/
    }

    .loan-calc-form,
    .loan-calc-results {
        padding: 20px;
    }
}

.reset_icon {
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;

}

.reset_icon:hover {
    transform: scale(1.03);

}