/* Tool-specific styles only - base styles are in tool-layout.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #0a0a0a;
    color: #e5e7eb;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #141414;
    border-bottom: 1px solid #374151;
    z-index: 100;
}

    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

    margin-top: 60px;
    padding: 48px 24px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    max-width: 720px;
    margin: 0 auto;
}

.tool-main {
    flex: 1;
    padding: 32px 24px 120px;
}

.tool-container {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group > label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.input-hint {
    font-size: 13px;
    color: #6b7280;
}

.text-input {
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.text-input:focus {
    border-color: #646cff;
    box-shadow: 0 0 0 2px rgba(100, 108, 255, 0.15);
}

.text-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.text-input::placeholder {
    color: #6b7280;
}

.toggle-group {
    display: flex;
    gap: 0;
    border: 1px solid #374151;
    border-radius: 6px;
    overflow: hidden;
    align-self: flex-start;
}

.toggle-btn {
    background-color: #1a1a1a;
    border: none;
    color: #6b7280;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.toggle-btn:not(:last-child) {
    border-right: 1px solid #374151;
}

.toggle-btn.active {
    background-color: #646cff;
    color: #ffffff;
}

.toggle-btn:hover:not(.active) {
    background-color: #2a2a2a;
}

.term-presets {
    display: flex;
    gap: 8px;
}

.preset-btn {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
}

.preset-btn:hover:not(.active) {
    background-color: #374151;
}

.preset-btn.active {
    background-color: #646cff;
    border-color: #646cff;
    color: #ffffff;
}

.button-group {
    display: flex;
    gap: 12px;
}

.button-primary {
    background-color: #646cff;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
}

.button-secondary {
    background-color: #1a1a1a;
    color: #e5e7eb;
    border: 1px solid #374151;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
}

.modal-hidden {
    display: none;
}

.output-section {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 20px 16px;
    background-color: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    transition: border-color 150ms ease;
}

.stat-card:hover {
    border-color: #374151;
}

.stat-card .stat-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
}

.breakdown-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    background-color: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #d1d5db;
}

.breakdown-list {
    display: flex;
    flex-direction: column;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #1a1a1a;
}

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

.breakdown-label {
    font-size: 14px;
    color: #9ca3af;
}

.breakdown-value {
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
}

.breakdown-total {
    border-top: 1px solid #374151;
    margin-top: 4px;
    padding-top: 14px;
}

.breakdown-total .breakdown-label {
    font-size: 15px;
    font-weight: 600;
    color: #e5e7eb;
}

.breakdown-total .breakdown-value {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background-color: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
}

#pie-chart {
    max-width: 300px;
    max-height: 300px;
}

#balance-chart {
    max-width: 100%;
    width: 100%;
    max-height: 200px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: #e5e7eb;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

.schedule-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.schedule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    max-height: 480px;
    overflow-y: auto;
}

.amortization-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.amortization-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.amortization-table th {
    background-color: #1a1a1a;
    color: #9ca3af;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: right;
    border-bottom: 1px solid #2a2a2a;
}

.amortization-table th:first-child {
    text-align: center;
    width: 60px;
}

.amortization-table td {
    padding: 10px 16px;
    text-align: right;
    color: #e5e7eb;
    border-bottom: 1px solid #1a1a1a;
}

.amortization-table td:first-child {
    text-align: center;
    color: #6b7280;
    font-weight: 500;
}

.amortization-table tbody tr:nth-child(odd) {
    background-color: #0f0f0f;
}

.amortization-table tbody tr:nth-child(even) {
    background-color: #141414;
}

.amortization-table tbody tr:hover {
    background-color: #1a1a1a;
}

.copy-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.copy-confirmation {
    font-size: 14px;
    font-weight: 500;
    color: #10b981;
}

.pro-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-top: 24px;
    border-top: 1px solid #374151;
}

.pro-feature-block {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    background-color: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    position: relative;
}

.pro-feature-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pro-badge {
    color: #0a0a0a;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.input-group-row {
    display: flex;
    gap: 12px;
}

.input-group-row .input-group {
    flex: 1;
    min-width: 0;
}

.comparison-summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comparison-column {
    padding: 16px;
    background-color: #0f0f0f;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
}

.comparison-column h4 {
    font-size: 14px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.comparison-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.comparison-row .comparison-label {
    font-size: 14px;
    color: #6b7280;
}

.comparison-row .comparison-value {
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
}

.savings-highlight {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background-color: #0a2e1a;
    border: 1px solid #059669;
    border-radius: 6px;
}

.savings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.savings-label {
    font-size: 14px;
    color: #6ee7b7;
}

.savings-value {
    font-size: 16px;
    font-weight: 700;
    color: #10b981;
}

.comparison-controls {
    display: flex;
    gap: 12px;
}

.comparison-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background-color: #0f0f0f;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    margin-bottom: 12px;
}

.comparison-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.comparison-card-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: #d1d5db;
}

.comparison-card-remove {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 150ms ease;
}

.comparison-card-remove:hover {
    color: #ef4444;
}

.comparison-card-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comparison-card-inputs .text-input {
    padding: 8px 12px;
    font-size: 14px;
}

.comparison-card-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.comparison-card-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    background-color: #141414;
    border-radius: 4px;
}

.comparison-card-stat .stat-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.comparison-card-stat .stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
}

.comparison-best {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: #0a2e1a;
    border: 1px solid #059669;
    border-radius: 6px;
}

.best-label {
    font-size: 14px;
    font-weight: 500;
    color: #6ee7b7;
}

.best-value {
    font-size: 14px;
    font-weight: 700;
    color: #10b981;
}

.refinance-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.refinance-inputs h4 {
    font-size: 14px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.refinance-inputs h4:first-child {
    margin-top: 0;
}

.arm-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.export-actions {
    display: flex;
    gap: 12px;
}

.pro-cta-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.pro-cta-text {
    font-size: 14px;
    color: #d1d5db;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}

.modal-overlay.modal-hidden {
    display: none;
}

.modal-overlay.modal-visible {
    display: flex;
}

.modal {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 0;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
}

.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 150ms ease;
}

.modal-close:hover {
    color: #e5e7eb;
}

.modal-content {
    padding: 24px;
}

.pro-features-list {
    margin-bottom: 24px;
}

.pro-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.feature-check {
    width: 20px;
    height: 20px;
    background-color: #059669;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.feature-text {
    font-size: 15px;
    color: #e5e7eb;
}

.modal-cta {
    width: 100%;
    display: block;
}

.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 300;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.footer {
    background-color: #0a0a0a;
    border-top: 1px solid #374151;
    padding: 32px 24px;
    text-align: center;
    margin-top: auto;
}

.footer p {
    font-size: 14px;
    color: #6b7280;
}

.error-message {
    background-color: #7f1d1d;
    border: 1px solid #dc2626;
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 8px;
}

.success-message {
    background-color: #064e3b;
    border: 1px solid #059669;
    color: #6ee7b7;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 8px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #374151;
    border-top-color: #646cff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
        padding: 32px 16px;
    }

        font-size: 28px;
        line-height: 36px;
    }

        font-size: 14px;
    }

    .tool-main {
        padding: 24px 16px 100px;
    }

    .tool-container {
        gap: 32px;
    }

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

    .stat-card .stat-value {
        font-size: 18px;
    }

    .button-group {
        flex-direction: column;
    }

    .button-primary,
    .button-secondary {
        width: 100%;
    }

    .pro-feature-block {
        padding: 16px;
    }

    .input-group-row {
        flex-direction: column;
    }

    .export-actions {
        flex-direction: column;
    }

    .comparison-card-results {
        grid-template-columns: 1fr;
    }

    .pro-cta-content {
        flex-direction: column;
        gap: 10px;
    }

        padding: 0 16px;
    }

    .amortization-table th,
    .amortization-table td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .breakdown-container {
        padding: 16px;
    }

    .chart-container {
        padding: 16px;
    }

    .schedule-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .chart-legend {
        flex-direction: column;
        gap: 8px;
    }

    .comparison-card-inputs {
        gap: 6px;
    }

    .term-presets {
        flex-wrap: wrap;
    }
}