/* TradeAnalyzer.Pro — Divergence Scanner (Crypto + Markets), extends rsi-pro-page.css */

body.rsi-dark-page.divergence-scanner-page {
    --rsi-bg: #070b14;
    --rsi-panel: #0d1524;
    --rsi-card: #111a2b;
    --rsi-line: rgba(148, 163, 184, 0.18);
    --rsi-text: #e8eef7;
    --rsi-muted: #94a3b8;
    --rsi-cyan: #38bdf8;
    --rsi-blue: #0ea5e9;
    --rsi-gold: #eab308;
    --rsi-green: #34d399;
    --rsi-red: #f87171;
    --rsi-radius: 16px;
    --rsi-display: "Sora", system-ui, sans-serif;
    --rsi-body: "IBM Plex Sans", system-ui, sans-serif;
    overflow-x: hidden !important;
    font-family: var(--rsi-body) !important;
    color: var(--rsi-text) !important;
    background:
        radial-gradient(1200px 600px at 12% -10%, rgba(14, 165, 233, 0.15), transparent 55%),
        radial-gradient(900px 500px at 90% 8%, rgba(234, 179, 8, 0.07), transparent 50%),
        var(--rsi-bg) !important;
}

body.rsi-dark-page.divergence-scanner-page .page-wrap {
    width: min(1180px, calc(100% - 2rem)) !important;
    max-width: 1180px !important;
    margin: 0 auto !important;
    padding: 1.5rem 0 3.5rem !important;
}

body.rsi-dark-page.divergence-scanner-page .panel {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.1rem !important;
    padding: 1.15rem 1.2rem !important;
    border: 1px solid var(--rsi-line) !important;
    border-radius: 20px !important;
    background:
        radial-gradient(640px 220px at 0% 0%, rgba(14, 165, 233, 0.1), transparent 55%),
        rgba(13, 21, 36, 0.92) !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.26) !important;
}

body.rsi-dark-page.divergence-scanner-page .panel::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--rsi-cyan), var(--rsi-gold), transparent);
    pointer-events: none;
}

body.rsi-dark-page.divergence-scanner-page .page-title,
body.rsi-dark-page.divergence-scanner-page .panel > h1 {
    font-family: var(--rsi-display) !important;
    font-size: 1.55rem !important;
    font-weight: 700 !important;
    color: var(--rsi-text) !important;
    letter-spacing: -0.02em;
    margin: 0 0 0.35rem !important;
}

body.rsi-dark-page.divergence-scanner-page .page-title i,
body.rsi-dark-page.divergence-scanner-page .panel > h1 i {
    color: var(--rsi-cyan) !important;
    margin-inline-end: 0.4rem;
}

body.rsi-dark-page.divergence-scanner-page .page-subtitle,
body.rsi-dark-page.divergence-scanner-page .meta-muted,
body.rsi-dark-page.divergence-scanner-page .empty-cell {
    color: var(--rsi-muted) !important;
    font-family: var(--rsi-body) !important;
}

body.rsi-dark-page.divergence-scanner-page .page-subtitle {
    max-width: 78ch;
    margin: 0 0 1rem !important;
    line-height: 1.55;
}

body.rsi-dark-page.divergence-scanner-page #resultInfo {
    color: var(--rsi-text) !important;
    font-family: var(--rsi-display) !important;
    font-weight: 700 !important;
}

body.rsi-dark-page.divergence-scanner-page .results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem !important;
}

body.rsi-dark-page.divergence-scanner-page .controls {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: end;
}

body.rsi-dark-page.divergence-scanner-page .page-wrap .form-label {
    color: var(--rsi-muted) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

body.rsi-dark-page.divergence-scanner-page .page-wrap .form-control,
body.rsi-dark-page.divergence-scanner-page .page-wrap .form-select {
    background: rgba(17, 26, 43, 0.95) !important;
    border: 1px solid var(--rsi-line) !important;
    color: var(--rsi-text) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    font-family: var(--rsi-body) !important;
    min-height: 40px;
}

body.rsi-dark-page.divergence-scanner-page .page-wrap .form-control:focus,
body.rsi-dark-page.divergence-scanner-page .page-wrap .form-select:focus {
    border-color: rgba(56, 189, 248, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14) !important;
    outline: none !important;
    color: var(--rsi-text) !important;
}

body.rsi-dark-page.divergence-scanner-page .page-wrap .form-control::placeholder {
    color: rgba(148, 163, 184, 0.75) !important;
}

body.rsi-dark-page.divergence-scanner-page .btn-primary,
body.rsi-dark-page.divergence-scanner-page #scanBtn {
    border-radius: 999px !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    background: rgba(14, 165, 233, 0.18) !important;
    color: #7dd3fc !important;
    font-weight: 700 !important;
    box-shadow: none !important;
    min-height: 40px;
}

body.rsi-dark-page.divergence-scanner-page .btn-primary:hover,
body.rsi-dark-page.divergence-scanner-page #scanBtn:hover {
    background: rgba(14, 165, 233, 0.28) !important;
    border-color: rgba(56, 189, 248, 0.65) !important;
    color: #bae6fd !important;
}

body.rsi-dark-page.divergence-scanner-page .btn-outline-secondary,
body.rsi-dark-page.divergence-scanner-page #resetBtn {
    border-radius: 999px !important;
    border: 1px solid var(--rsi-line) !important;
    background: rgba(17, 26, 43, 0.9) !important;
    color: #cbd5e1 !important;
    font-weight: 700 !important;
    box-shadow: none !important;
    min-height: 40px;
}

body.rsi-dark-page.divergence-scanner-page .btn-outline-secondary:hover,
body.rsi-dark-page.divergence-scanner-page #resetBtn:hover {
    border-color: rgba(56, 189, 248, 0.38) !important;
    background: rgba(56, 189, 248, 0.08) !important;
    color: var(--rsi-text) !important;
}

body.rsi-dark-page.divergence-scanner-page .hint-box {
    background: rgba(56, 189, 248, 0.08) !important;
    border: 1px solid rgba(56, 189, 248, 0.22) !important;
    color: var(--rsi-muted) !important;
    border-radius: 12px !important;
    padding: 0.75rem 0.9rem !important;
    margin-bottom: 0.85rem !important;
    font-size: 0.86rem !important;
}

/* Table scroll */
body.rsi-dark-page.divergence-scanner-page .table-wrap,
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: rgba(13, 21, 36, 0.96) !important;
    border: 1px solid var(--rsi-line) !important;
    border-radius: 14px !important;
    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: 0.68rem;
    color: var(--rsi-muted);
    padding: 0.4rem 0 0.35rem;
    letter-spacing: 0.02em;
    background: rgba(13, 21, 36, 0.96);
    position: sticky;
    left: 0;
    bottom: 0;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable,
body.rsi-dark-page.divergence-scanner-page .divergence-scanner-table,
body.rsi-dark-page.divergence-scanner-page .table-wrap table {
    width: max-content !important;
    min-width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: transparent !important;
    margin: 0 !important;
    color: var(--rsi-text) !important;
    --bs-table-bg: transparent !important;
    --bs-table-color: var(--rsi-text) !important;
    --bs-table-striped-bg: transparent !important;
    --bs-table-hover-bg: transparent !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-bg-type: transparent !important;
    --bs-table-bg-state: transparent !important;
    --bs-body-bg: #0d1524 !important;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable th,
body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable td,
body.rsi-dark-page.divergence-scanner-page .table-wrap th,
body.rsi-dark-page.divergence-scanner-page .table-wrap td {
    display: table-cell !important;
    white-space: nowrap;
    padding: 0.7rem 0.65rem !important;
    border-color: rgba(148, 163, 184, 0.12) !important;
    box-shadow: none !important;
    vertical-align: middle !important;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable thead,
body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable thead tr,
body.rsi-dark-page.divergence-scanner-page .table-wrap thead,
body.rsi-dark-page.divergence-scanner-page .table-wrap thead tr {
    background: #111a2b !important;
    background-color: #111a2b !important;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable thead th,
body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable > thead > tr > th,
body.rsi-dark-page.divergence-scanner-page .table-wrap thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 4 !important;
    background: #111a2b !important;
    background-color: #111a2b !important;
    color: #94a3b8 !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    border-bottom: 1px solid var(--rsi-line) !important;
    box-shadow: none !important;
    text-align: center !important;
    --bs-table-bg: #111a2b !important;
    --bs-table-bg-state: transparent !important;
    --bs-table-bg-type: transparent !important;
    --bs-table-accent-bg: transparent !important;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable th:first-child,
body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable td:first-child,
body.rsi-dark-page.divergence-scanner-page .table-wrap th:first-child,
body.rsi-dark-page.divergence-scanner-page .table-wrap td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 3 !important;
    box-shadow: 4px 0 14px rgba(0, 0, 0, 0.35) !important;
    border-right: 1px solid var(--rsi-line) !important;
    min-width: 100px;
    text-align: left !important;
    padding-left: 1rem !important;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable thead th:first-child,
body.rsi-dark-page.divergence-scanner-page .table-wrap thead th:first-child {
    z-index: 8 !important;
    background: #111a2b !important;
    background-color: #111a2b !important;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable td:first-child,
body.rsi-dark-page.divergence-scanner-page .table-wrap td:first-child {
    background-color: #0d1524 !important;
    color: var(--rsi-cyan) !important;
    font-weight: 700 !important;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable tbody tr:nth-child(even) td:not(:first-child),
body.rsi-dark-page.divergence-scanner-page .table-wrap tbody tr:nth-child(even) td:not(:first-child) {
    background-color: rgba(17, 26, 43, 0.55) !important;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable tbody tr:nth-child(even) td:first-child,
body.rsi-dark-page.divergence-scanner-page .table-wrap tbody tr:nth-child(even) td:first-child {
    background-color: #111a2b !important;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable tbody tr:hover td:not(:first-child),
body.rsi-dark-page.divergence-scanner-page .table-wrap tbody tr:hover td:not(:first-child) {
    background-color: rgba(56, 189, 248, 0.07) !important;
}

body.rsi-dark-page.divergence-scanner-page #divergenceScannerTable tbody tr:hover td:first-child,
body.rsi-dark-page.divergence-scanner-page .table-wrap tbody tr:hover td:first-child {
    background-color: #152033 !important;
}

body.rsi-dark-page.divergence-scanner-page table a {
    color: var(--rsi-cyan) !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}

body.rsi-dark-page.divergence-scanner-page table a:hover {
    color: #7dd3fc !important;
}

/* Unified signal + divergence pills */
body.rsi-dark-page.divergence-scanner-page .pill,
body.rsi-dark-page.divergence-scanner-page .div-pill {
    border-radius: 999px !important;
    padding: 0.28rem 0.75rem !important;
    font-size: 0.74rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.03em;
    text-transform: uppercase !important;
    display: inline-block;
    line-height: 1.2;
    min-width: 4.25rem;
    text-align: center;
}

body.rsi-dark-page.divergence-scanner-page .sig-long,
body.rsi-dark-page.divergence-scanner-page .div-bull {
    background: rgba(52, 211, 153, 0.14) !important;
    color: var(--rsi-green) !important;
    border: 1px solid rgba(52, 211, 153, 0.32) !important;
}

body.rsi-dark-page.divergence-scanner-page .sig-short,
body.rsi-dark-page.divergence-scanner-page .div-bear {
    background: rgba(248, 113, 113, 0.14) !important;
    color: var(--rsi-red) !important;
    border: 1px solid rgba(248, 113, 113, 0.32) !important;
}

body.rsi-dark-page.divergence-scanner-page .sig-neutral,
body.rsi-dark-page.divergence-scanner-page .div-none {
    background: rgba(148, 163, 184, 0.12) !important;
    color: var(--rsi-muted) !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
}

body.rsi-dark-page.divergence-scanner-page .footer-simple,
body.rsi-dark-page.divergence-scanner-page footer.footer-simple {
    background: #070b14 !important;
    background-color: #070b14 !important;
    border-top: 1px solid var(--rsi-line) !important;
    color: var(--rsi-muted) !important;
}

body.rsi-dark-page.divergence-scanner-page .indicator-sticky-head {
    background: #111a2b !important;
    color: #94a3b8 !important;
    border: 1px solid var(--rsi-line) !important;
    border-bottom: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !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,
html[dir="rtl"] body.rsi-dark-page.divergence-scanner-page .table-wrap table {
    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,
html[dir="rtl"] body.rsi-dark-page.divergence-scanner-page .table-wrap th:first-child,
html[dir="rtl"] body.rsi-dark-page.divergence-scanner-page .table-wrap td:first-child {
    left: auto !important;
    right: 0 !important;
    box-shadow: -4px 0 14px rgba(0, 0, 0, 0.35) !important;
    border-right: none !important;
    border-left: 1px solid var(--rsi-line) !important;
    text-align: right !important;
}

@media (max-width: 1100px) {
    body.rsi-dark-page.divergence-scanner-page .controls {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    body.rsi-dark-page.divergence-scanner-page .page-wrap {
        width: min(100%, calc(100% - 1.25rem)) !important;
        padding: 1rem 0 2.5rem !important;
    }

    body.rsi-dark-page.divergence-scanner-page .controls {
        grid-template-columns: 1fr 1fr;
    }

    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;
    }
}
