/* =====================================================================
   RESULTS POLISH - Investment Board Presentation Quality
   ===================================================================== */

/* Performance Comparison Table Enhancements */
#comparisonBody tr {
    transition: background-color 0.2s ease;
}

#comparisonBody tr:hover {
    background-color: rgba(59, 130, 246, 0.05) !important;
}

/* Metric Labels - Left Column */
#comparisonBody td:first-child {
    font-weight: 600 !important;
    color: var(--color-text) !important;
    font-size: 0.9rem;
    padding: 0.75rem 1rem !important;
}

/* Metric Values - Better Visual Hierarchy */
#comparisonBody td:not(:first-child) {
    font-family: var(--font-body);
    font-variant-numeric: tabular-nums;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: right !important;
    padding: 0.75rem 1rem !important;
}

/* User Portfolio Column - Subtle */
#comparisonBody td:nth-child(2) {
    color: var(--color-text-muted) !important;
}

/* Optimized Portfolio Column - Emphasized */
#comparisonBody td:nth-child(3) {
    color: var(--color-primary) !important;
    font-weight: 600 !important;
}

/* Benchmark Column - Muted */
#comparisonBody td:nth-child(4) {
    color: var(--color-text-dim) !important;
}

/* Positive/Negative Value Color Coding */
#comparisonBody .metric-positive {
    color: var(--color-accent) !important;
}

#comparisonBody .metric-negative {
    color: #ef4444 !important;
}

/* Separator Row for Diversification Section */
#comparisonBody tr.section-separator td {
    background: var(--color-bg-elevated) !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem !important;
    border-top: 2px solid var(--color-border) !important;
    border-bottom: 1px solid var(--color-border) !important;
}

/* Card Header Enhancement for Performance Comparison */
.card-header .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
}

/* Results Card Shadows - Elevated */
#resultsContent .card {
    box-shadow: var(--color-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08));
    transition: box-shadow 0.3s ease;
}

#resultsContent .card:hover {
    box-shadow: var(--color-shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.10));
}

/* Allocation Tables - Investment Board Quality */
#optTable tr, #yourTable tr, #benchTable tr {
    border-bottom: 1px solid var(--color-border, #e0dbd4);
    transition: background-color 0.15s ease;
}

#optTable tr:hover, #yourTable tr:hover, #benchTable tr:hover {
    background-color: rgba(0, 83, 155, 0.04);
}

[data-theme="dark"] #optTable tr,
[data-theme="dark"] #yourTable tr,
[data-theme="dark"] #benchTable tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] #optTable tr:hover,
[data-theme="dark"] #yourTable tr:hover,
[data-theme="dark"] #benchTable tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

#optTable td, #yourTable td, #benchTable td {
    padding: 0.65rem 0.85rem !important;
    font-size: 0.9rem;
    vertical-align: middle;
}

/* Ticker Symbols - Left Column */
#optTable td:first-child,
#yourTable td:first-child,
#benchTable td:first-child {
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Allocation Percentages - Right Column */
#optTable td:last-child,
#yourTable td:last-child,
#benchTable td:last-child {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* Allocation Column Cards - Better Headers */
.card-header.bg-primary h6,
.card-header.bg-secondary h6,
.card-header.bg-success h6 {
    color: #ffffff !important;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

/* Scrollable Allocation Tables */
#optTable, #yourTable, #benchTable {
    max-height: 240px;
    overflow-y: auto;
}

/* Metric Tooltips */
[data-bs-toggle="tooltip"] {
    cursor: help;
    border-bottom: 1px dotted var(--color-text-dim);
}

/* Results Disclaimer Banner Polish */
.alert-secondary {
    border-radius: 8px !important;
    font-size: 0.85rem;
    line-height: 1.5;
}

.alert-secondary strong {
    color: var(--color-primary);
}

/* Loading Spinner Enhancement */
#loadingSpinner .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

/* Chart Container Polish - Investment Board Centering */
#frontierChart, #drawdownChart, #monthlyHeatmap, #corrHeatmap {
    width: 100% !important;
    margin: 0 auto;
}

/* Tab content padding for chart breathing room */
.tab-pane {
    padding: 1rem 0.5rem;
}

/* Remove flex centering that was interfering with Plotly's internal layout */
#chartTabsContent .card-body {
    padding: 1rem;
}

/* =====================================================================
   MOBILE RESPONSIVENESS (Phase 3 TODO)
   ===================================================================== */

/* TODO: Full mobile optimization pending
   - Chart touch interactions
   - Collapsible allocation tables
   - Stacked layout for comparison table
   - Smaller font sizes for small screens
   - Hamburger nav for chart tabs
*/

@media (max-width: 768px) {
    #comparisonBody td:not(:first-child) {
        font-size: 0.85rem;
    }
    
    #comparisonBody td {
        padding: 0.5rem 0.75rem !important;
    }
    
    /* Charts - reduce height on mobile */
    #frontierChart, #drawdownChart {
        height: 300px !important;
    }
    
    /* Tab content - tighter spacing */
    .tab-pane {
        padding: 0.5rem 0.25rem;
    }
}

@media (max-width: 576px) {
    /* Very small screens - extra compact */
    #frontierChart, #drawdownChart {
        height: 250px !important;
    }
    
    .tab-pane {
        padding: 0.25rem 0;
    }
}
