/* ==============================================================================
   Algo Alpha - Scanner Layout, Cards, Custom Pills & Webhook Modals (css/scanner.css)
   ============================================================================== */

/* Scanner Layout & Responsive Card Rules */
.scanner-card {
  background: var(--card-bg, #131722);
  border: 1px solid var(--border, #1f232d);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.scanner-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 6px;
}

.scanner-card-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary, #e0e3eb);
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  white-space: nowrap;
  min-width: 0;
}

.scanner-card-subtitle {
  font-size: 11px;
  color: var(--text-secondary, #787b86);
  margin-top: -4px;
  margin-bottom: 10px;
  line-height: 1.35;
}

/* Custom App-Native Strategy Selector Button */
.custom-strategy-btn {
  width: 100%;
  background: var(--input-bg, #181c27);
  border: 1px solid var(--sub-border, #2a2e39);
  color: var(--text-primary, #f1f5f9);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  margin-bottom: 10px;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.custom-strategy-btn:active {
  transform: scale(0.98);
  border-color: var(--accent, #2962ff);
}

/* App-Native Choice Pill Groups (No OS Native Select Popups) */
.choice-pill-group {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.choice-pill {
  background: var(--input-bg, #181c27);
  border: 1px solid var(--sub-border, #2a2e39);
  color: var(--text-secondary, #94a3b8);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.choice-pill:active {
  transform: scale(0.95);
}

.choice-pill.active {
  background: rgba(41, 98, 255, 0.18);
  border-color: #2962ff;
  color: #60a5fa;
  box-shadow: 0 0 0 1px rgba(41, 98, 255, 0.2);
}

.choice-pill.purple.active {
  background: rgba(168, 85, 247, 0.2);
  border-color: #a855f7;
  color: #c084fc;
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.2);
}

.choice-pill.green.active {
  background: rgba(8, 153, 129, 0.2);
  border-color: #089981;
  color: #34d399;
}

/* Condition Row */
.condition-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.condition-row {
  background: var(--input-bg, #181c27);
  border: 1px solid var(--sub-border, #232733);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  flex-wrap: wrap;
}

.condition-expr {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  line-height: 1.45;
}

.cond-offset {
  color: #60a5fa;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
}

.cond-tf {
  color: var(--text-secondary, #94a3b8);
  font-weight: 600;
}

.cond-field {
  color: var(--text-primary, #f1f5f9);
  font-weight: 800;
}

.cond-comp {
  color: #c084fc;
  font-weight: 800;
}

.cond-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.cond-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary, #787b86);
  cursor: pointer;
  font-size: 12px;
  padding: 3px 5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.cond-btn:hover {
  color: #60a5fa;
  background: rgba(41, 98, 255, 0.12);
}

.cond-btn.active-toggle {
  color: #089981;
}

.cond-btn.delete-btn:hover {
  color: #f23645;
  background: rgba(242, 54, 69, 0.12);
}

/* Counter Control (- 1 +) */
.counter-control {
  display: flex;
  align-items: center;
  background: var(--input-bg, #181c27);
  border: 1px solid var(--sub-border, #2a2e39);
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  height: 36px;
  box-sizing: border-box;
}

.counter-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary, #94a3b8);
  font-size: 16px;
  font-weight: 700;
  width: 36px;
  height: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.counter-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.counter-val {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary, #f1f5f9);
  font-family: 'JetBrains Mono', monospace;
}

/* Delivery Checklist */
.delivery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}

.delivery-item {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--input-bg, #181c27);
  border: 1px solid var(--sub-border, #232733);
  border-radius: 8px;
  padding: 7px 9px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary, #e0e3eb);
}

.delivery-item input[type="checkbox"] {
  accent-color: #a855f7;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Webhook Box & Payload Editor */
.json-preview-box {
  background: #090c12;
  border: 1px solid #1a1e29;
  border-radius: 10px;
  padding: 12px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11px;
  color: #e0e3eb;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 10px;
}

.json-key {
  color: #c084fc;
  font-weight: 700;
}

.json-str {
  color: #38bdf8;
}

.json-num {
  color: #f59e0b;
}

/* Action Buttons */
.btn-purple {
  background: #8b5cf6;
  color: #ffffff;
  border: none;
  font-weight: 800;
  font-size: 12.5px;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-purple:hover {
  background: #7c3aed;
}

.btn-outline-purple {
  background: rgba(139, 92, 246, 0.12);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.35);
  font-weight: 700;
  font-size: 11.5px;
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-outline-purple:hover {
  background: rgba(139, 92, 246, 0.22);
}

.trade-quick-btn {
  background: rgba(8, 153, 129, 0.16);
  border: 1px solid rgba(8, 153, 129, 0.4);
  color: #089981;
  font-weight: 800;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.trade-quick-btn:hover {
  background: #089981;
  color: #ffffff;
}

.symbol-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--input-bg, #181c27);
  border: 1px solid var(--sub-border, #2a2e39);
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
}

.symbol-pill-tag .remove-sym {
  cursor: pointer;
  color: var(--text-secondary, #787b86);
  font-size: 12px;
  line-height: 1;
}

.symbol-pill-tag .remove-sym:hover {
  color: #f23645;
}

/* Strategy Item in Sheet */
.strategy-sheet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--input-bg, #181c27);
  border: 1px solid var(--sub-border, #2a2e39);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 8px;
}

.strategy-sheet-item.active {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.12);
}
