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

body.rsi-dark-page.compare-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;
}

/* Keep compare header aligned with RSI pages (not centered bar) */
body.rsi-dark-page.compare-page .page-header,
body.rsi-dark-page.compare-page .page-header .container {
    text-align: start !important;
}

body.rsi-dark-page.compare-page .page-header h1,
body.rsi-dark-page.compare-page .page-header .lead {
    text-align: start !important;
    margin-inline: 0 !important;
    max-width: 78ch;
}

/* 5-column compare: sticky Symbol + scrolling thead (MACD pattern) */
body.rsi-dark-page.compare-page .table-sticky-head,
body.rsi-dark-page.compare-page .indicator-sticky-head,
html[dir="rtl"] body.rsi-dark-page.compare-page .table-sticky-head,
html[dir="rtl"] body.rsi-dark-page.compare-page .indicator-sticky-head {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

body.rsi-dark-page.compare-page #longTable thead,
body.rsi-dark-page.compare-page #shortTable thead,
html[dir="rtl"] body.rsi-dark-page.compare-page #longTable thead,
html[dir="rtl"] body.rsi-dark-page.compare-page #shortTable thead {
    display: table-header-group !important;
}

body.rsi-dark-page.compare-page .signal-table th,
body.rsi-dark-page.compare-page .signal-table td,
html[dir="rtl"] body.rsi-dark-page.compare-page .signal-table th,
html[dir="rtl"] body.rsi-dark-page.compare-page .signal-table td {
    text-align: center !important;
    direction: ltr !important;
}

body.rsi-dark-page.compare-page .table-responsive {
    max-height: min(62vh, calc(100vh - 300px));
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    position: relative;
}

body.rsi-dark-page.compare-page .signal-table {
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    table-layout: auto !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    box-sizing: border-box !important;
}

body.rsi-dark-page.compare-page .signal-table thead {
    display: table-header-group !important;
}

body.rsi-dark-page.compare-page .signal-table th,
body.rsi-dark-page.compare-page .signal-table td {
    width: auto !important;
    text-align: center !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    padding: 0.7rem 0.55rem !important;
    font-size: 0.84rem;
    white-space: nowrap;
}

body.rsi-dark-page.compare-page .signal-table th:first-child,
body.rsi-dark-page.compare-page .signal-table td:first-child,
body.rsi-dark-page.compare-page .signal-table tbody td:first-child {
    text-align: center !important;
    position: sticky !important;
    left: 0 !important;
    min-width: 120px;
}

body.rsi-dark-page.compare-page .signal-table tbody td:first-child .symbol-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem;
    max-width: 100%;
    color: var(--rsi-cyan) !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}

body.rsi-dark-page.compare-page .signal-table tbody td:first-child .symbol-link img {
    flex-shrink: 0;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50%;
}

body.rsi-dark-page.compare-page .signal-table tbody td:first-child .symbol-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

body.rsi-dark-page.compare-page .rsi-between .sep,
body.rsi-dark-page.compare-page .rsi-between .rsi-between-sep {
    color: var(--rsi-muted);
    font-weight: 700;
}

body.rsi-dark-page.compare-page .rsi-value-suffix {
    color: var(--rsi-muted);
    font-size: 0.72rem;
    font-weight: 700;
    padding-inline-end: 0.55rem;
}

@media (min-width: 1024px) {
    body.rsi-dark-page.compare-page .signal-table {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed !important;
    }

    body.rsi-dark-page.compare-page .signal-table th,
    body.rsi-dark-page.compare-page .signal-table td {
        width: 20% !important;
        min-width: 0 !important;
    }
}

@media (max-width: 1100px) {
    body.rsi-dark-page.compare-page .tables-container,
    html[dir="rtl"] body.rsi-dark-page.compare-page .tables-container {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    body.rsi-dark-page.compare-page .rsi-panel-header {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.65rem 0.75rem;
    }

    body.rsi-dark-page.compare-page .rsi-panel-title {
        flex: 1 1 auto;
        min-width: 0;
    }

    body.rsi-dark-page.compare-page .rsi-panel-title strong,
    body.rsi-dark-page.compare-page .rsi-panel-title small {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    body.rsi-dark-page.compare-page .rsi-panel-badge {
        flex: 0 1 auto;
        max-width: 100%;
        white-space: normal;
        text-align: center;
        line-height: 1.25;
    }

    body.rsi-dark-page.compare-page .table-responsive {
        max-height: min(70vh, calc(100dvh - 260px)) !important;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    body.rsi-dark-page.compare-page .signal-table th,
    body.rsi-dark-page.compare-page .signal-table td {
        font-size: 0.78rem !important;
        padding: 0.55rem 0.35rem !important;
    }

    body.rsi-dark-page.compare-page .signal-table th:first-child,
    body.rsi-dark-page.compare-page .signal-table td:first-child {
        min-width: 108px !important;
        width: 108px !important;
    }

    body.rsi-dark-page.compare-page .signal-table tbody td:first-child .symbol-link img {
        width: 14px !important;
        height: 14px !important;
    }
}

/* RTL: same layout as LTR, mirrored chrome */
html[dir="rtl"] body.rsi-dark-page.compare-page .page-header,
html[dir="rtl"] body.rsi-dark-page.compare-page .breadcrumb-nav,
html[dir="rtl"] body.rsi-dark-page.compare-page .controls-header,
html[dir="rtl"] body.rsi-dark-page.compare-page .rsi-panel-header,
html[dir="rtl"] body.rsi-dark-page.compare-page .rsi-filter-bar,
html[dir="rtl"] body.rsi-dark-page.compare-page .seo-description-section {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] body.rsi-dark-page.compare-page .page-header,
html[dir="rtl"] body.rsi-dark-page.compare-page .page-header .container,
html[dir="rtl"] body.rsi-dark-page.compare-page .page-header h1,
html[dir="rtl"] body.rsi-dark-page.compare-page .page-header .lead {
    text-align: right !important;
}

html[dir="rtl"] body.rsi-dark-page.compare-page .tables-container {
    display: grid !important;
    flex-direction: unset !important;
    direction: ltr;
    unicode-bidi: isolate;
}

/* Desktop only: keep Long/Short side-by-side. Mobile must stack (same as LTR). */
@media (min-width: 1101px) {
    html[dir="rtl"] body.rsi-dark-page.compare-page .tables-container {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    }
}

@media (max-width: 1100px) {
    html[dir="rtl"] body.rsi-dark-page.compare-page .tables-container {
        grid-template-columns: 1fr !important;
    }
}

html[dir="rtl"] body.rsi-dark-page.compare-page .table-wrapper {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    min-width: 0 !important;
    width: 100% !important;
}

html[dir="rtl"] body.rsi-dark-page.compare-page .table-responsive,
html[dir="rtl"] body.rsi-dark-page.compare-page .signal-table {
    direction: ltr;
    unicode-bidi: isolate;
}

html[dir="rtl"] body.rsi-dark-page.compare-page .signal-table th,
html[dir="rtl"] body.rsi-dark-page.compare-page .signal-table td {
    text-align: center !important;
}

html[dir="rtl"] body.rsi-dark-page.compare-page .controls-header {
    justify-content: flex-start !important;
}

html[dir="rtl"] body.rsi-dark-page.compare-page .search-controls {
    direction: rtl;
}

html[dir="rtl"] body.rsi-dark-page.compare-page .search-icon {
    right: 0.9rem !important;
    left: auto !important;
}

html[dir="rtl"] body.rsi-dark-page.compare-page #searchInput {
    padding: 0.7rem 2.45rem 0.7rem 1rem !important;
}

/* Compact search for RSI/TSI/ADX/COMB preview */
body.rsi-dark-page.compare-page .search-controls {
    width: min(100%, 420px) !important;
    overflow: visible !important;
}

body.rsi-dark-page.compare-page .search-results,
body.rsi-dark-page.compare-page .rsi-search-ac {
    width: 100% !important;
    right: auto !important;
    max-width: 420px !important;
}

body.rsi-dark-page.compare-page .search-result-item {
    grid-template-columns: minmax(5.5rem, 0.95fr) minmax(0, 1.35fr) !important;
    gap: 0.4rem 0.55rem !important;
    padding: 0.45rem 0.55rem !important;
}

body.rsi-dark-page.compare-page .search-result-item .rsi-ac-symbol {
    max-width: 8.5rem;
    font-size: 0.86rem;
}

body.rsi-dark-page.compare-page .search-result-item .rsi-ac-metrics {
    width: 100%;
    gap: 0.2rem;
}

body.rsi-dark-page.compare-page .search-result-item .rsi-ac-metric-value {
    font-size: 0.78rem;
}

body.rsi-dark-page.compare-page .search-result-item .rsi-ac-metric-label {
    font-size: 0.58rem;
}

body.rsi-dark-page.compare-page .search-result-item .rsi-ac-updated {
    display: none !important;
}
