/* BUSINESS LOAN CALCULATOR - PRODUCTION CSS v1.3 */
/* BASE: Adapted from car-lease-calculator.css & mortgage-calculator.css */
/* v1.3 UPDATE: More compact header, full-width banners, reduced summary card height */

:root {
    --primary: #24ACB9; /* FinGuid Teal */
    --primary-dark: #19343B; /* FinGuid Dark Teal */
    --accent: #FFC107; /* FinGuid Yellow */
    --accent-dark: #E69500;
    --business-blue: #2952A3; /* Specific Business Blue */
    --text: #1F2121;
    --text-light: #64748B;
    --bg: #FFFFFD;
    --bg-secondary: #F5F7FA;
    --card: #FFFFFF;
    --border: #E2E8F0;
    --error: #EF4444;
    --success: #10B981;
}

[data-color-scheme="dark"] {
    --text: #E1E8ED;
    --text-light: #B8C5D0;
    --bg: #1F2121;
    --bg-secondary: #242B36;
    --card: #181919;
    --border: #38444D;
}

/* === Base & Layout (from car-lease) === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Skip Link Styling (Accessibility) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 9999;
    font-weight: 600;
}
.skip-link:focus { top: 16px; }

/* === HEADER (v1.3 - More Compact) === */
.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-top { 
    padding: 8px 0; 
    width: 100%; /* Ensure full screen width */
}

.header-top .container {
    display: flex;
    align-items: center;
    justify-content: flex-start; 
    gap: 16px; 
    flex-wrap: nowrap; 
    overflow-x: auto;
    padding: 0 16px;
}
.logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--primary);
    font-size: 1.125rem; 
    font-weight: bold;
    white-space: nowrap; 
}

/* NEW: Title grouping */
.header-title-group {
    display: flex;
    align-items: baseline;
    gap: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-title {
    font-size: 1rem; 
    font-weight: 600;
    color: var(--text);
    margin: 0; 
    white-space: nowrap;
}
.site-subtitle {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0; 
    white-space: nowrap;
}

/* NEW: Spacer to push controls right */
.header-spacer {
    flex-grow: 1;
    min-width: 16px;
}

.header-controls {
    display: flex;
    gap: 8px;
    flex-shrink: 0; 
}
/* === END HEADER UPDATE === */

.btn-icon {
    width: 36px; 
    height: 36px; 
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-icon:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
}
.install-button {
    background-color: var(--success);
    color: white;
    border-color: var(--success);
}
.install-button.hidden { display: none; }

/* === Sponsor & Breadcrumb (Full Width) === */
.sponsor-banner {
    /* Full width background */
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: white;
    padding: 16px 0; /* Padding applied here, full width */
    width: 100%; /* Ensure full screen width */
}
.sponsor-content {
    /* Content wrapper for alignment */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    text-align: center;
}
.sponsor-banner a {
    padding: 8px 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.3);
    transition: all 0.2s;
}
.sponsor-banner a:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.breadcrumb {
    background: var(--bg-secondary);
    padding: 16px 0;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
    width: 100%; /* Ensure full screen width */
}
.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}
.breadcrumb span { color: var(--text-light); }

/* === Main Layout (from car-lease) === */
.main { padding: 48px 0; }
.calculator-wrapper {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
}
.inputs-panel,
.results-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.125rem;
    margin-bottom: 24px;
    color: var(--primary);
}

/* === Inputs (from car-lease) === */
.input-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.input-section:last-child { border-bottom: none; }
.section-heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--business-blue);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.875rem;
}
.form-group label span {
    color: var(--primary);
    cursor: help;
}
.form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: 4px;
    font-family: inherit;
    transition: all 0.2s;
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(36, 172, 185, 0.1);
}
.form-group small {
    display: block;
    color: var(--text-light);
    font-size: 0.75rem;
    margin-top: 4px;
}
.fred-note { color: var(--accent); font-weight: 600; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* === SBA Tabs === */
.sba-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.sba-tab-btn {
    padding: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.sba-tab-btn:hover {
    background: var(--bg-secondary);
    color: var(--text);
}
.sba-tab-btn.active {
    background: var(--business-blue);
    color: white;
    border-color: var(--business-blue);
}

/* === Results (from car-lease) === */
.ad-slot {
    background: var(--bg-secondary);
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
}
.ad-label {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

/* START: ESTIMATED MONTHLY PAYMENT CARD HEIGHT REDUCTION */
.summary-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 16px; /* REDUCED from 24px */
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(36, 172, 185, 0.2); 
}
.summary-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px; /* REDUCED from 12px */
}
.payment-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin: 8px 0; /* REDUCED from 16px 0 */
}
.amount { 
    font-size: 2rem; /* REDUCED from 2.5rem */
    font-weight: bold; 
}
.unit { 
    font-size: 1rem; /* Reduced from 1.125rem */
    opacity: 0.9; 
}
.payment-breakdown {
    font-size: 0.875rem;
    text-align: center;
    margin-top: 8px;
    opacity: 0.8;
}
/* END: ESTIMATED MONTHLY PAYMENT CARD HEIGHT REDUCTION */

/* === Tabs (from car-lease) === */
.tabs { margin-bottom: 24px; }
.tab-buttons {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
}
.tab-btn {
    padding: 16px 24px;
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -2px;
    white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === Results Grid (from car-lease) === */
.result-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.125rem;
    margin: 24px 0 16px 0;
}
.lease-title { color: var(--accent-dark); }
.buy-title { color: var(--business-blue); }
.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.result-box {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 6px;
    border-left: 4px solid var(--border);
    transition: all 0.2s;
}
.result-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.result-box.highlight {
    border-left-color: var(--primary);
    background: rgba(36, 172, 185, 0.1);
}
.result-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.result-value {
    display: block;
    font-size: 1.25rem;
    font-weight: bold;
}
.verdict-box {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 8px;
    border-left: 4px solid var(--border);
    text-align: center;
    margin: 24px 0;
}

/* === Chart & Table === */
.chart-container {
    position: relative;
    width: 100%;
    height: 350px;
}
.table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}
#amortization-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
#amortization-table th,
#amortization-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
#amortization-table th {
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
}
#amortization-table tbody tr:nth-child(even) {
    background: var(--bg-secondary);
}

/* === AI Insights & FAQ (from car-lease) === */
.insights-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.insight-item {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}
.faq-container details {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 12px;
}
.faq-container summary {
    font-weight: 600;
    padding: 16px;
    cursor: pointer;
}
.faq-container p {
    padding: 0 16px 16px;
    color: var(--text-light);
}

/* === Affiliate & Footer (from car-lease) === */
.affiliate-box {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
}
.affiliate-box h3 { margin-bottom: 8px; }
.affiliate-box p { color: var(--text-light); margin-bottom: 16px; }
.btn-primary {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 1rem;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(36, 172, 185, 0.3);
}
.footer {
    background: var(--card);
    border-top: 1px solid var(--border);
    margin-top: 48px;
    width: 100%; /* Ensure full screen width */
}
.footer-sponsor {
    background: linear-gradient(135deg, rgba(41, 82, 163, 0.1) 0%, rgba(19, 52, 59, 0.1) 100%);
    padding: 48px 0;
    border-bottom: 1px solid rgba(41, 82, 163, 0.2);
}
.sponsor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}
.sponsor-item { text-align: center; }
.sponsor-item h4 { margin-bottom: 8px; }
.sponsor-item p { color: var(--text-light); margin-bottom: 16px; font-size: 0.875rem; }
.sponsor-item a {
    display: inline-block;
    padding: 8px 16px;
    background: var(--accent);
    color: var(--text);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.2s;
}
.sponsor-item a:hover {
    background: var(--accent-dark);
    color: white;
}
.footer-nav { padding: 48px 0; border-bottom: 1px solid var(--border); }
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
}
.footer-col h5 { margin-bottom: 12px; }
.footer-col p { font-size: 0.875rem; color: var(--text-light); margin-bottom: 8px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.875rem;
}
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
    padding: 24px 0;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-light);
    border-top: 1px solid var(--border);
}
.footer-social {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}
.footer-social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    transition: all 0.2s;
    margin: 0 !important;
}
.footer-social a:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

/* === Toast (from car-lease) === */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    background: var(--card);
    padding: 16px 24px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-left: 4px solid var(--success);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.info { border-left-color: var(--business-blue); }

/* === Tooltip (from car-lease) === */
.tooltip-box {
    position: fixed;
    background: #1a1a1a;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    max-width: 200px;
    white-space: normal;
}

/* === Responsive (from car-lease) === */
@media (max-width: 1024px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
    }
    .header-title-group {
        display: none; /* Hide title group on smaller screens to save space */
    }
}
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .result-grid {
        grid-template-columns: 1fr;
    }
    .sponsor-grid {
        grid-template-columns: 1fr;
    }
    .tab-btn {
        font-size: 0.875rem;
        padding: 12px 16px;
    }
    .header-top .container {
        gap: 8px; /* Further reduce gap on mobile */
    }
    .site-title, .site-subtitle {
        display: none; /* Hide text on mobile, logo and icons are enough */
    }
    .header-title-group {
        display: none;
    }
}
