/* ========================================================
   SpyQiNex - Institutional Trade Replay & Execution Engine
   Sleek dark-glass drawer, interactive bar jumping, zero-distortion markers
   ======================================================== */

.chart-replay-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.12) !important;
    border: 1px solid rgba(59, 130, 246, 0.35) !important;
    color: #60a5fa !important;
    font-weight: 600 !important;
    padding: 5px 11px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-replay-btn:hover {
    background: rgba(59, 130, 246, 0.25) !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
}

.replay-badge {
    background: #2563eb;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 1.2;
}

/* Slide-over Drawer Overlay */
.replay-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    display: flex;
    justify-content: flex-end;
}

.replay-drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.replay-drawer-panel {
    width: 440px;
    max-width: 90vw;
    height: 100%;
    background: #0f172a;
    border-left: 1px solid #1e293b;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.replay-drawer-overlay.active .replay-drawer-panel {
    transform: translateX(0);
}

/* Header */
.replay-header {
    padding: 16px 20px;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111827;
}

.replay-title {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.replay-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.replay-close-btn:hover {
    color: #f87171;
}

/* Sub-bar / Filters */
.replay-toolbar {
    padding: 12px 20px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.replay-toggle-label {
    font-size: 11px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.replay-stat-pill {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.6);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #334155;
}

/* Trade List */
.replay-trade-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.replay-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px 14px;
    transition: all 0.18s ease;
    cursor: pointer;
    position: relative;
}

.replay-card:hover {
    border-color: #3b82f6;
    background: #243248;
    transform: translateY(-1px);
}

.replay-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.replay-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.replay-tag.buy {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.replay-tag.sell-win {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.replay-tag.sell-loss {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.replay-time {
    font-size: 11px;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
}

.replay-card-main {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.replay-contract {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
}

.replay-price {
    font-size: 13px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: #e2e8f0;
}

.replay-pnl {
    font-size: 12px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.replay-pnl.positive {
    color: #34d399;
}

.replay-pnl.negative {
    color: #f87171;
}

.replay-reason {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.35;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.replay-action-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.replay-jump-btn {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.replay-jump-btn:hover {
    background: #2563eb;
    color: #ffffff;
}

/* Empty State */
.replay-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    font-size: 13px;
}


/* Lightweight Charts internal table protection */
#tradingChart table,
.chart-display-area table,
.tv-lightweight-charts table {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

#tradingChart table tr,
.chart-display-area table tr,
.tv-lightweight-charts table tr {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

#tradingChart table td,
.chart-display-area table td,
.tv-lightweight-charts table td {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
