:root {
  --background_color: rgb(255, 255, 255); /*rgba(255, 253, 208);*/
  --navbar-height: 64px;
}

.modebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 16px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(8px);
}

.modebar-title {
    position: absolute;
    left: 16px;
    margin: 0;
    color: white;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.modebar-nav {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.top-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    color: white;
    background: rgba(255, 255, 255, 0.12);
}

.top-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
}

.analysis-layer,
.overlay-layer {
    position: fixed;

    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;

    overflow-y: auto;

    background-color: var(--background_color);

    overscroll-behavior: contain;
}
.page-shell {
    min-height: calc(100vh - var(--navbar-height));
}

/* Lock scrolling when overlay is open */
body.overlay-open, html.overlay-open {
    overflow: hidden !important;
    height: 100%;
}

/* Active navigation button */
.top-nav-btn.active {
    background: #1f5f8b;
    color: white;
}



/* Global page */
/* background: linear-gradient(135deg, #f8f3e1 0%, #FFFFFF 100%) !important; */
html, body {
    margin: 0;
    padding: 0;

    width: 100%;
    height: 100%;

    overflow: hidden;

    background-color: var(--background_color) !important;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    color: #1e293b;
}

/* Main centered container */
.app-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 36px 18px;
    background-color: transparent !important;
}


/* Page title */
.app-main-title {
    color: #0f172a;
    font-weight: 800;
    font-size: 2.4rem;
    margin-bottom: 32px;
    letter-spacing: -0.03em;
}


/* Material cards*/
.custom-card {
    position: relative;

    background: rgba(255, 255, 255, 0.96) !important;

    border: none !important;
    border-radius: 20px !important;

    overflow: hidden;

    backdrop-filter: blur(8px);

    margin-top: 1.5rem;
    margin-bottom: 1.5rem;

    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease;

    box-shadow:
        0 4px 6px rgba(0,0,0,0.05),
        0 10px 20px rgba(0,0,0,0.08),
        0 18px 38px rgba(0,0,0,0.06) !important;
}

/* Hover lift */
.custom-card:hover {
    transform: translateY(-4px);

    box-shadow:
        0 8px 12px rgba(0,0,0,0.08),
        0 18px 28px rgba(0,0,0,0.12),
        0 30px 60px rgba(0,0,0,0.10) !important;
}

/* Shadow for analysis page dbc.Card components */
.card {
    box-shadow:
        0 2px 4px rgba(0,0,0,0.06),
        0 6px 16px rgba(0,0,0,0.09) !important;
    border-radius: 12px !important;
    overflow: hidden;
}

/* Bootstrap primary override — matches tab/header color */
.btn-primary {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
    color: #ffffff !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: #003d8f !important;
    border-color: #003d8f !important;
    color: #ffffff !important;
    box-shadow: none !important;
}


/* Card headers */
.card-header-styled {
    position: relative;

    border: none !important;

    padding: 18px 24px !important;

    font-size: 1.08rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;

    background: rgba(15, 23, 42, 0.92) !important;
    color: #ffffff !important;

    display: flex;
    align-items: center;
    gap: 12px;
}


/* Different header themes */
.header-blue {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}
.header-purple {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
}
.header-green {
    background: linear-gradient(135deg, #059669, #10b981);
}
.header-orange {
    background: linear-gradient(135deg, #ea580c, #fb923c);
}
.header-red {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}


/* Decorative top shine */
.card-header-styled::after {
    content: '';

    position: absolute;

    top: 0;
    left: 0;
    right: 0;

    height: 2px;

    background: rgba(255,255,255,0.35);
}


/* Optional header icons */
.header-icon {
    width: 34px;
    height: 34px;

    border-radius: 10px;

    background: rgba(255,255,255,0.18);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 1rem;

    backdrop-filter: blur(4px);
}


/* Card body */
.card-body-styled {
    padding: 26px !important;
}


/* Labels + inputs */
.small-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #475569 !important;
    margin-bottom: 6px;
}

.custom-search-bar {
    border-radius: 12px !important;

    border: 1px solid #dbe4f0 !important;

    padding: 11px 16px !important;

    font-size: 0.95rem;

    background: #ffffff;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.custom-search-bar:focus {
    background: white;

    border-color: #3b82f6 !important;

    box-shadow:
        0 0 0 4px rgba(59,130,246,0.12) !important;
}


/* Buttons */
.action-btn {
    border-radius: 12px !important;

    padding: 11px 30px !important;

    font-weight: 700 !important;

    border: none !important;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.action-btn:hover {
    transform: translateY(-1px);

    box-shadow:
        0 8px 18px rgba(0,0,0,0.15);
}

.download-btn {
    font-size: 0.9rem !important;
    padding: 9px 16px !important;
}





/* ── Modern Table Container with an Outer Outline ─────────────────────── */
/* ── The Structural Overhaul ─────────────────────────────────────────── */
.custom-table-container {
    border: 1px solid #dcdcdc !important; 
    border-radius: 8px !important;        
    overflow: hidden !important;          
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); 
    display: flex !important;          /* Changed from block to flex to kill all hidden baselines */
    flex-direction: column !important;
    padding: 0 !important;
    margin-top: 0 !important;
}

/* Clear out any deep hidden sub-elements generated by Dash Bootstrap components */
.custom-table-container > div,
.custom-table-container > table {
    margin: 0 !important;
    padding: 0 !important;
}

/* Beautiful Table Resets */
.custom-beautiful-table {
    border-collapse: collapse !important; /* Flatten cell boundaries to destroy any double rows */
    width: 100% !important;
    color: #4a5568 !important;
    background-color: #ffffff !important;
    margin: 0 !important;
}

.custom-beautiful-table thead th {
    background-color: #023b59 !important; 
    color: #f9f9f9 !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 1rem; /* 0.75rem; */
    letter-spacing: 0.05em;
    padding: 10px 14px !important;
    border-bottom: 2px solid #cbd5e0 !important;
}

/* Target every single row and remove double bounding behaviors */
.custom-beautiful-table tbody tr {
    border-bottom: 1px solid #edf2f7 !important;
    background-color: #ffffff;
}

/* ── THE NUCLEAR BLANK-LINE ERASED STRATEGY ────────────────────────── */
/* Completely strip the bottom line from the final actual data row */
.custom-beautiful-table tbody tr:last-of-type,
.custom-beautiful-table tbody tr:last-child {
    border-bottom: none !important;
}

.custom-beautiful-table tbody tr:last-of-type td,
.custom-beautiful-table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Force-remove any ghost pseudo-elements (like ::after or ::before) injected by themes */
.custom-beautiful-table::after,
.custom-beautiful-table::before,
.custom-table-container::after,
.custom-table-container::before {
    content: none !important;
    display: none !important;
    height: 0 !important;
}
/* ─────────────────────────────────────────────────────────────────────── */

/* Zebra Striping */
.custom-beautiful-table.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f7fafc !important;
}

/* Interactive Row Hover Effect */
.custom-beautiful-table tbody tr:hover {
    background-color: #edf2f7 !important;
}



/* ── Consistent Custom Tab Styling ────────────────────────────────────── */
.custom-tabs-container {
    background: transparent;
}

.custom-tabs {
    border-bottom: none !important;
    display: flex !important;
    flex-direction: row !important;
    margin-bottom: 8px !important;
    gap: 4px;
}

.custom-tab {
    background-color: #ffffff !important;
    border: 2px solid #0056b3 !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #0056b3 !important;
    padding: 5px 10px !important;
    font-weight: 500;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1 1 auto !important;
    text-align: center !important;
    margin-bottom: 0 !important;
    line-height: 1.2 !important;
}

.custom-tab:hover {
    background-color: #e8f0fe !important;
    color: #003d8f !important;
}

.custom-tab--selected {
    background-color: #0056b3 !important;
    color: #ffffff !important;
    border: 2px solid #0056b3 !important;
    font-weight: 600 !important;
}

.custom-control-panel {
    background-color: #f8fafc !important; /* Soft, professional cool-gray tint */
    border: 1px solid #e2e8f0 !important;   /* Clean, non-distracting border line */
    border-radius: 8px !important;         /* Matches modern UI layout flows */
    padding: 16px !important;              /* Generous inner breathing room */
    margin-bottom: 24px !important;         /* Explicit boundary spacing before the plot begins */
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02); /* Subtle inner depth */
}


/* Plotly modebar */

/* Decent bar */
.js-plotly-plot .plotly .modebar,
.js-plotly-plot .plotly .modebar-container {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    left: auto !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    background: transparent !important;
    box-shadow: none !important;
    z-index: 10 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

.js-plotly-plot:hover .plotly .modebar,
.js-plotly-plot:hover .plotly .modebar-container {
    opacity: 1;
    pointer-events: auto;
}

.js-plotly-plot .plotly .modebar-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.js-plotly-plot .plotly .modebar-group {
    display: flex !important;
    width: auto !important;
    margin: 0 2px !important;
    padding: 2px 4px !important;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.85) !important;
    backdrop-filter: blur(4px);
}

.js-plotly-plot .plotly .modebar-btn path {
    fill: #ffffff !important;
}

.js-plotly-plot .plotly .modebar-btn:hover path {
    fill: #60a5fa !important;
}







.highlight-target {
    animation: highlight-flash 2s ease;
}

@keyframes highlight-flash {
    0%   { background-color: #fff3cd; }
    30%  { background-color: #ffe69c; }
    100% { background-color: transparent; }
}




/* Container for the subsection toggle button */
.section-toggle-btn {
    background-color: transparent !important;
    border: none !important;
    border-left: 4px solid #0d6efd !important; /* Professional blue accent accent line */
    padding: 0.5rem 0.75rem !important;
    font-weight: 600;
    color: #212529 !important;
    transition: background-color 0.2s ease, color 0.2s ease;
    box-shadow: none !important;
}

/* Hover effects for improved interactivity feedback */
.section-toggle-btn:hover {
    background-color: #f8f9fa !important;
    color: #0d6efd !important;
    box-shadow: none !important;
}

/* Remove Bootstrap's persistent dark-blue focus/active state after click */
.section-toggle-btn:focus,
.section-toggle-btn:active,
.section-toggle-btn:focus-visible,
.section-toggle-btn:focus:not(:focus-visible) {
    background-color: transparent !important;
    color: #212529 !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Clean styling for the inner dynamic content container */
.section-collapse-content {
    padding: 1rem 1.25rem;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    font-size: 1.0rem !important; /* Standard base body text size (e.g., 16px) */
    color: #282c2f !important; /*#495057 !important; */   /* Highly legible charcoal color */
    line-height: 1.6;             /* Enhances readability for long text descriptions */
}

/* Base style for the indicator arrow */
.chevron-arrow {
    display: inline-block;
    transition: transform 0.2s ease-in-out;
}

/* Custom modifier class to smoothly rotate the icon down when opened */
.chevron-arrow.rotated {
    transform: rotate(90deg);
}