/* Market Screener – professional dark theme */

body.rsi-dark-page.screener-page {
    background: #0b0f14 !important;
    color: #e2e8f0 !important;
}

body.rsi-dark-page.screener-page .container-fluid {
    background: transparent !important;
}

body.rsi-dark-page.screener-page .hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #312e81 100%) !important;
    border: 1px solid rgba(59, 130, 246, 0.25);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35) !important;
}

body.rsi-dark-page.screener-page .hero h1 {
    color: #f8fafc !important;
}

body.rsi-dark-page.screener-page .hero p {
    color: #cbd5e1 !important;
    opacity: 1 !important;
}

/* Toolbar & search */
body.rsi-dark-page.screener-page .screener-toolbar {
    background: #141b26 !important;
    border-color: #2a3544 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28) !important;
}

body.rsi-dark-page.screener-page .timeframe-btn {
    background: #1a2332 !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

body.rsi-dark-page.screener-page .timeframe-btn:hover {
    background: #243044 !important;
    color: #e2e8f0 !important;
}

body.rsi-dark-page.screener-page .timeframe-btn.active[data-timeframe="15m"] {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #fff !important;
}

body.rsi-dark-page.screener-page .timeframe-btn.active[data-timeframe="1h"] {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
}

body.rsi-dark-page.screener-page .timeframe-btn.active[data-timeframe="4h"] {
    background: #ea580c !important;
    border-color: #ea580c !important;
    color: #fff !important;
}

body.rsi-dark-page.screener-page .timeframe-btn.active[data-timeframe="1d"] {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #fff !important;
}

body.rsi-dark-page.screener-page #darkSymbolSearch {
    background: #0c1219 !important;
    border-color: #2a3544 !important;
    color: #e2e8f0 !important;
}

body.rsi-dark-page.screener-page #darkSymbolSearch::placeholder {
    color: #64748b !important;
}

body.rsi-dark-page.screener-page #darkSymbolSearch:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

body.rsi-dark-page.screener-page .dark-search-icon {
    color: #64748b !important;
}

body.rsi-dark-page.screener-page #darkClearSearch {
    background: #1a2332 !important;
    color: #94a3b8 !important;
}

body.rsi-dark-page.screener-page .search-status,
body.rsi-dark-page.screener-page #searchStatus {
    background: #141b26 !important;
    border-color: #2a3544 !important;
    color: #94a3b8 !important;
}

body.rsi-dark-page.screener-page .update-status {
    color: #94a3b8 !important;
    background: rgba(148, 163, 184, 0.1) !important;
}

body.rsi-dark-page.screener-page .update-status.updating {
    color: #fff !important;
    background: #2563eb !important;
}

body.rsi-dark-page.screener-page .loading-message {
    color: #60a5fa !important;
}

/* Filter panel */
body.rsi-dark-page.screener-page .filter-container {
    background: #141b26 !important;
    border-color: #2a3544 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28) !important;
}

body.rsi-dark-page.screener-page .filter-header {
    border-bottom-color: #2a3544 !important;
}

body.rsi-dark-page.screener-page .filter-title {
    color: #f1f5f9 !important;
}

body.rsi-dark-page.screener-page .filter-title svg {
    color: #60a5fa !important;
}

body.rsi-dark-page.screener-page .filter-reset-btn {
    background: rgba(220, 38, 38, 0.15) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(220, 38, 38, 0.35) !important;
}

body.rsi-dark-page.screener-page .filter-section {
    background: #0c1219 !important;
    border-color: #2a3544 !important;
}

body.rsi-dark-page.screener-page .filter-section-title,
body.rsi-dark-page.screener-page .filter-label,
body.rsi-dark-page.screener-page .composite-label,
body.rsi-dark-page.screener-page .sort-label,
body.rsi-dark-page.screener-page .stat-label {
    color: #64748b !important;
}

body.rsi-dark-page.screener-page .filter-btn-group {
    background: #0c1219 !important;
    border-color: #2a3544 !important;
}

body.rsi-dark-page.screener-page .filter-btn {
    color: #94a3b8 !important;
}

body.rsi-dark-page.screener-page .filter-btn:hover {
    background: #1a2332 !important;
    color: #e2e8f0 !important;
}

body.rsi-dark-page.screener-page .filter-btn.active-long {
    background: rgba(34, 197, 94, 0.22) !important;
    color: #6ee7b7 !important;
}

body.rsi-dark-page.screener-page .filter-btn.active-short {
    background: rgba(239, 68, 68, 0.22) !important;
    color: #fca5a5 !important;
}

body.rsi-dark-page.screener-page .filter-btn.active-neutral {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
}

body.rsi-dark-page.screener-page .filter-select {
    background: #0c1219 !important;
    border-color: #2a3544 !important;
    color: #e2e8f0 !important;
}

body.rsi-dark-page.screener-page .sort-group {
    border-left-color: #2a3544 !important;
}

body.rsi-dark-page.screener-page .filter-stats {
    border-top-color: #2a3544 !important;
}

body.rsi-dark-page.screener-page .stat-visible .stat-value {
    color: #4ade80 !important;
}

body.rsi-dark-page.screener-page .stat-filtered .stat-value {
    color: #f87171 !important;
}

/* ── Table (critical fixes) ── */
body.rsi-dark-page.screener-page .screener-table-wrap {
    background: #0c1219 !important;
    border-color: #2a3544 !important;
}

body.rsi-dark-page.screener-page #indicatorTable {
    width: max-content !important;
    min-width: 100% !important;
    margin: 0 !important;
    background: #0c1219 !important;
    color: #e2e8f0 !important;
    table-layout: auto !important;
}

body.rsi-dark-page.screener-page #indicatorTable thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 4 !important;
    box-shadow: 0 1px 0 #2a3544 !important;
}

body.rsi-dark-page.screener-page #indicatorTable th:first-child,
body.rsi-dark-page.screener-page #indicatorTable td:first-child,
body.rsi-dark-page.screener-page #resultsTable th:first-child,
body.rsi-dark-page.screener-page #resultsTable td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 3 !important;
    box-shadow: 4px 0 14px rgba(0, 0, 0, 0.45) !important;
    border-right: 1px solid #2a3544 !important;
    isolation: isolate;
}

body.rsi-dark-page.screener-page #indicatorTable thead th:first-child,
body.rsi-dark-page.screener-page #resultsTable thead th:first-child {
    z-index: 8 !important;
    top: 0 !important;
    left: 0 !important;
    background-color: #1a2332 !important;
}

body.rsi-dark-page.screener-page #indicatorTable td:first-child::before,
body.rsi-dark-page.screener-page #resultsTable td:first-child::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: #0c1219;
    z-index: -1;
    pointer-events: none;
}

body.rsi-dark-page.screener-page #indicatorTable tbody tr:nth-child(even) td:first-child::before,
body.rsi-dark-page.screener-page #resultsTable tbody tr:nth-child(even) td:first-child::before {
    background-color: #0f172a;
}

body.rsi-dark-page.screener-page #indicatorTable tbody tr:hover td:first-child::before,
body.rsi-dark-page.screener-page #resultsTable tbody tr:hover td:first-child::before {
    background-color: #131c2e;
}

body.rsi-dark-page.screener-page .screener-table-wrap {
    max-height: min(62vh, calc(100vh - 300px)) !important;
    overflow: auto !important;
    overscroll-behavior: contain;
}

body.rsi-dark-page.screener-page .screener-table-wrap::after {
    color: #64748b !important;
    background: #0c1219 !important;
}

@media (min-width: 1024px) {
    body.rsi-dark-page.screener-page #indicatorTable {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed !important;
        font-size: 10px !important;
    }

    body.rsi-dark-page.screener-page #indicatorTable th,
    body.rsi-dark-page.screener-page #indicatorTable td {
        min-width: 0 !important;
    }

    body.rsi-dark-page.screener-page #indicatorTable td.badge-cell {
        min-width: 0 !important;
        font-size: 8px !important;
    }

    body.rsi-dark-page.screener-page .screener-table-wrap::after {
        display: none !important;
    }
}

body.rsi-dark-page.screener-page #indicatorTable thead th,
body.rsi-dark-page.screener-page #indicatorTable tfoot th {
    background: #1a2332 !important;
    color: #94a3b8 !important;
    border-color: #2a3544 !important;
}

body.rsi-dark-page.screener-page #indicatorTable td:not(:first-child) {
    background-color: transparent !important;
    color: #e2e8f0 !important;
    border-color: #1e293b !important;
}

body.rsi-dark-page.screener-page #indicatorTable td:first-child {
    background-color: #0c1219 !important;
    color: #93c5fd !important;
    border-color: #1e293b !important;
}

body.rsi-dark-page.screener-page #indicatorTable tbody tr {
    background: transparent !important;
}

body.rsi-dark-page.screener-page #indicatorTable tbody tr:nth-child(even) td:not(:first-child) {
    background-color: rgba(15, 23, 42, 0.55) !important;
}

body.rsi-dark-page.screener-page #indicatorTable tbody tr:nth-child(even) td:first-child {
    background-color: #0f172a !important;
}

body.rsi-dark-page.screener-page #indicatorTable tbody tr:hover td:not(:first-child) {
    background-color: rgba(59, 130, 246, 0.08) !important;
}

body.rsi-dark-page.screener-page #indicatorTable tbody tr:hover td:first-child {
    background-color: #131c2e !important;
}

body.rsi-dark-page.screener-page #indicatorTable td.symbol-link-cell,
body.rsi-dark-page.screener-page #indicatorTable td:first-child {
    color: #93c5fd !important;
    font-weight: 600 !important;
    cursor: pointer;
}

body.rsi-dark-page.screener-page #indicatorTable td:first-child a,
body.rsi-dark-page.screener-page #indicatorTable td.symbol-link-cell a {
    color: #93c5fd !important;
    text-decoration: none !important;
}

body.rsi-dark-page.screener-page #indicatorTable td:first-child a:hover,
body.rsi-dark-page.screener-page #indicatorTable td.symbol-link-cell a:hover {
    color: #bfdbfe !important;
    text-decoration: underline !important;
}

/* Signal / value cells */
body.rsi-dark-page.screener-page #indicatorTable td.bg-green,
body.rsi-dark-page.screener-page #indicatorTable td.bg-red,
body.rsi-dark-page.screener-page #indicatorTable td.bg-yellow,
body.rsi-dark-page.screener-page #indicatorTable td.bg-gray,
body.rsi-dark-page.screener-page #indicatorTable .signal-pill.bg-green,
body.rsi-dark-page.screener-page #indicatorTable .signal-pill.bg-red {
    display: inline-block !important;
}

body.rsi-dark-page.screener-page #indicatorTable td.badge-cell {
    color: #e2e8f0 !important;
    vertical-align: top;
}

body.rsi-dark-page.screener-page #indicatorTable .signal-pill.bg-green {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #6ee7b7 !important;
}

body.rsi-dark-page.screener-page #indicatorTable .signal-pill.bg-red {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
}

body.rsi-dark-page.screener-page #indicatorTable td.cell-tone-bull {
    background: rgba(34, 197, 94, 0.16) !important;
    color: #6ee7b7 !important;
}

body.rsi-dark-page.screener-page #indicatorTable td.cell-tone-bear {
    background: rgba(239, 68, 68, 0.16) !important;
    color: #fca5a5 !important;
}

body.rsi-dark-page.screener-page #indicatorTable td.bg-green,
body.rsi-dark-page.screener-page #indicatorTable .bg-green {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #6ee7b7 !important;
}

body.rsi-dark-page.screener-page #indicatorTable td.bg-red,
body.rsi-dark-page.screener-page #indicatorTable .bg-red {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
}

body.rsi-dark-page.screener-page #indicatorTable td.bg-yellow,
body.rsi-dark-page.screener-page #indicatorTable .bg-yellow {
    background: rgba(245, 158, 11, 0.18) !important;
    color: #fbbf24 !important;
}

body.rsi-dark-page.screener-page #indicatorTable td.bg-gray,
body.rsi-dark-page.screener-page #indicatorTable .bg-gray {
    background: rgba(100, 116, 139, 0.22) !important;
    color: #cbd5e1 !important;
}

body.rsi-dark-page.screener-page #indicatorTable tfoot {
    position: sticky;
    bottom: 0;
    z-index: 4;
}

/* Pagination */
body.rsi-dark-page.screener-page .pagination-container {
    background: #141b26 !important;
    border-color: #2a3544 !important;
}

body.rsi-dark-page.screener-page .pagination-btn {
    background: #0c1219 !important;
    border-color: #2a3544 !important;
    color: #94a3b8 !important;
}

body.rsi-dark-page.screener-page .pagination-btn:hover:not(:disabled) {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
}

body.rsi-dark-page.screener-page .pagination-btn-active,
body.rsi-dark-page.screener-page .pagination-btn:disabled {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
}

@media (max-width: 768px) {
    body.rsi-dark-page.screener-page .screener-table-wrap {
        max-height: min(70vh, calc(100dvh - 260px)) !important;
    }

    body.rsi-dark-page.screener-page .screener-table-wrap::after {
        color: #64748b !important;
    }

    body.rsi-dark-page.screener-page #indicatorTable th:first-child,
    body.rsi-dark-page.screener-page #indicatorTable td:first-child {
        background-color: #0c1219 !important;
        background-image: none !important;
        opacity: 1 !important;
        min-width: 108px !important;
        width: 108px !important;
        max-width: 108px !important;
    }

    body.rsi-dark-page.screener-page #indicatorTable tbody tr:nth-child(even) td:first-child {
        background-color: #0f172a !important;
    }

    body.rsi-dark-page.screener-page #indicatorTable tbody tr:hover td:first-child {
        background-color: #131c2e !important;
    }
}

/* RTL locales: LTR table scroll (same pattern as RSI signal tables) */
html[dir="rtl"] body.rsi-dark-page.screener-page .screener-table-wrap,
html[dir="rtl"] body.rsi-dark-page.screener-page #indicatorTable {
    direction: ltr;
    unicode-bidi: isolate;
}

html[dir="rtl"] body.rsi-dark-page.screener-page #indicatorTable th:first-child,
html[dir="rtl"] body.rsi-dark-page.screener-page #indicatorTable td:first-child {
    text-align: left !important;
}
