/* Divergence Scanner – professional dark theme (Markets & Crypto) */

body.rsi-dark-page {
    background: #0b0f14 !important;
    color: #e2e8f0 !important;
    padding-top: 70px !important;
}

body.rsi-dark-page .page-wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 22px 16px 40px;
}

body.rsi-dark-page .panel {
    background: #141b26 !important;
    border: 1px solid #2a3544 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35) !important;
}

body.rsi-dark-page .page-title {
    color: #f8fafc !important;
}

body.rsi-dark-page .page-subtitle,
body.rsi-dark-page .meta-muted,
body.rsi-dark-page .empty-cell {
    color: #94a3b8 !important;
}

body.rsi-dark-page #resultInfo {
    color: #f8fafc !important;
}

body.rsi-dark-page .form-label {
    color: #94a3b8 !important;
    font-size: 0.82rem;
    font-weight: 600;
}

body.rsi-dark-page .form-control,
body.rsi-dark-page .form-select {
    background: #0c1219 !important;
    border: 1px solid #2a3544 !important;
    color: #e2e8f0 !important;
}

body.rsi-dark-page .form-control:focus,
body.rsi-dark-page .form-select:focus {
    background: #0c1219 !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
    color: #f8fafc !important;
}

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

body.rsi-dark-page .btn-primary {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
}

body.rsi-dark-page .btn-primary:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
}

body.rsi-dark-page .btn-outline-secondary {
    color: #94a3b8 !important;
    border-color: #2a3544 !important;
    background: transparent !important;
}

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

body.rsi-dark-page .hint-box {
    background: rgba(59, 130, 246, 0.08) !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
    color: #94a3b8 !important;
}

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

body.rsi-dark-page table th {
    background: #1a2332 !important;
    color: #94a3b8 !important;
    border-bottom-color: #2a3544 !important;
}

body.rsi-dark-page table td {
    color: #e2e8f0 !important;
    border-bottom-color: #1e293b !important;
}

body.rsi-dark-page table tr:hover td {
    background: rgba(59, 130, 246, 0.04) !important;
}

body.rsi-dark-page .sig-long {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
}

body.rsi-dark-page .sig-short {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
}

body.rsi-dark-page .sig-neutral {
    background: rgba(100, 116, 139, 0.2) !important;
    color: #94a3b8 !important;
}

body.rsi-dark-page .div-bull {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
}

body.rsi-dark-page .div-bear {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
}

body.rsi-dark-page .div-none {
    background: rgba(100, 116, 139, 0.2) !important;
    color: #94a3b8 !important;
}

body.rsi-dark-page .footer-simple {
    background: #0c1219 !important;
    border-top: 1px solid #2a3544 !important;
    color: #64748b !important;
}

body.rsi-dark-page table a {
    color: #60a5fa !important;
}

body.rsi-dark-page table a:hover {
    color: #93c5fd !important;
}

@media (max-width: 640px) {
    body.rsi-dark-page .page-wrap {
        padding: 14px 10px 28px;
    }
}

/* Horizontal scroll + sticky symbol column */
body.rsi-dark-page.divergence-scanner-page .divergence-scanner-table-scroll {
    max-height: min(62vh, calc(100vh - 300px));
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: #0c1219 !important;
    border: 1px solid #2a3544 !important;
    border-radius: 10px;
    position: relative;
}

body.rsi-dark-page.divergence-scanner-page .divergence-scanner-table-scroll::after {
    content: "← scroll for all columns →";
    display: block;
    text-align: center;
    font-size: 10px;
    color: #64748b;
    padding: 6px 0 4px;
    letter-spacing: 0.02em;
    background: #0c1219;
    position: sticky;
    left: 0;
    bottom: 0;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable {
    width: max-content !important;
    min-width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: #0c1219 !important;
    margin: 0 !important;
    table-layout: auto !important;
    color: #e2e8f0 !important;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable th,
body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable td {
    display: table-cell !important;
    white-space: nowrap;
    padding: 9px 10px !important;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 4 !important;
    background: #1a2332 !important;
    color: #94a3b8 !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    border-bottom: 1px solid #2a3544 !important;
    box-shadow: 0 1px 0 #2a3544 !important;
    vertical-align: middle !important;
    text-align: center !important;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable th:first-child,
body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable 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;
    text-align: left !important;
    padding-left: 16px !important;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable thead th:first-child {
    z-index: 8 !important;
    background-color: #1a2332 !important;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable td:first-child {
    background-color: #0c1219 !important;
    color: #93c5fd !important;
    font-weight: 700 !important;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable tbody tr:nth-child(even) td:not(:first-child) {
    background: rgba(26, 35, 50, 0.35) !important;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable tbody tr:hover td:not(:first-child) {
    background: rgba(59, 130, 246, 0.06) !important;
}

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

html[dir="rtl"] body.rsi-dark-page.divergence-scanner-page .divergence-scanner-table-scroll,
html[dir="rtl"] body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable {
    direction: rtl;
}

html[dir="rtl"] body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable th:first-child,
html[dir="rtl"] body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable td:first-child {
    left: auto !important;
    right: 0 !important;
    box-shadow: -4px 0 14px rgba(0, 0, 0, 0.45) !important;
    border-right: none !important;
    border-left: 1px solid #2a3544 !important;
    text-align: right !important;
    padding-right: 16px !important;
    padding-left: 10px !important;
}

@media (max-width: 768px) {
    body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable th:first-child,
    body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable td:first-child {
        min-width: 88px;
    }
}
