/* ═══════════════════════════════════════════════════════════════════
   SIGNALS DRAWER - RUMUS & DOKUMENTASI ALGORITMA SCALPER IDX
   Smart Running Trade - Terminal Theme
   ═══════════════════════════════════════════════════════════════════ */

.signals-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.signals-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.signals-drawer {
  position: fixed;
  top: 0;
  right: 44px;
  bottom: 0;
  width: 840px;
  max-width: calc(100vw - 50px);
  background: rgba(11, 17, 33, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 999;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.75);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), width 0.2s ease;
}

.signals-drawer.expanded {
  width: calc(100vw - 50px) !important;
}

.signals-drawer.open {
  transform: translateX(0);
}

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

.signals-hdr-title {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.signals-hdr-sub {
  font-size: 9.5px;
  color: #94a3b8;
  font-family: var(--font-sans, sans-serif);
  margin-top: 2px;
}

.signals-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.signals-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.signals-expand-btn {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.signals-expand-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.6);
  color: #e0f2fe;
}

.sig-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Category Filter Bar */
.signals-tabs-bar {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  background: rgba(2, 6, 23, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
}

.signals-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.signals-tab-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.signals-tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

/* Scrollable Content Body */
.signals-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Group Card */
.sig-group-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 12px;
}

.sig-group-header {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #e2e8f0;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sig-group-count {
  font-size: 9px;
  color: #64748b;
  font-weight: 600;
}

/* Signal Item Row */
.sig-rule-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  transition: border-color 0.15s;
}

.sig-rule-item:last-child {
  margin-bottom: 0;
}

.sig-rule-item:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.sig-rule-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sig-code-label {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.sig-cat-tag {
  font-family: var(--font-mono, monospace);
  font-size: 8.5px;
  font-weight: 700;
  color: #64748b;
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 5px;
  border-radius: 3px;
}

.sig-formula-line {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px 6px;
  border-radius: 3px;
  border-left: 2px solid #38bdf8;
  word-break: break-all;
}

.sig-desc-line {
  font-size: 9.5px;
  color: #94a3b8;
  line-height: 1.35;
}

/* IDX Rules Table */
.idx-rules-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  margin-top: 6px;
}

.idx-rules-table th {
  background: rgba(15, 23, 42, 0.8);
  color: #94a3b8;
  font-weight: 700;
  text-align: left;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.idx-rules-table td {
  padding: 5px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
}

.idx-rules-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Color Pill Badges (Replaces Emojis) */
.sig-badge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.sig-badge-pill.red {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.sig-badge-pill.blue {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.sig-badge-pill.yellow {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.sig-badge-pill.green {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.sig-badge-pill.purple {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.12);
  border: 1px solid rgba(192, 132, 252, 0.3);
}
.sig-badge-pill.gray {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Broker Classification Cards */
.sig-broker-card {
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sig-broker-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.sig-broker-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sig-broker-title {
  font-family: var(--font-mono, monospace);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #f8fafc;
}
.sig-sub-tag {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 1.5px 6px;
  border-radius: 3px;
}
.sig-sub-tag.red {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.2);
}
.sig-sub-tag.blue {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.2);
}
.sig-sub-tag.yellow {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.2);
}
.sig-detail-row {
  display: grid;
  grid-template-columns: 85px 1fr;
  align-items: baseline;
  gap: 8px;
  font-size: 9.5px;
  line-height: 1.45;
}
.sig-detail-label {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: #64748b;
  font-size: 9px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.sig-detail-val {
  color: #cbd5e1;
  font-family: var(--font-mono, monospace);
}

/* Aligned Information Table / Rows */
.sig-info-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
}
.sig-info-table th {
  background: rgba(15, 23, 42, 0.7);
  color: #64748b;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}
.sig-info-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  color: #cbd5e1;
  line-height: 1.45;
}
.sig-info-table tr:last-child td {
  border-bottom: none;
}
.sig-info-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Ticker Preview Badge for Legend */
.sig-ticker-preview {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* =======================================================
   SIGNALS DRAWER - LIGHT THEME (MODE SIANG)
   ======================================================= */
body.theme-light .signals-drawer-backdrop {
  background: rgba(15, 23, 42, 0.45);
}

body.theme-light .signals-drawer {
  background: #ffffff;
  border-left: 1px solid #cbd5e1;
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.12);
  color: #0f172a;
}

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

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

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

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

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

body.theme-light .signals-tabs-bar {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

body.theme-light .signals-tab-btn {
  color: #0f172a;
  font-weight: 800;
  border-color: #cbd5e1;
  background: #ffffff;
}

body.theme-light .signals-tab-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

body.theme-light .signals-tab-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

body.theme-light .signals-drawer-body,
body.theme-light .signals-body {
  background: #f1f5f9;
  color: #0f172a;
}

body.theme-light .sig-group-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  color: #0f172a;
}

body.theme-light .sig-group-header {
  color: #0f172a;
  font-weight: 900;
  border-bottom: 1px solid #e2e8f0;
}

body.theme-light .sig-group-header span {
  color: #0f172a !important;
  font-weight: 900;
}

body.theme-light .sig-group-count {
  color: #0f172a;
  font-weight: 700;
}

body.theme-light .sig-rule-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

body.theme-light .sig-rule-item:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

body.theme-light .sig-rule-desc {
  color: #0f172a;
  font-weight: 700;
}

body.theme-light .sig-rule-cond {
  color: #0f172a;
  font-weight: 600;
}

body.theme-light .sig-table-responsive {
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

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

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

body.theme-light .sig-info-table tr:hover td {
  background: #f8fafc;
}

/* Ensure all text inside sig-group-card renders deep black */
body.theme-light .sig-group-card div,
body.theme-light .sig-group-card p {
  color: #0f172a;
}

body.theme-light .sig-group-card div[style*="color: #94a3b8"] {
  color: #0f172a !important;
  font-weight: 600;
}

body.theme-light .sig-info-table td {
  color: #0f172a !important;
  font-weight: 600;
}

.sig-ticker-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.sig-ticker-gradient {
  display: inline-block;
  font-weight: 900;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.5px;
}

body.theme-light .sig-ticker-badge {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

body.theme-light .sig-broker-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.theme-light .sig-broker-title {
  color: #0f172a !important;
  font-weight: 900;
}

body.theme-light .sig-detail-label {
  color: #0f172a !important;
  font-weight: 800;
}

body.theme-light .sig-detail-val {
  color: #0f172a !important;
  font-weight: 600;
}

body.theme-light .sig-sub-tag.red {
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

body.theme-light .sig-sub-tag.blue {
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
}

body.theme-light .sig-sub-tag.yellow {
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
}
