/* === SCANNER PAGE === */
.scanner-main {
  padding: 100px 24px 60px;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Nav status dot */
.status-dot-sm {
  width: 6px; height: 6px;
  background: var(--lime);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.status-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--lime);
  letter-spacing: 1px;
}

/* Opportunity Banner */
.opp-banner {
  background: linear-gradient(90deg, rgba(132, 241, 28, 0.15), rgba(132, 241, 28, 0.08));
  border: 1px solid rgba(132, 241, 28, 0.4);
  border-radius: 12px;
  padding: 16px 24px;
  animation: opp-flash 2s ease-in-out infinite;
}

.opp-banner.hidden { display: none; }

.opp-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.opp-pulse {
  width: 10px; height: 10px;
  background: var(--lime);
  border-radius: 50%;
  animation: pulse 0.8s infinite;
  flex-shrink: 0;
}

.opp-icon { font-size: 18px; }

.opp-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--lime);
}

@keyframes opp-flash {
  0%, 100% { box-shadow: 0 0 20px rgba(132, 241, 28, 0.2); }
  50% { box-shadow: 0 0 40px rgba(132, 241, 28, 0.5); }
}

/* Ticker */
.ticker-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.ticker-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.ticker-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--lime);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ticker-updated {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
}

.ticker-cards {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.ticker-card {
  flex: 1;
  padding: 20px;
  background: rgba(10, 22, 40, 0.5);
}

.ticker-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.dex-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ticker-chain-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  color: var(--lime);
  background: var(--lime-dim);
  padding: 2px 6px;
  border-radius: 4px;
}

.ticker-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--white);
  letter-spacing: -1px;
  margin-bottom: 8px;
  transition: color 0.3s;
}

.ticker-price.updating { color: var(--cyan); }

.ticker-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.meta-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.meta-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
}

.ticker-vs {
  width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: rgba(15, 31, 58, 0.5);
}

.gap-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(10, 22, 40, 0.8);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.gap-badge.hot {
  background: rgba(132, 241, 28, 0.1);
  border-color: rgba(132, 241, 28, 0.4);
}

.gap-arrow {
  font-size: 14px;
  color: var(--text-dim);
}

.gap-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dim);
  transition: color 0.3s;
}

.gap-num.hot { color: var(--lime); }

.vs-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Direction */
.direction-row {
  margin-top: 16px;
  min-height: 36px;
}

.dir-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  animation: slide-in 0.3s ease-out;
}

.dir-indicator.hidden { display: none; }

.dir-arrow { font-size: 14px; }
.dir-arrow.up { color: var(--lime); }
.dir-arrow.down { color: var(--magenta); }

.dir-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
}

.dir-text.dim { color: var(--text-dim); }

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Controls */
.controls-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mode-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.3s;
  user-select: none;
}

.mode-toggle:hover { border-color: rgba(132, 241, 28, 0.3); }

.mode-track {
  width: 44px; height: 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 100px;
  position: relative;
  transition: background 0.3s;
  flex-shrink: 0;
}

.mode-track.live {
  background: rgba(132, 241, 28, 0.2);
  border-color: var(--lime);
}

.mode-thumb {
  position: absolute;
  width: 18px; height: 18px;
  background: var(--text-dim);
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: all 0.3s;
}

.mode-thumb.live {
  background: var(--lime);
  left: 22px;
}

.mode-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  display: block;
}

.mode-desc {
  font-size: 11px;
  color: var(--text-dim);
  display: block;
  margin-top: 2px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-card-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-card-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
}

.stat-card-val.lime { color: var(--lime); }

/* History Table */
.history-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.history-header {
  margin-bottom: 16px;
}

.history-table-wrap {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.history-table td {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text);
  padding: 10px 12px;
  border-bottom: 1px solid rgba(26, 45, 74, 0.5);
}

.history-table tr:last-child td { border-bottom: none; }

.history-table tr:hover td { background: rgba(132, 241, 28, 0.03); }

.gap-cell {
  font-weight: 700;
}

.gap-cell.hot { color: var(--lime); }

.dir-cell {
  font-size: 11px;
  font-weight: 600;
}

.dir-cell.long { color: var(--lime); }
.dir-cell.short { color: var(--cyan); }

/* Mode disclaimer */
.mode-disclaimer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(10, 22, 40, 0.5);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-dim);
}

.disc-icon { font-size: 14px; }

/* === SETTINGS BUTTON (navbar) === */
.settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 8px;
  flex-shrink: 0;
}
.settings-btn:hover {
  border-color: rgba(132, 241, 28, 0.4);
  color: var(--lime);
}
.settings-btn:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

/* === SETTINGS MODAL === */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
}
.settings-overlay.open { display: block; }

.settings-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid rgba(132, 241, 28, 0.2);
  border-radius: 20px;
  z-index: 201;
  display: none;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(132, 241, 28, 0.08), 0 40px 80px rgba(0,0,0,0.6);
  transition: transform 0.25s ease, opacity 0.25s ease;
  opacity: 0;
}
.settings-modal.open {
  display: flex;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.settings-modal.hidden { display: none; }

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
}

.settings-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.settings-close {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
}
.settings-close:hover { border-color: var(--magenta); color: var(--magenta); }

/* === SECTIONS === */
.settings-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.settings-section:last-child { border-bottom: none; }

.section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--lime);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.per-trade-tag {
  font-size: 9px;
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: none;
}

/* === WALLET SECTION === */
.connect-wallet-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: rgba(132, 241, 28, 0.08);
  border: 1px solid rgba(132, 241, 28, 0.3);
  border-radius: 12px;
  color: var(--lime);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}
.connect-wallet-btn:hover {
  background: rgba(132, 241, 28, 0.15);
  border-color: var(--lime);
  transform: translateY(-1px);
}
.connect-wallet-btn:active { transform: translateY(0); }

.wallet-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 8px;
  text-align: center;
}

.wallet-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
}

.wallet-icon-wrap {
  width: 36px; height: 36px;
  background: var(--lime-dim);
  border: 1px solid rgba(132, 241, 28, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lime);
  flex-shrink: 0;
}

.wallet-info { flex: 1; min-width: 0; }

.wallet-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--lime);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 2px;
}

.wallet-address {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-disconnect-btn {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid rgba(255, 45, 120, 0.3);
  border-radius: 8px;
  color: var(--magenta);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.wallet-disconnect-btn:hover {
  background: rgba(255, 45, 120, 0.1);
  border-color: var(--magenta);
}

.wallet-balance-row,
.wallet-network-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}

.balance-label-text,
.stake-balance-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.balance-value-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
}

.network-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--lime);
  background: var(--lime-dim);
  border: 1px solid rgba(132, 241, 28, 0.2);
  padding: 3px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.no-provider-msg {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}
.no-provider-msg a {
  color: var(--lime);
  text-decoration: none;
}
.no-provider-msg a:hover { text-decoration: underline; }

.wallet-cta-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(10, 22, 40, 0.5);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
}

/* === EXECUTION MODE TOGGLE === */
.exec-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.exec-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  min-width: 50px;
  transition: color 0.3s;
}
.exec-label.live { color: var(--lime); }

.exec-sublabel {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
}

.exec-track {
  width: 48px; height: 26px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 100px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
  flex-shrink: 0;
}
.exec-track.live {
  background: rgba(132, 241, 28, 0.2);
  border-color: var(--lime);
}

.exec-thumb {
  position: absolute;
  width: 20px; height: 20px;
  background: var(--text-dim);
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: all 0.3s;
}
.exec-thumb.live {
  background: var(--lime);
  left: 24px;
}

.exec-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(255, 45, 120, 0.06);
  border: 1px solid rgba(255, 45, 120, 0.2);
  border-radius: 8px;
  font-size: 11px;
  color: var(--magenta);
  font-family: 'JetBrains Mono', monospace;
}
.exec-warning.hidden { display: none; }

/* === STAKE AMOUNT === */
.stake-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.stake-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--white);
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  outline: none;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}
.stake-input::-webkit-outer-spin-button,
.stake-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stake-input:focus { border-color: rgba(132, 241, 28, 0.5); }
.stake-input.error { border-color: var(--magenta); }

.stake-currency {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--lime);
  background: var(--lime-dim);
  border: 1px solid rgba(132, 241, 28, 0.2);
  padding: 6px 12px;
  border-radius: 8px;
  flex-shrink: 0;
}

.stake-range-row { margin-bottom: 8px; }

.stake-slider {
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: var(--surface2);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.stake-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: var(--lime);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(132, 241, 28, 0.5);
}
.stake-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--lime);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.stake-limits {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stake-min-label,
.stake-max-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
}

.stake-balance-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
}

.stake-error {
  font-size: 11px;
  color: var(--magenta);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 6px;
}
.stake-error.hidden { display: none; }

/* === ALERT THRESHOLD === */
.threshold-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.threshold-label-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}

.threshold-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
}

.threshold-prefix {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--lime);
}

.threshold-input {
  width: 60px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  -moz-appearance: textfield;
}
.threshold-input::-webkit-outer-spin-button,
.threshold-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.threshold-note {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .scanner-main { padding: 90px 16px 40px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .ticker-cards { flex-direction: column; }
  .ticker-vs { width: 100%; flex-direction: row; border-left: none; border-right: none; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 12px 0; }
  .gap-badge { flex: 1; justify-content: center; }
  .controls-row { flex-direction: column; align-items: stretch; }
  .mode-toggle { justify-content: flex-start; }
  .settings-modal { width: calc(100vw - 16px); max-height: calc(100vh - 40px); }
  .settings-section { padding: 16px 20px; }
  .threshold-row { flex-direction: column; align-items: flex-start; gap: 6px; }
}