/* Override container width for portfolio page */
main.container {
    max-width: 1600px !important;
    padding: 0 2rem !important;
}

/* Ensure body/main don't constrain the layout */
body {
    display: flex !important;
}

main {
    flex: 1 !important;
    width: 100% !important;
}

.portfolio-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 2rem 0;
    transition: opacity 0.3s ease-in-out;
    overflow: hidden;
}

.asset-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    margin-bottom: 0.5rem;
}

.btn-primary {
    background-color: #667eea;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #5568d3;
}

.btn-toggle-settings {
    background-color: #f8f9fa;
    color: #2c3e50;
    padding: 0.75rem 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-toggle-settings:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-toggle-settings:active {
    transform: translateY(0);
    box-shadow: none;
}

#toggleIcon {
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.allocation-summary {
    background: #e8f4f8;
    border: 1px solid #b8d4e0;
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
    text-align: center;
    font-weight: 600;
}

.allocation-summary.valid {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.allocation-summary.invalid {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.metric-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.metric-label {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: bold;
    color: #2c3e50;
}

.metric-value.positive {
    color: #27ae60;
}

.metric-value.negative {
    color: #e74c3c;
}

.chart-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.chart-container h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

/* Portfolio Preview Styles */
.portfolio-preview-header {
    background: var(--surface-secondary);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    border-left: 4px solid var(--primary);
}

.preview-description {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

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

/* Inflation Metrics */
.inflation-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
}

.inflation-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.inflation-metric .metric-label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.inflation-metric .metric-value {
    font-size: 24px;
    font-weight: 700;
}

.inflation-diff {
    font-size: 16px;
    color: var(--error);
}

.inflation-chart {
    margin-top: 24px;
}

.inflation-chart h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

/* Returns Table */
.returns-table {
    width: 100%;
    border-collapse: collapse;
}

.returns-table thead tr {
    border-bottom: 2px solid var(--border);
}

.returns-table th {
    text-align: left;
    padding: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.returns-table th:last-child {
    text-align: right;
}

.returns-table tbody tr {
    border-bottom: 1px solid var(--border);
}

.returns-table td {
    padding: 12px;
    color: var(--text-primary);
}

.returns-table td:last-child {
    text-align: right;
    font-weight: 600;
}

.returns-table td.positive {
    color: var(--success);
}

.returns-table td.negative {
    color: var(--error);
}

@media (max-width: 768px) {
    .inflation-comparison {
        grid-template-columns: 1fr;
    }
}
