/* Modern CSS for 2025 */
:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --surface-color: rgba(255, 255, 255, 0.98);
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --border-radius: 1rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    background: var(--primary-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    padding: 5px;
    display: flex;
    justify-content: center;
}

.page-wrapper {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    transform: scale(0.9);
    transform-origin: top center;
}

.container {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin: 0 2rem 20vh 2rem;
    width: calc(100% - 4rem);
    max-width: none;
}

/* Main Layout */
.main-content {
    display: grid;
    grid-template-columns: 0.35fr 0.65fr;
    gap: 2rem;
    margin-top: 2rem;
    max-width: 100%;
    overflow: hidden;
}

h1 {
    margin-bottom: 0;  /* Remove default margin to control spacing with margin-top on main-content */
}

/* Input and Results Sections */
.input-section,
.results-section {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.input-section {
    min-width: 300px;
    max-width: none;
    width: 100%;
}

.results-section {
    overflow: visible;
    height: auto;
    min-height: 0;
    width: 100%;
    min-width: 400px;
    max-width: none;
}

.input-section h5 {
    margin-top: 0;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
    font-size: 1.25rem;
}

.results-section h5 {
    margin-bottom: 1.5rem;
}

.chart-container {
    width: 100%;
    min-height: 400px;
    margin-bottom: 2rem;
    position: relative;
    aspect-ratio: 16/9;
}

#netWorthChart {
    width: 100% !important;
    height: 100% !important;
    max-height: 500px;
}

/* Net Worth Summary */
.net-worth-summary {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
}

/* Additional Info Section */
.additional-info {
    padding: 1.5rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.additional-info h5 {
    margin-bottom: 1.5rem;
}

/* Tables */
.table-container {
    width: 100%;
    margin-bottom: 1rem;
}

.table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    background: white;
    font-size: 0.9rem;
    table-layout: fixed;
}

.table th,
.table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: right;
    white-space: normal;
    word-wrap: break-word;
}

.table th:first-child,
.table td:first-child {
    text-align: left;
    width: 25%;
}

/* Add color styling for table row labels */
.net-worth-summary .table tr:nth-child(1) {
    background: rgba(52, 152, 219, 0.1);
}

.net-worth-summary .table tr:nth-child(1) td:first-child strong {
    color: rgb(52, 152, 219);
}

.net-worth-summary .table tr:nth-child(2) {
    background: rgba(46, 204, 113, 0.1);
}

.net-worth-summary .table tr:nth-child(2) td:first-child strong {
    color: rgb(46, 204, 113);
}

.net-worth-summary .table tr:nth-child(3) {
    background: rgba(155, 89, 182, 0.1);
}

.net-worth-summary .table tr:nth-child(3) td:first-child strong {
    color: rgb(155, 89, 182);
}

.table th:not(:first-child),
.table td:not(:first-child) {
    width: 25%;
}

.table th {
    background: #f9fafb;
    font-weight: 600;
    color: var(--text-secondary);
}

.table-primary {
    background-color: #f3f4f6 !important;
    border: 1px solid #d1d5db;
}

.table-primary th,
.table-primary td {
    font-weight: 600;
    color: var(--text-primary);
    border-color: #d1d5db;
}

/* Add specific styling for the Net Worth row header */
.table-primary th strong.net-worth-label {
    color: var(--text-primary);
}

/* Remove the additional info table colors */
.additional-info .table tr:nth-child(1) td:first-child strong,
.additional-info .table tr:nth-child(2) td:first-child strong,
.additional-info .table tr:nth-child(3) td:first-child strong {
    color: inherit;
    background: none;
    padding: 0;
    border-radius: 0;
}

/* Form Controls */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Responsive Design */
@media (max-width: 1400px) {
    .main-content {
        gap: 1.5rem;
    }
    
    .input-section {
        min-width: 280px;
    }
    
    .results-section {
        min-width: 380px;
    }
}

@media (max-width: 768px) {
    body {
        padding: var(--spacing-sm);
    }
    
    .container {
        padding: 1rem;
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .input-section,
    .results-section {
        min-width: unset;
        max-width: 100%;
        width: 100%;
        padding: 0.75rem;
    }
    
    .input-section,
    .results-section,
    .additional-info {
        padding: var(--spacing-md);
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.4rem;
    }
    
    .page-wrapper {
        transform: scale(1);
    }

    /* Hide regular table on mobile */
    .table-container .table {
        display: none;
    }

    /* Mobile Cards */
    .mobile-cards {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        padding: 0;
    }

    .result-card {
        width: 100%;
        margin: 0;
        padding: 1rem;
        border-radius: 8px;
        background: white;
        box-shadow: var(--shadow-sm);
    }

    /* Mobile navigation button */
    .mobile-nav-button {
        display: none;
    }

    @media (max-width: 768px) {
        .mobile-cards .mobile-nav-button {
            display: block;
            width: 80%;
            margin: 2rem auto 1rem;
            padding: 0.75rem 1.5rem;
            background: transparent;
            color: #6366f1;
            border: 2px solid #6366f1;
            border-radius: 0.5rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            text-align: center;
            text-decoration: none;
        }

        .mobile-cards .mobile-nav-button:hover {
            background: rgba(99, 102, 241, 0.1);
            transform: translateY(-1px);
        }

        .mobile-cards .mobile-nav-button:active {
            transform: translateY(0);
        }
    }

    .result-card.primary {
        background: #f3f4f6;
        border: 1px solid #d1d5db;
    }

    /* Component cards styling */
    .net-worth-summary .mobile-cards .result-card:nth-child(3) {
        background: rgba(52, 152, 219, 0.1);
        border: 1px solid rgba(52, 152, 219, 0.2);
    }

    .net-worth-summary .mobile-cards .result-card:nth-child(4) {
        background: rgba(46, 204, 113, 0.1);
        border: 1px solid rgba(46, 204, 113, 0.2);
    }

    .net-worth-summary .mobile-cards .result-card:nth-child(5) {
        background: rgba(155, 89, 182, 0.1);
        border: 1px solid rgba(155, 89, 182, 0.2);
    }

    /* Add divider after inflation-adjusted card */
    .net-worth-summary .mobile-cards .result-card:nth-child(2) {
        margin-bottom: 3rem;
        position: relative;
    }

    /* Add component breakdown label with line */
    .net-worth-summary .mobile-cards .result-card:nth-child(2)::after {
        content: 'Component Breakdown';
        position: absolute;
        bottom: -2.5rem;
        left: 50%;
        transform: translateX(-50%);
        color: #9ca3af;
        font-size: 0.85rem;
        font-weight: 500;
        z-index: 1;
        background: transparent;
        padding: 0.5rem 0;
        white-space: nowrap;
    }

    /* Add the actual line */
    .net-worth-summary .mobile-cards .result-card:nth-child(2)::before {
        content: '';
        position: absolute;
        bottom: -2rem;
        left: 0;
        right: 0;
        height: 1px;
        background: #e5e7eb;
        z-index: 0;
    }

    .result-card-header {
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #e5e7eb;
    }

    .result-card-content {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .result-card-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.25rem 0;
    }

    .result-card-label {
        font-size: 0.85rem;
        color: var(--text-secondary);
        flex: 1;
    }

    .result-card-value {
        font-size: 0.95rem;
        font-weight: 500;
        color: var(--text-primary);
        text-align: right;
        white-space: nowrap;
    }

    .result-card.primary .result-card-value {
        color: var(--text-primary);
        font-weight: 600;
    }

    /* Adjust chart container for mobile */
    .chart-container {
        width: 100%;
        margin: 0 0 1rem 0;
        padding: 0;
        min-height: 350px;
        height: 60vh;
        max-height: 450px;
        aspect-ratio: auto;
    }

    #netWorthChart {
        height: 100% !important;
        min-height: 350px;
    }

    canvas {
        height: 100% !important;
        min-height: 350px;
    }

    /* Remove any horizontal scrolling */
    .page-wrapper,
    .container,
    .main-content,
    .results-section,
    .net-worth-summary {
        overflow-x: hidden;
    }
}

/* Keep table visible on desktop */
@media (min-width: 769px) {
    .mobile-cards {
        display: none;
    }
}

/* Loading Spinner */
#loadingSpinner {
    display: none;
    margin: var(--spacing-lg) auto;
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Grid Layout for Form */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

/* Modern Input Labels */
label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

/* Tooltip Styling */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: #1f2937;
    color: white;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

[data-tooltip]:hover:before {
    opacity: 1;
    visibility: visible;
}

/* Add these styles at the end of your CSS file */

.explainer-section {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 2rem;
}

.explainer-section h5 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.explainer-section h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.explainer-content {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.assumptions-list {
    list-style-type: none;
    padding-left: 0;
}

.assumptions-list li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.assumptions-list li strong {
    color: var(--text-primary);
}

.variable-highlight {
    color: #6366f1;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .explainer-section {
        padding: 1rem;
        margin-top: 1.5rem;
    }
    
    .explainer-content {
        font-size: 0.9rem;
    }
} 