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

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

body.rsi-dark-page.rta-page .page-header,
body.rsi-dark-page.rta-page .page-header .container {
    text-align: start !important;
}

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

/* Timeframe filter card */
body.rsi-dark-page.rta-page .rta-filters-card {
    position: relative;
    overflow: hidden;
    margin: 0 0 1.25rem !important;
    padding: 1.15rem 1.25rem !important;
    border: 1px solid var(--rsi-line) !important;
    border-radius: 20px !important;
    border-top: 1px solid var(--rsi-line) !important;
    background:
        radial-gradient(640px 220px at 0% 0%, rgba(14, 165, 233, 0.14), 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.rta-page .rta-filters-card::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--rsi-cyan), var(--rsi-gold), transparent);
}

body.rsi-dark-page.rta-page .rta-filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 0.95rem;
}

body.rsi-dark-page.rta-page .rta-filters-title {
    font-family: var(--rsi-display) !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--rsi-text) !important;
    letter-spacing: -0.02em;
}

body.rsi-dark-page.rta-page .rta-filters-title i {
    margin-inline-end: 0.45rem;
    color: var(--rsi-cyan) !important;
}

body.rsi-dark-page.rta-page .rta-filters-hint {
    margin-top: 0.85rem !important;
    padding: 0.65rem 0.85rem !important;
    border: 1px solid rgba(56, 189, 248, 0.22) !important;
    border-radius: 12px !important;
    background: rgba(56, 189, 248, 0.07) !important;
    color: var(--rsi-muted) !important;
    font-size: 0.82rem !important;
    white-space: normal !important;
}

body.rsi-dark-page.rta-page .rta-filters-card .btn-filter-reset,
body.rsi-dark-page.rta-page #rtaFiltersReset {
    min-height: 36px !important;
    height: auto !important;
    padding: 0.45rem 0.9rem !important;
    border: 1px solid rgba(248, 113, 113, 0.35) !important;
    border-radius: 999px !important;
    background: rgba(248, 113, 113, 0.1) !important;
    color: #fca5a5 !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
}

body.rsi-dark-page.rta-page .rta-filters-card .rsi-op-segment {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
    border: 0 !important;
    background: transparent !important;
}

body.rsi-dark-page.rta-page .rta-filters-card .rsi-op-btn {
    min-height: 34px !important;
    height: auto !important;
    padding: 0.45rem 0.85rem !important;
    border: 1px solid var(--rsi-line) !important;
    border-radius: 999px !important;
    background: rgba(13, 21, 36, 0.85) !important;
    color: #cbd5e1 !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

body.rsi-dark-page.rta-page .rta-filters-card .rsi-op-btn: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.rta-page .rta-filters-card .rsi-op-btn.active,
body.rsi-dark-page.rta-page .rta-filters-card .rsi-op-btn.timeframe-btn.active {
    border-color: rgba(56, 189, 248, 0.6) !important;
    background: rgba(14, 165, 233, 0.18) !important;
    color: #7dd3fc !important;
    box-shadow: none !important;
}

/* 5-col table: sticky Symbol + scrolling thead (MACD pattern) */
body.rsi-dark-page.rta-page .table-wrapper {
    overflow: hidden !important;
    min-width: 0 !important;
}

body.rsi-dark-page.rta-page .table-sticky-head,
body.rsi-dark-page.rta-page .indicator-sticky-head,
html[dir="rtl"] body.rsi-dark-page.rta-page .table-sticky-head,
html[dir="rtl"] body.rsi-dark-page.rta-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.rta-page #longTable thead,
body.rsi-dark-page.rta-page #shortTable thead,
html[dir="rtl"] body.rsi-dark-page.rta-page #longTable thead,
html[dir="rtl"] body.rsi-dark-page.rta-page #shortTable thead {
    display: table-header-group !important;
}

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

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

body.rsi-dark-page.rta-page .signal-table,
body.rsi-dark-page.rta-page #longTable,
body.rsi-dark-page.rta-page #shortTable {
    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.rta-page .signal-table thead,
body.rsi-dark-page.rta-page #longTable thead,
body.rsi-dark-page.rta-page #shortTable thead {
    display: table-header-group !important;
}

body.rsi-dark-page.rta-page #longTable th,
body.rsi-dark-page.rta-page #longTable td,
body.rsi-dark-page.rta-page #shortTable th,
body.rsi-dark-page.rta-page #shortTable td,
body.rsi-dark-page.rta-page #longTable th:nth-child(n),
body.rsi-dark-page.rta-page #longTable td:nth-child(n),
body.rsi-dark-page.rta-page #shortTable th:nth-child(n),
body.rsi-dark-page.rta-page #shortTable td:nth-child(n) {
    width: auto !important;
    max-width: none !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;
    transition: none !important;
}

body.rsi-dark-page.rta-page #longTable th:first-child,
body.rsi-dark-page.rta-page #longTable td:first-child,
body.rsi-dark-page.rta-page #shortTable th:first-child,
body.rsi-dark-page.rta-page #shortTable td:first-child {
    text-align: center !important;
    position: sticky !important;
    left: 0 !important;
    min-width: 120px;
}

body.rsi-dark-page.rta-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;
    cursor: default !important;
}

body.rsi-dark-page.rta-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.rta-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.rta-page .rsi-between .sep,
body.rsi-dark-page.rta-page .rsi-between .rsi-between-sep {
    color: var(--rsi-muted);
    font-weight: 700;
}

body.rsi-dark-page.rta-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.rta-page .signal-table,
    body.rsi-dark-page.rta-page #longTable,
    body.rsi-dark-page.rta-page #shortTable {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed !important;
    }

    body.rsi-dark-page.rta-page #longTable th,
    body.rsi-dark-page.rta-page #longTable td,
    body.rsi-dark-page.rta-page #shortTable th,
    body.rsi-dark-page.rta-page #shortTable td {
        width: 20% !important;
        min-width: 0 !important;
    }
}

/* No hover feedback on table rows */
body.rsi-dark-page.rta-page .signal-table tbody tr,
body.rsi-dark-page.rta-page .signal-table tbody tr:nth-child(even),
body.rsi-dark-page.rta-page .signal-table tbody tr:hover,
body.rsi-dark-page.rta-page .signal-table tbody tr:hover td,
body.rsi-dark-page.rta-page .signal-table tbody tr:hover td.high-value,
body.rsi-dark-page.rta-page .signal-table tbody tr:hover td.low-value,
body.rsi-dark-page.rta-page .signal-table tbody tr:hover td.neutral-value {
    background: transparent !important;
    cursor: default !important;
}

body.rsi-dark-page.rta-page .signal-table tbody td.high-value {
    background: rgba(248, 113, 113, 0.12) !important;
}

body.rsi-dark-page.rta-page .signal-table tbody td.low-value {
    background: rgba(52, 211, 153, 0.12) !important;
}

body.rsi-dark-page.rta-page .signal-table tbody td.neutral-value {
    background: rgba(234, 179, 8, 0.1) !important;
}

body.rsi-dark-page.rta-page .signal-table a:hover,
body.rsi-dark-page.rta-page .symbol-link:hover,
body.rsi-dark-page.rta-page .symbol-link:active {
    color: var(--rsi-cyan) !important;
    text-decoration: none !important;
}

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

@media (max-width: 768px) {
    body.rsi-dark-page.rta-page .rta-filters-card {
        padding: 1rem !important;
    }

    body.rsi-dark-page.rta-page .rta-filters-card .rsi-op-btn {
        flex: 1 1 calc(50% - 0.4rem);
        text-align: center;
    }

    body.rsi-dark-page.rta-page .rsi-panel-header {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.65rem 0.75rem;
    }

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

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

    body.rsi-dark-page.rta-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.rta-page .table-responsive {
        max-height: min(70vh, calc(100dvh - 260px)) !important;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    body.rsi-dark-page.rta-page #longTable th,
    body.rsi-dark-page.rta-page #longTable td,
    body.rsi-dark-page.rta-page #shortTable th,
    body.rsi-dark-page.rta-page #shortTable td {
        font-size: 0.78rem !important;
        padding: 0.55rem 0.35rem !important;
    }

    body.rsi-dark-page.rta-page #longTable th:first-child,
    body.rsi-dark-page.rta-page #longTable td:first-child,
    body.rsi-dark-page.rta-page #shortTable th:first-child,
    body.rsi-dark-page.rta-page #shortTable td:first-child {
        min-width: 108px !important;
        width: 108px !important;
    }
}

/* RTL */
html[dir="rtl"] body.rsi-dark-page.rta-page .page-header,
html[dir="rtl"] body.rsi-dark-page.rta-page .breadcrumb-nav,
html[dir="rtl"] body.rsi-dark-page.rta-page .controls-header,
html[dir="rtl"] body.rsi-dark-page.rta-page .rta-filters-card,
html[dir="rtl"] body.rsi-dark-page.rta-page .rsi-panel-header,
html[dir="rtl"] body.rsi-dark-page.rta-page .rsi-filter-bar,
html[dir="rtl"] body.rsi-dark-page.rta-page .seo-description-section {
    direction: rtl;
    text-align: right;
}

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

html[dir="rtl"] body.rsi-dark-page.rta-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.rta-page .tables-container {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    }
}

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

html[dir="rtl"] body.rsi-dark-page.rta-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.rta-page .table-responsive,
html[dir="rtl"] body.rsi-dark-page.rta-page .signal-table {
    direction: ltr;
    unicode-bidi: isolate;
}

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

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

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

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

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

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

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

body.rsi-dark-page.rta-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.rta-page .search-result-item .rsi-ac-symbol {
    max-width: 8.5rem;
    font-size: 0.86rem;
}

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

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

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

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