/* ═══════════════════════════════════════════════════════════════════
   ORDERBOOK POP-UP MODAL - SMART RUNNING TRADE
   Ultra-Fast, Zero-Latency, Scalper Focused
   ═══════════════════════════════════════════════════════════════════ */

.orderbook-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.orderbook-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.orderbook-modal-wrapper {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  max-width: 1350px;
  width: 100%;
  max-height: 92vh;
  position: relative;
}

.orderbook-modal-card {
  background: rgba(11, 17, 33, 0.98);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85), 0 0 24px rgba(56, 189, 248, 0.15);
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #f8fafc;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

/* Modal Header */
.ob-modal-header {
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ob-hdr-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ob-hdr-ticker-badge {
  font-family: var(--font-mono, monospace);
  font-size: 16px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  letter-spacing: 0.5px;
}

.ob-hdr-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ob-hdr-name {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.ob-hdr-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.ob-hdr-price {
  font-family: var(--font-mono, monospace);
  font-size: 17px;
  font-weight: 800;
  color: #f8fafc;
}

.ob-hdr-change {
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  font-weight: 700;
}

.ob-hdr-change.up { color: #34d399; }
.ob-hdr-change.down { color: #f87171; }
.ob-hdr-change.neutral { color: #94a3b8; }

.ob-hdr-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ob-live-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 9.5px;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.ob-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: obPulse 1.4s infinite;
}

@keyframes obPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.ob-modal-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.ob-modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Bounds Bar */
.ob-bounds-bar {
  padding: 6px 16px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--font-mono, monospace);
  color: #94a3b8;
}

.ob-bound-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ob-bound-ara { color: #c084fc; font-weight: 800; }
.ob-bound-arb { color: #fb7185; font-weight: 800; }

/* Benchmark Bar & Average Ribbon */
.ob-benchmarks-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ob-bench-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  transition: all 0.15s ease;
  cursor: default;
}

.ob-bench-card:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(56, 189, 248, 0.35);
}

.ob-bench-lbl {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #94a3b8;
  text-transform: uppercase;
}

.ob-bench-val {
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
}

.ob-bench-diff {
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ob-bench-diff.up { color: #34d399; }
.ob-bench-diff.down { color: #f87171; }
.ob-bench-diff.neutral { color: #94a3b8; }

/* Power Bar */
.ob-power-wrap {
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ob-power-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  margin-bottom: 4px;
}

.ob-power-bar {
  height: 5px;
  width: 100%;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(239, 68, 68, 0.8);
  display: flex;
}

.ob-power-bid-fill {
  background: #10b981;
  height: 100%;
  transition: width 0.2s ease;
}

/* Table Container */
.ob-table-container {
  flex: 1;
  overflow-y: auto;
  min-height: 280px;
}

.ob-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
}

.ob-table th {
  padding: 6px 6px;
  font-size: 9.5px;
  font-weight: 800;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 2;
  text-transform: uppercase;
}

.ob-table td {
  padding: 4px 6px;
  white-space: nowrap;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ob-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.ob-cell-bid-price {
  font-weight: 800;
  color: #34d399;
  text-align: right;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.ob-cell-offer-price {
  font-weight: 800;
  color: #f87171;
  text-align: left;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

/* Dual Power Bar inside Lot Cell (Haka Hijau vs Haki Merah) */
.ob-cell-power-bar {
  display: flex;
  height: 3px;
  width: 100%;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.ob-power-seg-haka {
  background: #10b981;
  height: 100%;
  transition: width 0.2s ease;
}

.ob-power-seg-haki {
  background: #ef4444;
  height: 100%;
  transition: width 0.2s ease;
}

.ob-cell-lot-wrap {
  position: relative;
  font-weight: 700;
}

.ob-depth-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  opacity: 0.22;
  pointer-events: none;
  transition: width 0.15s ease;
}

.ob-depth-bar.bid {
  right: 0;
  background: #10b981;
}

.ob-depth-bar.offer {
  left: 0;
  background: #ef4444;
}

.ob-lot-text {
  position: relative;
  z-index: 1;
}

/* Modal Footer */
.ob-modal-footer {
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ob-footer-btn-act {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #0284c7;
  color: #fff;
  border: 1px solid #38bdf8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ob-footer-btn-act:hover {
  background: #0369a1;
}

.ob-footer-btn-secondary {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ob-footer-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════
   ORDERBOOK QUEUE SIDE PANEL (Muncul di samping layar Orderbook)
   - left: muncul di sebelah kiri (sebelah Bid)
   - right: muncul di sebelah kanan (sebelah Offer)
   ═══════════════════════════════════════════════════════════════════ */
.orderbook-queue-sidepanel {
  display: none;
  width: 410px;
  min-width: 380px;
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85), 0 0 20px rgba(15, 23, 42, 0.8);
  color: #f8fafc;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  flex-direction: column;
  overflow: hidden;
}

.orderbook-queue-sidepanel.open {
  display: flex;
}

.orderbook-queue-sidepanel.left {
  animation: slideSidepanelLeft 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-right: 2px solid rgba(16, 185, 129, 0.6);
}

.orderbook-queue-sidepanel.right {
  animation: slideSidepanelRight 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 2px solid rgba(239, 68, 68, 0.6);
}

@keyframes slideSidepanelLeft {
  from {
    opacity: 0;
    transform: translateX(-14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes slideSidepanelRight {
  from {
    opacity: 0;
    transform: translateX(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* ═══════════════════════════════════════════════════════════════════
   ANTREAN ORDER MODAL STYLES (Identik dengan Screenshot User)
   ═══════════════════════════════════════════════════════════════════ */
.antrean-order-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: #0f172a;
  overflow: hidden;
}

.antrean-order-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #131d35;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.antrean-order-hdr-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.antrean-back-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.antrean-back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.antrean-order-title {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.2px;
}

.antrean-order-title strong {
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  margin-left: 2px;
}

.antrean-filter-badge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.12);
}

.antrean-filter-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Price Box / Filter pill */
.antrean-price-box-wrap {
  padding: 10px 14px 6px 14px;
  background: #0f172a;
}

.antrean-price-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
}

.antrean-price-text {
  font-size: 13.5px;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  color: #f8fafc;
}

.antrean-price-clear-btn {
  background: rgba(148, 163, 184, 0.25);
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.antrean-price-clear-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #fff;
}

/* Scrollable Table */
.antrean-table-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 10px;
  max-height: 520px;
}

.antrean-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
}

.antrean-table thead th {
  padding: 8px 6px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-sans, sans-serif);
  white-space: nowrap;
}

.th-antrean { text-align: left; width: 50px; }
.th-waktu { text-align: center; width: 68px; }
.th-aksi { text-align: center; width: 42px; }
.th-harga { text-align: right; width: 48px; }
.th-status { text-align: center; width: 85px; }
.th-open { text-align: right; }

.th-sort {
  font-size: 9px;
  opacity: 0.6;
  margin-left: 2px;
}

.antrean-tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.1s;
}

.antrean-tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.col-antrean {
  text-align: left;
  padding: 6.5px 6px;
  color: #94a3b8;
  font-weight: 600;
  font-size: 11px;
}

.col-waktu {
  text-align: center;
  padding: 6.5px 6px;
  color: #cbd5e1;
  font-size: 10.5px;
}

.col-aksi {
  text-align: center;
  padding: 6.5px 6px;
  font-weight: 700;
  font-size: 11px;
}

.col-harga {
  text-align: right;
  padding: 6.5px 6px;
  font-weight: 700;
  font-size: 11px;
}

.col-status {
  text-align: center;
  padding: 6.5px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.col-open {
  text-align: right;
  padding: 6.5px 6px;
  font-weight: 800;
  font-size: 11.5px;
}

/* Colors matching Stockbit Indonesian IDX */
.aksi-beli, .harga-beli, .open-beli {
  color: #10b981;
}

.aksi-jual, .harga-jual, .open-jual {
  color: #ef4444;
}

.antrean-status-badge {
  display: inline-block;
  font-weight: 700;
  font-size: 10px;
  padding: 1.5px 5px;
  border-radius: 4px;
}

.status-partial {
  color: #c084fc;
  font-weight: 800;
}

.status-open-beli {
  color: #10b981;
  font-weight: 700;
}

.status-open-jual {
  color: #ef4444;
  font-weight: 700;
}

/* Footer Live Bar */
.antrean-footer-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: #131d35;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10px;
  color: #64748b;
  font-family: var(--font-mono, monospace);
}

.antrean-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: obPulse 1.4s infinite;
}

/* Clickable Area Styling */
.ob-clickable-bid {
  cursor: pointer !important;
  transition: all 0.12s ease;
}

.ob-clickable-bid:hover {
  background: rgba(16, 185, 129, 0.18) !important;
  filter: brightness(1.25);
}

.ob-clickable-offer {
  cursor: pointer !important;
  transition: all 0.12s ease;
}

.ob-clickable-offer:hover {
  background: rgba(239, 68, 68, 0.18) !important;
  filter: brightness(1.25);
}

.ob-row-active-bid {
  background: rgba(16, 185, 129, 0.16) !important;
  outline: 1px solid rgba(16, 185, 129, 0.7);
}

.ob-row-active-offer {
  background: rgba(239, 68, 68, 0.16) !important;
  outline: 1px solid rgba(239, 68, 68, 0.7);
}

/* =======================================================
   ORDERBOOK MODAL - LIGHT THEME (MODE SIANG)
   ======================================================= */
body.theme-light .orderbook-modal-overlay {
  background: rgba(15, 23, 42, 0.45);
}

body.theme-light .orderbook-modal-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
  color: #0f172a;
}

body.theme-light .ob-modal-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

body.theme-light .ob-btn-close {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-weight: 800;
}

body.theme-light .ob-btn-close:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}

body.theme-light .ob-stats-strip {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

body.theme-light .ob-stat-cell {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

body.theme-light .ob-stat-lbl {
  color: #0f172a;
  font-weight: 800;
}

body.theme-light .ob-stat-val {
  color: #0f172a;
  font-weight: 900;
}

body.theme-light .ob-table-wrap {
  background: #ffffff;
}

body.theme-light .ob-table th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 900;
  border-bottom: 1px solid #cbd5e1;
}

body.theme-light .ob-table td {
  color: #0f172a;
  font-weight: 700;
  border-bottom: 1px solid #f1f5f9;
}

body.theme-light .ob-total-row {
  background: #f8fafc;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  color: #0f172a;
}

body.theme-light .antrean-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
  color: #0f172a;
}

body.theme-light .antrean-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

body.theme-light .antrean-title {
  color: #0f172a;
  font-weight: 900;
}

body.theme-light .antrean-sub {
  color: #0f172a;
  font-weight: 700;
}

body.theme-light .antrean-table th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 900;
  border-bottom: 1px solid #cbd5e1;
}

body.theme-light .antrean-table td {
  color: #0f172a;
  font-weight: 700;
  border-bottom: 1px solid #f1f5f9;
}

body.theme-light .antrean-footer-bar {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  color: #0f172a;
}
