/* =============================================================================
   EQUITY RESEARCH DASHBOARD - Global Styles (Bloomberg Theme)
   ============================================================================= */

/* --- Remove browser default margin/padding (eliminates white border) --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background-color: #000000;
}

/* --- Smooth transitions on all interactive elements --- */
button, input, .dash-dropdown, a {
    transition: all 0.2s ease-in-out !important;
}

/* --- Button hover/active feedback --- */
button:hover {
    filter: brightness(1.15) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.35) !important;
}

button:active {
    transform: translateY(0px);
    filter: brightness(0.95) !important;
}

/* --- Input focus glow --- */
input:focus {
    outline: none !important;
    border-color: #ff6600 !important;
    box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.25) !important;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #000000;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* --- Card hover effect for stat cards --- */
.stat-card {
    transition: all 0.2s ease-in-out;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 12px 16px;
    background-color: #111;
}

.stat-card:hover {
    border-color: #ff6600;
    background-color: #161616;
}

/* --- Metric card layout --- */
.metric-card {
    background-color: #111;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: center;
    transition: border-color 0.2s ease;
}

.metric-card:hover {
    border-color: #ff6600;
}

/* --- Tab underline animation --- */
.tab--selected {
    transition: border-color 0.2s ease-in-out !important;
}

/* --- Loading spinner color override --- */
._dash-loading {
    color: #ff6600 !important;
}

/* --- Tooltip styling for sliders --- */
.rc-slider-tooltip-inner {
    background-color: #1a1a1a !important;
    border: 1px solid #333 !important;
    font-size: 12px !important;
}

/* --- Helper text styling --- */
.helper-text {
    color: #666;
    font-size: 0.8em;
    margin-top: 2px;
    margin-bottom: 8px;
    font-style: italic;
}

/* --- Section divider styling --- */
.section-divider {
    border: none;
    border-top: 1px solid #222;
    margin: 16px 0;
}

/* --- Badge/pill styling --- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.badge-green {
    background-color: rgba(0, 200, 0, 0.15);
    color: #00c800;
    border: 1px solid rgba(0, 200, 0, 0.3);
}

.badge-red {
    background-color: rgba(255, 51, 0, 0.15);
    color: #ff3300;
    border: 1px solid rgba(255, 51, 0, 0.3);
}

.badge-orange {
    background-color: rgba(255, 102, 0, 0.15);
    color: #ff6600;
    border: 1px solid rgba(255, 102, 0, 0.3);
}

/* =============================================================================
   RESPONSIVE LAYOUT
   ============================================================================= */

/* --- Tablet: 641px–1024px — sidebar narrows, content stays beside it --- */
@media (max-width: 1024px) {
    /* Let sidebar shrink a bit more aggressively */
    .stat-card, .metric-card {
        padding: 8px 12px;
    }
}

/* --- Mobile: ≤640px — single-column stacked layout --- */
@media (max-width: 640px) {
    /* Reduce outer app padding on small screens */
    body > div {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* Tab bar: scrollable horizontally so labels don't wrap or overflow */
    .tab-container, [class*="tabs--container"] {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
    }

    /* Shrink individual tab labels */
    .custom-tab, [class*="tab--"] {
        padding: 10px 8px !important;
        font-size: 0.72em !important;
        white-space: nowrap;
        min-width: 80px !important;
    }

    /* Sidebar + content each become full-width (flex-wrap already handles stacking,
       but we ensure min-width doesn't fight it) */
    [style*="flex: 1 1 350px"], [style*="flex: 3 1 500px"] {
        flex: 1 1 100% !important;
        min-width: 0 !important;
    }

    /* Tighten cards */
    .stat-card, .metric-card {
        padding: 8px 10px;
        font-size: 0.9em;
    }

    /* Reduce heading size */
    h1 {
        font-size: 1.2rem !important;
    }

    h3 {
        font-size: 1rem !important;
    }

    /* Charts: shorter on mobile so they don't dominate the screen */
    .js-plotly-plot {
        max-height: 55vh !important;
    }

    /* DataTable: horizontal scroll on mobile */
    .dash-spreadsheet-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}
