#ConfigurePanel {
    margin-top: 60px; /* Leave space for the navigation panel */
    position: fixed; /* Fix the panel at the top of the page */
    top: 0; /* Align it to the top of the viewport */
    width: 100%; /* Span the full width of the viewport */
    z-index: 1000; /* Ensure it stays above other content */
    background-color: #121214 !important; /* Force match theme surface */
    color: #ffffff !important; /* Force white text */
    box-shadow: none; /* Strip shadow for flat look */
    padding: 16px; /* Padding for expanded state */
    height: auto; /* Default height for expanded state */
    overflow: visible; /* Changed from hidden to allow dropdowns to overflow */
    transition: height 0.3s ease, padding 0.3s ease; /* Smooth transitions */
    border-bottom: 1px solid var(--mud-palette-divider); /* Use theme divider */
}

#ConfigurePanel label, 
#ConfigurePanel span, 
#ConfigurePanel div {
    color: #ffffff !important; /* Ensure all labels and text are white */
}

#ConfigurePanel input[type="number"], 
#ConfigurePanel input[type="text"], 
#ConfigurePanel select {
    background-color: #2a2a2e !important;
    color: #ffffff !important;
    border: 1px solid #444 !important;
    border-radius: 4px;
    padding: 2px 4px;
}

    #ConfigurePanel.collapsed {
        height: 0; /* Completely hide the panel */
        padding: 0; /* Remove padding in collapsed state */
        border: none; /* Remove border in collapsed state */
        overflow: hidden; /* Hide content when collapsed */
    }

/* Floating toggle button */
.floating-toggle-button {
    position: fixed; /* Position relative to the viewport */
    top: 25%; /* Position the button 25% from the top of the viewport */
    right: 16px; /* Float on the right side */
    background: #bb86fc; /* Match theme primary purple */
    color: #111; /* Dark text for light purple background */
    border: none; /* No border for a clean look */
    padding: 8px 12px; /* Button size */
    border-radius: 50%; /* Circular button */
    cursor: pointer; /* Show pointer on hover */
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2); /* Add shadow for visibility */
    transition: transform 0.3s ease, background-color 0.3s ease; /* Smooth hover and animation */
    z-index: 1001; /* Ensure it appears above other content */
}

    .floating-toggle-button:hover, .floating-apply-button:hover, .floating-home-button:hover {
        transform: scale(1.1); /* Slight zoom effect */
        background: #a370db; /* Slightly darker purple for hover */
    }

.floating-apply-button {
    position: fixed; /* Position relative to the viewport */
    top: 30%; /* Position the button 25% from the top of the viewport */
    right: 16px; /* Float on the right side */
    background: #007bff; /* Button background color */
    color: white; /* Icon/text color */
    border: none; /* No border for a clean look */
    padding: 8px 12px; /* Button size */
    border-radius: 50%; /* Circular button */
    cursor: pointer; /* Show pointer on hover */
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2); /* Add shadow for visibility */
    transition: transform 0.3s ease, background-color 0.3s ease; /* Smooth hover and animation */
    z-index: 1001; /* Ensure it appears above other content */
}
    .floating-apply-button:hover {
        transform: scale(1.1); /* Slight zoom effect */
        background: #0056b3; /* Darker shade for hover */
    }

.floating-home-button {
    position: fixed; /* Position relative to the viewport */
    top: 35%; /* Position the button 25% from the top of the viewport */
    right: 16px; /* Float on the right side */
    background: #007bff; /* Button background color */
    color: white; /* Icon/text color */
    border: none; /* No border for a clean look */
    padding: 8px 12px; /* Button size */
    border-radius: 50%; /* Circular button */
    cursor: pointer; /* Show pointer on hover */
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2); /* Add shadow for visibility */
    transition: transform 0.3s ease, background-color 0.3s ease; /* Smooth hover and animation */
    z-index: 1001; /* Ensure it appears above other content */
}

    .floating-home-button:hover {
        transform: scale(1.1); /* Slight zoom effect */
        background: #0056b3; /* Darker shade for hover */
    }
/* Main content styling */
#MainContent {
    margin-top: calc(80px + 16px); /* Default margin for expanded ConfigurePanel */
    transition: margin-top 0.3s ease; /* Smooth transition for margin adjustment */
}

#ConfigurePanel.collapsed + #MainContent {
    margin-top: 0; /* MainContent moves up when ConfigurePanel is collapsed */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    #ConfigurePanel {
        padding: 12px; /* Reduce padding for expanded state */
    }

        #ConfigurePanel.collapsed {
            padding: 0; /* Remove padding in collapsed state */
        }

    #MainContent {
        margin-top: calc(72px + 12px); /* Adjust margin for expanded ConfigurePanel */
    }

    #ConfigurePanel.collapsed + #MainContent {
        margin-top: 0; /* MainContent moves up when ConfigurePanel is collapsed */
    }
}

@media (max-width: 480px) {
    #ConfigurePanel {
        padding: 8px; /* Reduce padding further for small screens */
    }

        #ConfigurePanel.collapsed {
            padding: 0; /* Remove padding in collapsed state */
        }

    #MainContent {
        margin-top: calc(80px + 8px); /* Adjust margin for expanded ConfigurePanel */
    }

    #ConfigurePanel.collapsed + #MainContent {
        margin-top: 0; /* MainContent moves up when ConfigurePanel is collapsed */
    }
}

.highlight {
    background-color: #ffeb99; /* Light yellow for high OI change */
    font-weight: bold;
}

.highlightDarkTheme {
    background-color: #55503a; /* Light yellow for high OI change */
    font-weight: bold;
}

:fullscreen canvas,
:fullscreen .js-plotly-plot {
    width: 100% !important;
    height: 100% !important;
}

div[id^="plotly3DChartDiv_"]:fullscreen,
div[id^="echarts3DBarChartDiv_"]:fullscreen,
div[id^="echarts3DChartDiv_"]:fullscreen {
    background-color: #0b0b0e !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

div[id^="plotly3DChartDiv_"]:fullscreen div[id^="plotly3DChart_"],
div[id^="echarts3DBarChartDiv_"]:fullscreen div[id^="echarts3DBarChart_"],
div[id^="echarts3DChartDiv_"]:fullscreen div[id^="echarts3DChart_"] {
    width: 100vw !important;
    height: 100vh !important;
}

/* keeps panels tidy in both light/dark themes */
.three-panel-grid {
    width: 100%;
}

.three-panel__cell {
    min-width: 0;
}
/* prevents overflow when a panel is narrow */
.three-panel__cell canvas {
    display: block;
}

.analysis {
    font: 13px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

    .analysis b {
        font-weight: 600;
    }

    .analysis .pos {
        color: #16a34a;
    }
    /* green */
    .analysis .neg {
        color: #dc2626;
    }
    /* red */
    .analysis .muted {
        color: #6b7280;
    }
    /* gray */
    .analysis .b {
        font-weight: 700;
    }

    .analysis .pill {
        display: inline-block;
        padding: 2px 8px;
        border-radius: 999px;
        font-size: 12px;
        line-height: 1.2;
        margin-right: 6px;
        background: #e5e7eb;
        color: #111827
    }

        .analysis .pill.pos {
            background: #d1fae5;
            color: #065f46
        }

        .analysis .pill.neg {
            background: #fee2e2;
            color: #7f1d1d
        }

.gamma-regime-table {
    border-collapse: collapse;
    width: 100%;
    margin-top: .5rem;
    font-size: .9rem;
}

    .gamma-regime-table th,
    .gamma-regime-table td {
        border: 1px solid #555;
        padding: 4px 6px;
        text-align: left;
    }

    .gamma-regime-table th {
        background: #1f1f1f;
        color: #ddd;
    }

    /* Highlighting */
    .gamma-regime-table tr.pos-active td {
        background: rgba(76, 175, 80, 0.12); /* green tint */
        color: #cdebd1;
        font-weight: 600;
    }

    .gamma-regime-table tr.neg-active td {
        background: rgba(244, 67, 54, 0.12); /* red tint */
        color: #f7c8c5;
        font-weight: 600;
    }

.callout-summary {
    white-space: pre-wrap; /* preserve line breaks */
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.25;
    margin-top: 8px;
    opacity: .95;
}


/* chart wrapper: sized, clips its own content */
.calloutTimelineD {
    position: relative;
    height: /* already set inline via style */; /* keep */
    overflow: hidden;
}

    /* make sure the canvas fills the wrapper and is in flow */
    .calloutTimelineD canvas {
        display: block;
        width: 100% !important;
        height: 100% !important;
    }

/* banner: do NOT absolutely position */
.calloutBannerDiv,
.callout-banner {
    position: static; /* important: not absolute/fixed */
    margin-top: 12px; /* space below the chart */
    z-index: auto; /* no stacking shenanigans */
}

/* if you had floats somewhere */
.calloutBannerDiv {
    clear: both;
}


:root {
    --bg: #0b0b0e; /* Matches MudTheme Background */
    --panel: #121214; /* Matches MudTheme Surface */
    --grid: #2e303a; /* Matches MudTheme Divider */
    --grid-soft: #1a1c22; /* zebra bg */
    --text: #ffffff; /* primary text */
    --muted: #b3b3b3; /* low-contrast text */
}

/* Global strip elevation overlays from MudBlazor surfaces in dark mode */
.mud-theme-dark .mud-paper-elevation-1,
.mud-theme-dark .mud-paper-elevation-2,
.mud-theme-dark .mud-paper-elevation-4,
.mud-theme-dark .mud-paper-elevation-25 {
    background-image: none !important;
}

.controls {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}

    .controls .ml {
        margin-left: .75rem;
    }

.grid-and-chart {
    display: grid;
    grid-template-columns: minmax(480px,1fr) minmax(360px,480px);
    gap: 1rem;
}

/* Panel shell */
.heat-wrap {
    overflow: auto;
    overflow-y: auto;
    scroll-behavior: smooth;
    max-height: 70vh;
    border: 1px solid var(--grid);
    border-radius: 12px;
    background: linear-gradient(180deg,rgba(255,255,255,0.02),rgba(255,255,255,0.00));
    box-shadow: 0 2px 14px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.02);
}

/* Table base */
.heat {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: .7rem;
    color: var(--text);
    background: var(--panel);
}

    .heat th, .heat td {
        padding: .1rem .1rem;
        border-bottom: 1px solid var(--grid);
        border-right: 1px solid var(--grid);
    }

    /* Sticky header + first col */
    .heat th {
        position: sticky;
        top: 0;
        background: #111318;
        color: #dcdde2;
        z-index: 3;
        text-transform: none;
        font-weight: 600;
        letter-spacing: .02em;
    }

        .heat td.strike, .heat th:first-child {
            position: sticky;
            left: 0;
            background: #101216;
            /*z-index: 4;*/
            font-weight: 600;
            color: #d9dbe1;
            border-right: 1px solid var(--grid);
            text-align: center;
        }

    /* Zebra rows for readability (only the data area) */
    .heat tbody tr:nth-child(odd) td {
        background-color: #0f1115; /* will be overridden by inline heat color */
    }

    .heat tbody tr:nth-child(even) td {
        background-color: #0d0f13;
    }

    /* Numbers */
    .heat td {
        white-space: nowrap;
        text-align: center;
    }

    /* Hover highlight */
    .heat tbody tr:hover td {
        outline: 1px solid rgba(255,255,255,.05);
        filter: saturate(1.05) brightness(1.02);
    }

/* Right-side chart container */
.chart-wrap {
    height: 70vh;
    background: var(--panel);
    border: 1px solid var(--grid);
    border-radius: 12px;
    box-shadow: 0 2px 14px rgba(0,0,0,.45);
}

.signal-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
}

    .signal-table th,
    .signal-table td {
        border: 1px solid #ddd;
        padding: 6px 10px;
        text-align: center;
    }

    .signal-table th {
        background-color: #1e1e1e;
        color: #fff;
    }

    .signal-table .above {
        background-color: #1e7e34;
        color: white;
        font-weight: 600;
    }

    .signal-table .below {
        background-color: #7e1e1e;
        color: white;
        font-weight: 600;
    }

.chart-highlight {
    outline: 2px solid #4caf50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.8);
    transition: all 0.3s ease;
}

.clickable-row {
    cursor: pointer;
}

    .clickable-row:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }

.direction-cell.bullish {
    color: #00c853;
    font-weight: 600;
}

.direction-cell.bearish {
    color: #ff5252;
    font-weight: 600;
}

.direction-cell.mixed {
    color: #ffab40;
}

/* Sticky Table Header Adjustments */
/* Support sticking below the fixed App Bar (64px) and optional ConfigurePanel */
.mud-table-sticky-header .mud-table-head .mud-table-cell {
    z-index: 99 !important;
    background-color: var(--panel) !important;
}

/* When ConfigurePanel is expanded, offset further */
/* Note: calc(64px + 80px + 16px) = 160px */
#ConfigurePanel.expanded ~ #MainContent .mud-table-sticky-header .mud-table-head .mud-table-cell,
#ConfigurePanel:not(.collapsed) ~ #MainContent .mud-table-sticky-header .mud-table-head .mud-table-cell {
}

/* Ensure background color is set for sticky headers to prevent transparency */
.mud-theme-dark .mud-table-sticky-header .mud-table-head .mud-table-cell {
    background-color: #121214 !important; /* Update to match new Surface color */
}

.mud-theme-light .mud-table-sticky-header .mud-table-head .mud-table-cell {
    background-color: #ffffff !important;
}

/* Global Floating Action Buttons - Refined Size */
.floating-apply-button,
.floating-home-button {
  position: fixed;
  right: 20px;
  z-index: 1200;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(30, 30, 35, 0.9) !important;
  color: #fff !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
}

.floating-apply-button:hover,
.floating-home-button:hover {
  background: #bb86fc !important;
  color: #000 !important;
  transform: scale(1.1);
}

.floating-apply-button { top: 120px !important; }
.floating-home-button { top: 160px !important; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* COMPARATIVE PIN ANALYSIS STYLING */
.pin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 12px;
    margin-bottom: 20px;
}

.pin-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s ease;
}

.pin-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(187, 134, 252, 0.3);
    transform: translateY(-2px);
}

.pin-item .label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
}

.pin-item .value {
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -1px;
}

/* Coloring for different pin types */
.pin-item:nth-child(1) { border-left: 4px solid #FFB6C1; } /* OI PIN - Pink */
.pin-item:nth-child(2) { border-left: 4px solid #4ade80; } /* VOL PIN - Green */
.pin-item:nth-child(3) { border-left: 4px solid #60a5fa; } /* NOTIONAL PIN - Blue */

/* Lead Detector Styles */
.lead-detector {
    margin-top: 16px;
    border: 1px solid rgba(187, 134, 252, 0.2);
}

.lead-detector h4 {
    color: #BB86FC;
}

.lead-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lead-item {
    padding: 10px 14px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.8rem;
    border-left: 4px solid #666;
}

.lead-item.pos { border-left-color: #10B981; color: #10B981; }
.lead-item.neg { border-left-color: #EF4444; color: #EF4444; }
.lead-item.warn { border-left-color: #F59E0B; color: #F59E0B; }
.lead-item.muted { opacity: 0.5; border-left-color: transparent; }

.lead-detector i.fa-satellite-dish {
    animation: pulsate 2s infinite;
}

@keyframes pulsate {
    0% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0.5; transform: scale(1); }
}


