/* Simple Calculator CSS - Mobile First Design */
:root {
    --primary-color: #0046E5;
    --success-color: #10b981;
    --warning-color: #ff9800;
    --danger-color: #d32f2f;
    --light-gray: #f8f9fa;
    --border-color: #e2e8f0;
    --text-dark: #333;
    --text-muted: #6c757d;
    --gorealo-gradient: linear-gradient(135deg, #0046E5, #0063ff);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f7fa;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}
/* Loan Type Tabs - More compact with branding colors */
.loan-type-tabs {
    display: flex;
    background: #f5f7f9;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid #e0e4e8;
}

.loan-type-tab {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-right: 1px solid #e0e4e8;
    color: #566a7f;
}

.loan-type-tab:last-child {
    border-right: none;
}

.loan-type-tab.active {
    background: #0046E5; /* GoRealo brand blue */
    color: white;
}

/* Credit Score Section - More compact */
.credit-score-section {
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 6px;
    background: #f5f7f9;
}

.credit-score-toggle {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.credit-score-toggle label {
    margin-left: 6px;
    margin-bottom: 0;
    font-weight: 500;
    font-size: 0.9rem;
}

.credit-score-fields {
    display: none;
    gap: 10px;
    margin-top: 10px;
}

.credit-score-fields.visible {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.credit-score-fields .form-group {
    margin-bottom: 10px;
}

.credit-score-fields label {
    font-size: 0.85rem;
    margin-bottom: 4px;
    display: block;
}

.credit-score-fields input {
    border-radius: 6px;
    border: 1px solid #dde1e5;
    padding: 8px 12px;
    width: 100%;
}

/* Loan Amount Input */
.loan-amount-input {
    margin-bottom: 15px;
}

.loan-amount-input label {
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
}

.loan-amount-input .input-group {
    margin-bottom: 10px;
}

.loan-amount-input .input-group-text {
    background-color: #f5f7f9;
    border-right: none;
    font-weight: 600;
}

.loan-amount-input .form-control {
    border-left: none;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: right;
}

/* Slider purpose layout */
.slider-purpose {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    background: #f5f7f9;
}

.slider-purpose h4 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #333;
}

/* Pay-Off styling */
.savings-item .savings-label {
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.payoff-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.payoff-years {
    font-size: 1.1rem;
    margin-bottom: 2px;
    font-weight: 700;
    color: var(--success-color);
}

.payoff-label {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    margin-top: -2px;
    color: #6c757d;
}

.payoff-label i {
    margin-left: 4px;
    color: #ffd700;
}
/* Main container - Full viewport height on mobile */
.calculator-container {
    max-width: 100%;
    padding: 10px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 20px;
}

/* Calculator Card */
.calc-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 15px;
    overflow: hidden;
    width: 100%;
}

/* Desktop Layout Container */
.desktop-layout-container {
    display: flex;
    flex-direction: column;
}

/* Header */
.calc-header {
    text-align: center;
    margin-bottom: 20px;
}

.calc-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.calc-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

/* Loan Slider Section */
.loan-slider-section {
    margin-bottom: 15px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.slider-header label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.slider-header #formattedAmount {
    font-weight: 700;
    color: var(--primary-color);
}

/* Slider Container */
.slider-container {
    position: relative;
    width: 100%;
    padding: 0 2px;
}

/* Slider Labels */
.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    position: relative;
}

.slider-labels .label-left, 
.slider-labels .label-right {
    font-size: 0.75rem;
    color: var(--text-dark);
    position: relative;
    font-weight: 600;
}

.label-left {
    color: var(--success-color);
}

.label-right {
    color: var(--primary-color);
}

/* Dynamic indicator bubbles */
.payment-bubble,
.power-bubble {
    position: absolute;
    padding: 6px 15px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
    top: 60px;
    transform: translateX(-50%);
    white-space: nowrap;
    transition: opacity 0.3s ease, left 0.5s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.payment-bubble {
    background-color: white;
    border: 2px solid var(--success-color);
    color: var(--success-color);
    left: 20%;
    opacity: 0;
}

.power-bubble {
    background-color: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    left: 80%;
    opacity: 0;
}

.payment-bubble.active,
.power-bubble.active {
    opacity: 1;
}

/* Loan Slider */
.loan-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, 
        var(--success-color) 0%, 
        var(--primary-color) 100%);
    outline: none;
    margin: 10px 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.loan-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.loan-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.loan-slider::-webkit-slider-thumb:hover, 
.loan-slider::-webkit-slider-thumb:active {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.loan-slider::-moz-range-thumb:hover, 
.loan-slider::-moz-range-thumb:active {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* Term Selector */
.input-row {
    margin-bottom: 15px;
}

.term-selector {
    width: 100%;
}

.term-selector label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.form-select {
    display: block;
    width: 100%;
    padding: 10px 15px;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-dark);
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.form-select:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(0, 70, 229, 0.25);
}

/* Rate Selectors */
.rates-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
}

.rate-selector {
    flex: 1;
}

.rate-selector label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.rate-display {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.rate-display:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 70, 229, 0.1);
}

.rate-display .rate-value {
    font-size: 1.1rem;
    font-weight: 700;
    margin-right: 8px;
}

.gorealo-rate {
    background: var(--gorealo-gradient);
    border-color: var(--primary-color);
    box-shadow: 0 3px 10px rgba(0, 70, 229, 0.2);
}

.gorealo-rate .rate-value {
    color: white;
}

.dropdown-icon {
    margin-left: auto;
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Badges */
.rate-badge {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.rate-badge.high {
    background-color: var(--danger-color);
    color: white;
}

.rate-badge.best {
    background-color: #00d16b;
    color: white;
    position: relative;
    padding-left: 15px;
}

.rate-badge.best::before {
    content: "✓";
    position: absolute;
    left: 5px;
    top: 3px;
}

.rate-badge.low {
    background-color: var(--success-color);
    color: white;
}

/* Results Section */
.results-section {
    margin-bottom: 15px;
}

.savings-container {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.savings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.savings-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--success-color);
}

.savings-badge {
    background-color: var(--success-color);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.savings-badge::before {
    content: "★";
    margin-right: 3px;
}

/* Savings Grid */
.savings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Savings item with view details link */
.savings-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid transparent;
    text-align: center;
}

.savings-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.savings-item.active {
    border-color: var(--primary-color);
    background-color: #f0f7ff;
}

.savings-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.savings-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 5px;
}

.view-details {
    font-size: 0.8rem;
    color: var(--primary-color);
    text-decoration: underline;
    margin-top: 5px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.savings-item:hover .view-details {
    opacity: 1;
}

/* Expandable details panel */
.savings-details-panel {
    margin-top: 10px;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    display: none;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    position: relative;
    border-top: 3px solid var(--primary-color);
}

.savings-details-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.details-content {
    display: none;
    padding: 0;
}

.details-content.active {
    display: block;
}

.details-header {
    background: #f7f9fc;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eaeef3;
}

.details-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.close-details {
    background: none;
    border: none;
    color: #8c8c8c;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-details:hover {
    background: rgba(0,0,0,0.05);
    color: #333;
}

.details-body {
    padding: 15px 20px;
}

.details-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.details-row:last-child {
    border-bottom: none;
}

.details-row.highlight {
    background-color: #f0f7ff;
    border-radius: 8px;
    padding: 12px 10px;
    margin: 10px 0;
    border-left: 3px solid var(--primary-color);
}

.details-label {
    font-weight: 500;
    color: #555;
}

.details-value {
    font-weight: 600;
    color: #333;
}

.details-row.highlight .details-value {
    color: var(--primary-color);
    font-weight: 700;
}

/* Indicator for active savings item */
.savings-item.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--primary-color);
}

/* Comparison Container */
.comparison-container {
    margin-bottom: 15px;
}

.comparison-row {
    display: flex;
    gap: 10px;
}

.lender-column {
    flex: 1;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.lender-column.gorealo {
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 70, 229, 0.15);
    position: relative;
}

.lender-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--light-gray);
    border-bottom: 1px solid var(--border-color);
}

.lender-column.gorealo .lender-header {
    background: var(--gorealo-gradient);
    color: white;
}

.lender-column.gorealo .lender-header h4 {
    color: white;
}

.lender-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.payment-info, .fee-info {
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.payment-info {
    border-bottom: 1px solid var(--border-color);
}

.payment-label, .fee-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.payment-value, .fee-value {
    font-size: 1rem;
    font-weight: 600;
}

.fee-value {
    color: var(--danger-color);
}

.lender-column.gorealo .fee-value {
    color: var(--success-color);
}

/* CTA Button */
.cta-container {
    margin-bottom: 15px;
    text-align: center;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
    width: 100%;
}

.cta-button:hover, .cta-button:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
    color: white;
}

/* Advanced Toggle */
.advanced-toggle {
    text-align: center;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.toggle-btn i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.toggle-btn.active i {
    transform: rotate(180deg);
}

/* Advanced View Section */
.advanced-view {
    display: none;
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-top: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Advanced Tabs Navigation */
.advanced-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    position: relative;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.tab-btn i {
    margin-right: 6px;
    font-size: 1.1rem;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

/* Tab Content */
.tab-content {
    position: relative;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.chart-item {
    background: rgba(248, 250, 252, 0.5);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
}

/* Amortization Table Styles */
.amortization-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.control-row {
    flex: 1;
    min-width: 150px;
}

.control-row label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.amortization-tables {
    overflow: hidden;
}

.amortization-comparison {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.amortization-table-container {
    flex: 1;
}

.amortization-table-container h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding-left: 5px;
}

.table-wrapper {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.amortization-table {
    width: 100%;
    border-collapse: collapse;
}

.amortization-table th,
.amortization-table td {
    padding: 10px;
    text-align: right;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.amortization-table th {
    background-color: #f8fafc;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.amortization-table th:first-child,
.amortization-table td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background-color: white;
    z-index: 5;
}

.amortization-table th:first-child {
    z-index: 15;
    background-color: #f8fafc;
}

.amortization-table tr:hover td {
    background-color: rgba(0, 70, 229, 0.05);
}

/* Breakdown Styles */
.breakdown-container {
    padding: 5px;
}

.breakdown-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.breakdown-column {
    flex: 1;
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.breakdown-column h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
    text-align: center;
}

.pie-chart-container {
    height: 200px;
    position: relative;
    margin-bottom: 15px;
}

.breakdown-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.stat-item.total {
    background-color: #f1f5f9;
    margin-top: 5px;
}

.stat-item.total .stat-label {
    font-weight: 600;
    color: var(--text-dark);
}

.stat-item.total .stat-value {
    color: var(--primary-color);
    font-size: 1rem;
}

.savings-summary {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-top: 10px;
}

.savings-summary h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--success-color);
    margin-bottom: 10px;
}

.savings-amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 10px;
}

.savings-summary p {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin: 0;
}

/* Market Info Styles */
.market-info {
    padding: 5px;
}

.market-section {
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.market-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.market-stats {
    margin-bottom: 15px;
}

.market-stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.market-stat {
    flex: 1;
    min-width: 150px;
    background-color: white;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.stat-name {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.market-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    margin: 5px 0 0;
}

.market-chart-container {
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.market-chart-container h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.regional-rates {
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.regional-rates h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.usa-map-container {
    position: relative;
}

.region-key {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.region-item {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
}

.region-color {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 3px;
    margin-right: 5px;
}

.region-name {
    color: var(--text-muted);
}

.market-tips {
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.market-tips h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.tips-list {
    margin: 0;
    padding-left: 20px;
}

.tips-list li {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.5;
}

.tips-list li:last-child {
    margin-bottom: 0;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Media Queries */
@media (min-width: 768px) {
    .calculator-container {
        max-width: 720px;
        padding: 20px;
    }
    
    .calc-card {
        padding: 25px;
    }
    
    .calc-header h2 {
        font-size: 1.8rem;
    }
    
    .calc-header p {
        font-size: 1rem;
    }
    
    .desktop-layout-container {
        flex-direction: row;
        gap: 25px;
    }
    
    .inputs-column {
        width: 35%;
    }
    
    .results-column {
        width: 65%;
    }
    
    .savings-grid {
        gap: 15px;
    }
    
    .savings-value {
        font-size: 1.4rem;
    }
    
    .payment-value, .fee-value {
        font-size: 1.1rem;
    }
    
    .cta-button {
        max-width: 300px;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .amortization-comparison {
        flex-direction: row;
    }
    
    .breakdown-row {
        flex-direction: row;
    }
}

@media (min-width: 992px) {
    .calculator-container {
        max-width: 960px;
    }
    
    .savings-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .advanced-view {
        padding: 25px;
    }
}

@media (min-width: 1200px) {
    .calculator-container {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .calculator-container {
        max-width: 1320px;
    }
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 1s;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-down {
    animation: slideDown 0.3s ease-out;
}

/* Glow effect for GoRealo elements */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(0, 70, 229, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(0, 70, 229, 0.7);
    }
    100% {
        box-shadow: 0 0 5px rgba(0, 70, 229, 0.5);
    }
}

.lender-column.gorealo:hover {
    animation: glow 1.5s infinite;
}

/* APR Info */
.apr-info {
    padding: 8px 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background-color: #f9f9f9;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.apr-label {
    font-size: 0.7rem;
    margin-right: 5px;
    opacity: 0.8;
}

.apr-value {
    font-weight: 600;
}

.lender-column.gorealo .apr-info {
    background-color: rgba(0, 70, 229, 0.05);
}

/* Market Tab Styles */
.market-chart-container {
    position: relative;
    margin-bottom: 2rem;
}

.chart-container {
    min-height: 350px;
    height: 400px;
    transition: opacity 0.3s ease;
    position: relative;
    margin-bottom: 1rem;
}

.chart-loading, .chart-error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 5;
}

    .chart-loading p, .chart-error p {
        margin-top: 1rem;
        font-weight: 500;
    }

.chart-error {
    color: #dc3545;
}

    .chart-error i {
        font-size: 2rem;
    }

.market-note {
    font-size: 0.85rem;
    font-style: italic;
    color: #666;
    margin-top: 0.5rem;
}

.market-section {
    margin-bottom: 1.5rem;
}

/* Additional styles for mobile responsiveness */
/* Message Area Styles */
.message-area {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 4px solid;
    font-size: 0.9rem;
}

    .message-area.warning {
        background-color: #fff3cd;
        border-color: #ffc107;
        color: #856404;
    }

    .message-area.error {
        background-color: #f8d7da;
        border-color: #dc3545;
        color: #721c24;
    }

    .message-area.info {
        background-color: #d1ecf1;
        border-color: #17a2b8;
        color: #0c5460;
    }

/* Slider Bubble Improvements */
.payment-bubble, .power-bubble {
    transition: opacity 0.3s ease, transform 0.2s ease;
    font-weight: 600;
    font-size: 0.85rem;
}

    .payment-bubble:not([style*="opacity: 1"]),
    .power-bubble:not([style*="opacity: 1"]) {
        opacity: 0.4;
        transform: scale(0.9);
    }

/* Loan Amount Breakdown Styling */
.loan-amount-breakdown {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0046E5;
}

.breakdown-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

.breakdown-calculation {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
}

    .breakdown-calculation span {
        font-weight: 700;
    }

#extraBuyingPowerAmount {
    color: #28a745;
}

#totalLoanAmount {
    color: #0046E5;
}

/* Fix Traditional Lender Dropdown Styling */
#amortizationLender {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #495057;
    min-width: 150px;
}

    #amortizationLender:focus {
        border-color: #0046E5;
        box-shadow: 0 0 0 0.2rem rgba(0, 70, 229, 0.25);
        outline: 0;
    }

.control-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

    .control-row label {
        font-weight: 500;
        color: #495057;
        min-width: 60px;
    }

/* Smaller font sizes for savings section */
.savings-label {
    font-size: 0.8rem !important;
    font-weight: 500 !important;
}

.savings-value {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
}

/* Market Rate Modal Improvements */
#marketRateModal .modal-content {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: none;
}

#marketRateModal .modal-header {
    background: linear-gradient(135deg, #0046E5 0%, #0056FF 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    border: none;
    padding: 1.25rem 1.5rem;
}

#marketRateModal .modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

#marketRateModal .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

    #marketRateModal .btn-close:hover {
        opacity: 1;
    }

#marketRateModal .modal-body {
    padding: 2rem 1.5rem;
}

.rate-pills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.rate-pill {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .rate-pill:hover {
        background-color: #e9ecef;
        border-color: #0046E5;
        color: #0046E5;
        transform: translateY(-2px);
    }

    .rate-pill.selected {
        background-color: #0046E5;
        border-color: #0046E5;
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 70, 229, 0.3);
    }

.custom-rate-slider {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

    .custom-rate-slider .form-label {
        font-weight: 600;
        color: #495057;
        margin-bottom: 1rem;
    }

#customRateValue {
    color: #0046E5;
    font-weight: 700;
}

.form-range::-webkit-slider-thumb {
    background-color: #0046E5;
    border: none;
    width: 20px;
    height: 20px;
}

.form-range::-moz-range-thumb {
    background-color: #0046E5;
    border: none;
    width: 20px;
    height: 20px;
}

#marketRateModal .modal-footer {
    border: none;
    padding: 1rem 1.5rem 1.5rem;
}

#marketRateModal .btn {
    border-radius: 6px;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
}

#marketRateModal .btn-primary {
    background-color: #0046E5;
    border-color: #0046E5;
}

    #marketRateModal .btn-primary:hover {
        background-color: #003cb5;
        border-color: #003cb5;
    }

@media (max-width: 768px) {
    .market-stat-row {
        flex-direction: column;
    }

    .market-stat {
        margin-bottom: 1rem;
    }

    .message-area {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    .loan-amount-breakdown {
        margin-top: 0.25rem;
        padding: 0.375rem;
    }

    .breakdown-label {
        font-size: 0.8rem;
    }

    .breakdown-calculation {
        font-size: 0.9rem;
    }

    /* Modal mobile responsiveness */
    .rate-pills-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .rate-pill {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .custom-rate-slider {
        padding: 1rem;
    }
}