:root {
    --primary: #2c3e50;
    --secondary: #ff6b6b;
    --accent: #3d5a80;
    --light-bg: #f8f9fa;
    --teal: #4ecdc4;
    --border-color: #e0e0e0;
    --text-color: #000000;
    --text-light: #666;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #000;
    background-color: var(--light-bg);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
}

main {
   
}

h1 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #000;
    border-bottom: 2px solid var(--teal);
    padding-bottom: 0.5rem;
    text-align: center;
}

h2 {
    font-size: 1.125rem;
    margin: 1.5rem 0 1rem;
    color: #ff6b6b;
}

h3 {
    font-size: 1rem;
    margin: 1rem 0 0.5rem;
    color: #000;
}

.calculator-grid {
    display: grid;
    gap: 20px;
}

/* Mobile Layout (≤767px) */
.calculator-grid {
    grid-template-columns: 1fr;
}

#ad-left, #ad-right, #ad-tablet {
    display: none;
}

#ad-mobile {
    display: block;
    width: 100%;
    max-width: 320px;
    height: 100px;
    margin: 10px auto;
    background-color: var(--light-bg);
    border: 1px dashed var(--border-color);
    text-align: center;
    line-height: 100px;
    color: #000;
}

.mobile-tablet-tools {
    display: block;
    margin: 20px 0;
}

.desktop-tools {
    display: none;
}

#related-tools {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.tools-list {
    list-style: none;
}

.tools-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    color: #000;
}

.tools-list li:last-child {
    border-bottom: none;
}

.tools-list a {
    color: #000;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tools-list a:hover {
    color: var(--teal);
}

/* Calculator Form Styles */
.calculator-form {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #000;
}

input, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    color: #000;
}

.radio-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #000;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    color: #000;
}

.checkbox-group input {
    width: auto;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

button {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

#calculate-btn {
    background-color: var(--accent);
    color: white;
}

#calculate-btn:hover {
    background-color: var(--primary);
}

#reset-btn {
    background-color: var(--secondary);
    color: white;
}

#reset-btn:hover {
    background-color: #e05555;
}

/* Results Section */
.results-section {
    display: none;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-item {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    text-align: center;
}

.result-item label {
    color: #000;
}

.result-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #000;
    margin: 0.5rem 0;
}

.eligibility-result {
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
    text-align: center;
    font-weight: bold;
}

.eligibility-pass {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.eligibility-fail {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.payment-breakdown {
    margin-top: 1.5rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    color: #000;
}

.breakdown-total {
    font-weight: bold;
    border-bottom: none;
    border-top: 2px solid var(--border-color);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    color: #000;
}

/* Advanced Features */
.advanced-features {
    margin-top: 1.5rem;
}

.feature-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tab {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    font-size: 1rem;
    color: #000;
}

.tab.active {
    background-color: var(--light-bg);
    border-color: var(--border-color);
    border-bottom: 1px solid var(--light-bg);
    margin-bottom: -1px;
}

.tab-content {
    display: none;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.tab-content.active {
    display: block;
}

/* Detail Results Styles */
.detail-results {
    margin-top: 1rem;
}

.detail-item {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-label {
    font-weight: bold;
    color: #000;
}

.detail-value {
    color: #000;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.comparison-table th, .comparison-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: #000;
}

.comparison-table th {
    background-color: var(--light-bg);
    font-weight: bold;
    font-size: 1rem;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

/* Schedule Table Styles */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.schedule-table th, .schedule-table td {
    padding: 0.5rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    color: #000;
}

.schedule-table th {
    background-color: var(--light-bg);
    font-weight: bold;
    text-align: center;
    font-size: 1rem;
}

.schedule-table th:first-child,
.schedule-table td:first-child {
    text-align: left;
}

.schedule-table tr:last-child td {
    border-bottom: none;
}

.schedule-container {
    max-height: 400px;
    overflow-y: auto;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Chart Styles */
.chart-container {
    margin: 1rem 0;
    padding: 1rem;
    background-color: var(--light-bg);
    border-radius: 4px;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.chart-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-align: center;
    color: #000;
}

.chart-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.chart-control {
    padding: 0.25rem 0.5rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    color: #000;
}

.chart-control.active {
    background-color: var(--teal);
    color: white;
}

.pie-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.pie-chart {
    width: 200px;
    height: 200px;
    max-width: 100%;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
    background: conic-gradient(
        var(--accent) 0% 40%,
        var(--teal) 40% 60%,
        var(--secondary) 60% 75%,
        #ffa500 75% 85%,
        #9370db 85% 100%
    );
}

.pie-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1rem;
    gap: 0.5rem;
    width: 100%;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    color: #000;
}

.legend-item:hover {
    opacity: 0.8;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.bar-chart {
    height: 200px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    margin-top: 1rem;
    padding: 0 1rem;
    position: relative;
    width: 100%;
}

.bar {
    width: 30px;
    max-width: 15%;
    background-color: var(--accent);
    position: relative;
    border-radius: 2px 2px 0 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.bar:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.bar-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.875rem;
    white-space: nowrap;
    color: #000;
}

.export-options {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.export-btn {
    padding: 0.5rem 1rem;
    background-color: var(--teal);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

/* Print Report Button Styles */
.print-report-btn {
    background-color: #ff6b6b;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.print-report-btn:hover {
    background-color: #e05555;
}

/* Custom loan term input */
.custom-loan-term-container {
    display: none;
    margin-top: 0.5rem;
}

/* Schedule Navigation Styles */
.schedule-table small {
    font-size: 0.875rem;
    color: #000;
    display: block;
    margin-top: 2px;
}

.schedule-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    padding: 10px;
    background: var(--light-bg);
    border-radius: 4px;
}

.nav-btn {
    padding: 5px 10px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.nav-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
}

#month-range {
    font-weight: bold;
    color: #000;
    font-size: 1rem;
}

/* Form Note Styles */
.form-note {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #ff6b6b;
    padding: 0.5rem;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    display: none;
}

/* Tablet Layout (768px–1024px) */
@media (min-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.125rem;
    }

    .tab {
        font-size: 1rem;
    }

    #ad-mobile, #ad-left, #ad-right {
        display: none;
    }

    #ad-tablet {
        display: block;
        width: 100%;
        max-width: 300px;
        height: 250px;
        margin: 10px auto 0;
        background-color: var(--light-bg);
        border: 1px dashed var(--border-color);
        text-align: center;
        line-height: 250px;
        color: #000;
    }

    .mobile-tablet-tools {
        max-width: 100%;
        margin: 20px auto;
    }

    .pie-chart {
        width: 250px;
        height: 250px;
    }
}

/* Desktop Layout (≥1025px) */
@media (min-width: 1025px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.375rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .tab {
        font-size: 1rem;
    }

    .calculator-grid {
        grid-template-columns: 300px 1fr 300px;
    }

    #ad-mobile, #ad-tablet {
        display: none;
    }

    #ad-left, #ad-right {
        display: block;
    }

    .sidebar {
        position: sticky;
        top: 20px;
        align-self: start;
    }

    #ad-left {
        width: 100%;
        height: 250px;
        background-color: var(--light-bg);
        border: 1px dashed var(--border-color);
        text-align: center;
        line-height: 250px;
        color: #000;
        margin-bottom: 20px;
    }

    #ad-right {
        width: 100%;
        height: 600px;
        background-color: var(--light-bg);
        border: 1px dashed var(--border-color);
        text-align: center;
        line-height: 600px;
        color: #000;
    }

    .mobile-tablet-tools {
        display: none;
    }

    .desktop-tools {
        display: block;
    }

    #related-tools {
        width: 100%;
        background: white;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    }

    .pie-chart {
        width: 300px;
        height: 300px;
    }
}

/* Add breadcrumb styles */
.breadcrumb {
    padding: 0px 10px;
    color: #000;
    margin-bottom: 5px;
    font-size: 1rem;
}

.breadcrumb a {
    color: #000;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

@media (max-width: 1024px) {
    h1 {
        font-size: 1.25rem;
    }

    h2 {
        font-size: 1.125rem;
    }

    h3 {
        font-size: 1rem;
    }

    .tab {
        font-size: 0.875rem;
    }

    .calculator-grid {
        gap: 0px !important;
        margin-top: 0px !important;
    }
}

/* Mobile and Tablet: Remove all top margins from calculator containers */
@media (max-width: 1024px) {
    .calculator-grid,
    .calculator-form,
    .form-section,
    .results-section {
        margin-top: 0px !important;
    }
}
.mobile-table {
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid #eee;
    border-radius: 8px;
}
.mobile-table table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}
.mobile-table th, .mobile-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.mobile-table th {
    background-color: #4ecdc4;
    font-weight: bold;
}
.mobile-table tr:nth-child(even) {
    background-color: #fafafa;
}