/* Signals page – professional dark theme (Markets & Crypto) */

body.rsi-dark-page #contentArea.container-fluid {
    max-width: 1240px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 20px 16px 36px !important;
    background: transparent !important;
}

body.rsi-dark-page .timeframe-content.active {
    display: block;
}

body.rsi-dark-page .timeframe-tabs {
    display: none !important;
}

/* Intro chip bar */
body.rsi-dark-page .signals-intro-bar {
    background: #141b26;
    border: 1px solid #2a3544;
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

body.rsi-dark-page .signals-intro-bar__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    color: #94a3b8;
}

body.rsi-dark-page .signals-chip {
    font-weight: 700;
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

body.rsi-dark-page .signals-chip i {
    margin-right: 6px;
    color: #60a5fa;
}

/* Metric cards */
body.rsi-dark-page .performance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 0 0 18px;
}

body.rsi-dark-page .metric-card {
    background: #141b26;
    border: 1px solid #2a3544;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

body.rsi-dark-page .metric-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

body.rsi-dark-page .metric-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.02em;
}

body.rsi-dark-page .metric-detail {
    margin-top: 6px;
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Signal board panel */
body.rsi-dark-page .signals-board-panel {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(5, 150, 105, 0.08) 100%);
    border: 1px solid rgba(52, 211, 153, 0.35);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 18px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

body.rsi-dark-page .signals-board-panel h2 {
    color: #ecfdf5;
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 800;
}

body.rsi-dark-page .signals-board-panel h2 i {
    margin-right: 10px;
    color: #34d399;
}

body.rsi-dark-page .signals-board-panel p {
    margin: 0;
    font-size: 0.95rem;
    color: #a7f3d0;
    line-height: 1.5;
}

/* Table tools */
body.rsi-dark-page .table-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding: 12px 14px;
    background: #141b26;
    border: 1px solid #2a3544;
    border-radius: 12px;
}

body.rsi-dark-page .table-tools input[type="search"] {
    padding: 8px 12px;
    border: 1px solid #2a3544;
    border-radius: 10px;
    font-size: 12px;
    min-width: 180px;
    background: #0c1219;
    color: #f1f5f9;
}

body.rsi-dark-page .table-tools input[type="search"]::placeholder {
    color: #64748b;
}

body.rsi-dark-page .table-tools select {
    padding: 8px 12px;
    border: 1px solid #2a3544;
    border-radius: 10px;
    font-size: 12px;
    background: #0c1219;
    color: #e2e8f0;
}

body.rsi-dark-page .table-tools label {
    font-size: 12px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

body.rsi-dark-page .table-tools label:hover {
    background: rgba(59, 130, 246, 0.1);
}

body.rsi-dark-page .tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #1a2332;
    color: #94a3b8;
    border: 1px solid #2a3544;
}

body.rsi-dark-page .tool-badge.warn {
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.35);
}

/* Open trade cards */
body.rsi-dark-page .open-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin: 0 0 18px;
}

body.rsi-dark-page .open-trade-card {
    background: #141b26;
    border-radius: 14px;
    border: 1px solid #2a3544;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body.rsi-dark-page .open-trade-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

body.rsi-dark-page .open-trade-card.long {
    border-left: 4px solid #34d399;
}

body.rsi-dark-page .open-trade-card.short {
    border-left: 4px solid #f87171;
}

body.rsi-dark-page .open-trade-header {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #fff;
}

body.rsi-dark-page .open-trade-card.long .open-trade-header {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

body.rsi-dark-page .open-trade-card.short .open-trade-header {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

body.rsi-dark-page .open-trade-card:not(.long):not(.short) .open-trade-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

body.rsi-dark-page .open-trade-title {
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.rsi-dark-page .open-trade-pill {
    background: rgba(255, 255, 255, 0.92);
    color: #1e293b;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

body.rsi-dark-page .open-trade-body {
    padding: 12px 14px;
    font-size: 12px;
}

body.rsi-dark-page .open-trade-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.25);
}

body.rsi-dark-page .open-trade-row:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

body.rsi-dark-page .open-trade-label {
    color: #64748b;
    font-weight: 600;
    min-width: 110px;
}

body.rsi-dark-page .open-trade-value {
    font-weight: 700;
    color: #f1f5f9;
    text-align: right;
    min-width: 90px;
}

body.rsi-dark-page .open-trade-value.changed {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.12);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

body.rsi-dark-page .open-trade-progress {
    height: 8px;
    border-radius: 10px;
    background: rgba(30, 41, 59, 0.8);
    overflow: hidden;
}

body.rsi-dark-page .open-trade-progress .bar {
    height: 100%;
    border-radius: 10px;
}

body.rsi-dark-page .open-trade-progress .bar.tp {
    background: #34d399;
}

body.rsi-dark-page .open-trade-progress .bar.sl {
    background: #f87171;
}

body.rsi-dark-page .open-cards-empty {
    padding: 20px;
    text-align: center;
    color: #64748b;
    background: #141b26;
    border-radius: 14px;
    border: 1px dashed #2a3544;
}

/* Signal tables */
body.rsi-dark-page .signal-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #141b26;
    border: 1px solid #2a3544;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

body.rsi-dark-page .signal-table th {
    background: #1a2332 !important;
    color: #94a3b8 !important;
    border-bottom: 1px solid #2a3544 !important;
    padding: 10px 8px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

body.rsi-dark-page .signal-table td {
    color: #e2e8f0;
    border-bottom: 1px solid #1e293b;
    padding: 8px 6px;
    font-size: 12px;
    background: #0f1419;
}

body.rsi-dark-page .signal-table tbody tr:hover td {
    background: #1a2332 !important;
}

body.rsi-dark-page .signal-table tbody tr.row-alert td {
    background: rgba(245, 158, 11, 0.08) !important;
}

body.rsi-dark-page .change-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: #1a2332;
    color: #64748b;
    border: 1px solid #2a3544;
}

body.rsi-dark-page .change-badge.changed {
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.35);
}

body.rsi-dark-page .buy-signal,
body.rsi-dark-page .long-signal,
body.rsi-dark-page .bullish-signal {
    background: rgba(52, 211, 153, 0.15) !important;
    color: #6ee7b7 !important;
    font-weight: 700 !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    border: 1px solid rgba(52, 211, 153, 0.35) !important;
    display: inline-block !important;
}

body.rsi-dark-page .sell-signal,
body.rsi-dark-page .short-signal,
body.rsi-dark-page .bearish-signal {
    background: rgba(248, 113, 113, 0.15) !important;
    color: #fca5a5 !important;
    font-weight: 700 !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    border: 1px solid rgba(248, 113, 113, 0.35) !important;
    display: inline-block !important;
}

body.rsi-dark-page .pnl-pos {
    color: #34d399 !important;
    font-weight: 700 !important;
}

body.rsi-dark-page .pnl-neg {
    color: #f87171 !important;
    font-weight: 700 !important;
}

/* Completed section */
body.rsi-dark-page .completed-section {
    margin-top: 28px;
    padding-top: 8px;
}

body.rsi-dark-page .completed-section h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 8px;
}

body.rsi-dark-page .completed-section h3 i {
    color: #34d399;
    margin-right: 8px;
}

body.rsi-dark-page .completed-section > p {
    margin-bottom: 14px;
    color: #94a3b8;
    font-size: 0.9rem;
}

body.rsi-dark-page .completed-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

body.rsi-dark-page .completed-table thead th {
    background-color: #1a2332 !important;
    color: #94a3b8 !important;
    white-space: nowrap;
    font-size: 10px;
    padding: 8px 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

body.rsi-dark-page .completed-table thead th:first-child,
body.rsi-dark-page .completed-table tbody td:first-child {
    min-width: 100px;
    max-width: none !important;
    white-space: nowrap;
}

@media (max-width: 992px), (max-height: 520px), (orientation: landscape) and (max-height: 700px) {
    body.rsi-dark-page .completed-table thead th:first-child {
        position: sticky;
        left: 0;
        top: 0;
        z-index: 4;
        background-color: #1a2332 !important;
        background-image: none !important;
        min-width: 92px;
        max-width: none !important;
        box-shadow: 4px 0 0 #1a2332, 6px 0 10px rgba(0, 0, 0, 0.35);
    }

    body.rsi-dark-page .completed-table thead th {
        position: sticky;
        top: 0;
        z-index: 3;
        background-color: #1a2332 !important;
    }

    body.rsi-dark-page .completed-table tbody td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        background-color: #0f1419 !important;
        background-image: none !important;
        min-width: 92px;
        max-width: none !important;
        overflow: hidden !important;
        box-shadow: 4px 0 0 #0f1419, 6px 0 10px rgba(0, 0, 0, 0.35);
    }

    body.rsi-dark-page .completed-table tbody tr:nth-child(even) td:first-child {
        background-color: #141b26 !important;
        box-shadow: 4px 0 0 #141b26, 6px 0 10px rgba(0, 0, 0, 0.35);
    }

    body.rsi-dark-page .completed-table tbody tr.row-alert td:first-child {
        background-color: #1a1810 !important;
        box-shadow: 4px 0 0 #1a1810, 6px 0 10px rgba(0, 0, 0, 0.35);
    }

    body.rsi-dark-page .completed-table tbody tr:hover td:first-child {
        background-color: #1a2332 !important;
        box-shadow: 4px 0 0 #1a2332, 6px 0 10px rgba(0, 0, 0, 0.35);
    }

    body.rsi-dark-page .completed-table tbody td:first-child a {
        color: #e2e8f0 !important;
        font-weight: 700 !important;
        font-size: 11px !important;
        text-decoration: none;
        position: relative;
        z-index: 1;
    }

    body.rsi-dark-page .completed-table tbody td:first-child > div {
        justify-content: flex-start !important;
        gap: 4px;
        position: relative;
        z-index: 1;
    }
}

/* Disclaimer panels */
body.rsi-dark-page .signals-disclaimer {
    margin-top: 24px;
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(234, 88, 12, 0.08) 100%);
    border-radius: 14px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

body.rsi-dark-page .signals-disclaimer h4 {
    margin: 0 0 12px;
    color: #fcd34d;
    font-size: 1.05rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

body.rsi-dark-page .signals-disclaimer__body {
    background: rgba(15, 20, 25, 0.85);
    padding: 16px 18px;
    border-radius: 10px;
    color: #cbd5e1;
    line-height: 1.65;
    border: 1px solid #2a3544;
}

body.rsi-dark-page .signals-disclaimer__body p {
    margin: 0 0 12px;
    font-size: 14px;
}

body.rsi-dark-page .signals-disclaimer__body p:last-child {
    margin-bottom: 0;
}

body.rsi-dark-page .signals-disclaimer__body strong {
    color: #f8fafc;
}

body.rsi-dark-page .signals-legal-notice {
    margin-top: 16px;
    padding: 14px 16px;
    background: #141b26;
    border: 1px solid #2a3544;
    border-left: 4px solid #f59e0b;
    border-radius: 12px;
    color: #94a3b8;
    font-size: 14px;
}

body.rsi-dark-page .signals-legal-notice strong {
    color: #fcd34d;
}

/* FAQ panel – dark card (all locales; overrides legacy inline light styles) */
body.rsi-dark-page .signals-faq-panel {
    margin-top: 24px;
}

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

body.rsi-dark-page .signals-faq-panel .card::before {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg, #1d4ed8, #06b6d4, #a855f7);
}

body.rsi-dark-page .signals-faq-panel .card-body {
    color: #94a3b8 !important;
}

body.rsi-dark-page .signals-faq-panel h3 {
    color: #f8fafc !important;
    font-size: 1.35rem;
    margin-bottom: 20px;
    text-align: center;
}

body.rsi-dark-page .signals-faq-panel h3 i {
    color: #60a5fa;
    margin-inline-end: 10px;
}

body.rsi-dark-page .signals-faq-item h5 {
    color: #f1f5f9 !important;
    font-size: 15px;
    margin-bottom: 8px;
}

body.rsi-dark-page .signals-faq-item h5 i {
    color: #60a5fa;
    margin-inline-end: 8px;
}

body.rsi-dark-page .signals-faq-item p {
    font-size: 14px;
    color: #94a3b8 !important;
    margin: 0 0 18px;
}

html[dir="rtl"] body.rsi-dark-page .signals-faq-panel .row {
    direction: rtl;
}

/* Loading / refresh controls */
body.rsi-dark-page #global-loading-indicator {
    border-color: rgba(59, 130, 246, 0.25) !important;
    border-top-color: #3b82f6 !important;
}

body.rsi-dark-page #refresh-button {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
}

@keyframes pulse-live {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

body.rsi-dark-page .live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #34d399;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse-live 2s infinite ease-in-out;
}

@media (max-width: 768px) {
    body.rsi-dark-page .open-cards-grid {
        grid-template-columns: 1fr;
    }

    body.rsi-dark-page .table-tools input[type="search"] {
        min-width: 140px;
        flex: 1;
    }
}
