/* ==========================================================================
   BBLN Pro - AI Robot Trader & Chart HUD Overlay (Cyberpunk / Quant Theme)
   ========================================================================== */

/* 1. Topbar Button in Trading Room */
.btn-topbar-ai-robot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.15) 0%, rgba(131, 56, 236, 0.15) 100%);
  border: 1px solid rgba(0, 180, 216, 0.5);
  color: #00B4D8;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 14px rgba(0, 180, 216, 0.2);
  user-select: none;
}

.btn-topbar-ai-robot:hover {
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.3) 0%, rgba(131, 56, 236, 0.3) 100%);
  border-color: #00B4D8;
  color: #FFFFFF;
  box-shadow: 0 0 20px rgba(0, 180, 216, 0.45);
  transform: translateY(-1px);
}

.btn-topbar-ai-robot:active {
  transform: translateY(1px);
}

.ai-robot-glow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00B4D8;
  box-shadow: 0 0 8px #00B4D8;
  animation: pulse-robot-dot 1.6s infinite ease-in-out;
}

@keyframes pulse-robot-dot {
  0% { transform: scale(0.85); opacity: 0.6; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0.6; }
}

.badge-ai-vip {
  background: linear-gradient(135deg, #F0B90B 0%, #D97706 100%);
  color: #000;
  font-size: 9.5px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* 2. Chart Cockpit Footer - Sits underneath the chart canvas, 100% unobstructive */
.ai-chart-hud-overlay {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: #0B0E17;
  border-top: 1px solid rgba(0, 180, 216, 0.35);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  overflow: hidden;
}

/* Integrated topbar inside footer cockpit */
.ai-hud-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 5px 12px;
  pointer-events: auto;
}

.ai-hud-badge-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-hud-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #00B4D8;
  box-shadow: 0 0 10px #00B4D8;
  animation: pulse-robot-dot 1.2s infinite;
}

.ai-hud-setup-title {
  font-size: 12px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.3px;
}

.ai-hud-rr-badge {
  background: rgba(240, 185, 11, 0.15);
  border: 1px solid rgba(240, 185, 11, 0.4);
  color: #F0B90B;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.ai-hud-prob-badge {
  background: rgba(14, 203, 129, 0.15);
  border: 1px solid rgba(14, 203, 129, 0.4);
  color: #0ECB81;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.ai-hud-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-hud-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #E2E8F0;
  padding: 5px 11px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-hud-action.glow-cyan {
  border-color: rgba(0, 180, 216, 0.4);
  color: #00B4D8;
}
.btn-hud-action.glow-cyan:hover {
  background: rgba(0, 180, 216, 0.2);
  border-color: #00B4D8;
  color: #FFFFFF;
}

.btn-hud-action.glow-gold {
  background: rgba(240, 185, 11, 0.15);
  border-color: rgba(240, 185, 11, 0.5);
  color: #F0B90B;
}
.btn-hud-action.glow-gold:hover {
  background: #F0B90B;
  color: #000;
}

.btn-hud-close {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
}
.btn-hud-close:hover {
  color: #F6465D;
}

/* 2.1 Cockpit Target Cards & Telemetry Strip (Docked at Chart Footer) */
.ai-hud-cockpit-panel {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 7px 12px 9px 12px;
  margin: 0;
  pointer-events: auto;
  animation: hud-slide-up 0.25s ease-out;
}

@keyframes hud-slide-up {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.ai-hud-pill.rsi {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #EF4444;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}
.ai-hud-pill.rsi.neutral {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60A5FA;
}
.ai-hud-pill.rsi.oversold {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10B981;
}

.ai-hud-targets-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

@media (max-width: 768px) {
  .ai-hud-targets-strip {
    grid-template-columns: 1fr;
  }
}

.hud-target-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.hud-target-card.tp {
  border-color: rgba(14, 203, 129, 0.35);
  background: linear-gradient(180deg, rgba(14, 203, 129, 0.08) 0%, rgba(14, 203, 129, 0.02) 100%);
}
.hud-target-card.entry {
  border-color: rgba(0, 180, 216, 0.35);
  background: linear-gradient(180deg, rgba(0, 180, 216, 0.08) 0%, rgba(0, 180, 216, 0.02) 100%);
}
.hud-target-card.sl {
  border-color: rgba(246, 70, 93, 0.35);
  background: linear-gradient(180deg, rgba(246, 70, 93, 0.08) 0%, rgba(246, 70, 93, 0.02) 100%);
}

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

.target-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.target-dot.green { background: #0ECB81; box-shadow: 0 0 6px #0ECB81; }
.target-dot.cyan { background: #00B4D8; box-shadow: 0 0 6px #00B4D8; }
.target-dot.red { background: #F6465D; box-shadow: 0 0 6px #F6465D; }

.target-title {
  font-size: 10px;
  font-weight: 800;
  color: #94A3B8;
  letter-spacing: 0.3px;
  flex: 1;
}

.target-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 3px;
}
.target-badge.green {
  background: rgba(14, 203, 129, 0.2);
  color: #0ECB81;
  border: 1px solid rgba(14, 203, 129, 0.4);
}
.target-badge.cyan {
  background: rgba(0, 180, 216, 0.2);
  color: #00B4D8;
  border: 1px solid rgba(0, 180, 216, 0.4);
}
.target-badge.red {
  background: rgba(246, 70, 93, 0.2);
  color: #F6465D;
  border: 1px solid rgba(246, 70, 93, 0.4);
}

.target-card-price {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.target-card-sub {
  font-size: 10px;
  color: #94A3B8;
}

/* 3. AI Robot Modal Dialog */
.ai-modal-dialog {
  background: #111625;
  border: 1px solid rgba(0, 180, 216, 0.4);
  border-radius: 12px;
  width: 95%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 32px rgba(0, 180, 216, 0.2);
  animation: modal-zoom-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-zoom-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.ai-modal-header {
  padding: 16px 20px;
  background: rgba(17, 22, 37, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-modal-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #00B4D8 0%, #8338EC 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  box-shadow: 0 0 16px rgba(0, 180, 216, 0.5);
}

.ai-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Scanning radar view */
.ai-scanning-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  gap: 16px;
}

.radar-spinner {
  width: 64px;
  height: 64px;
  border: 3px solid rgba(0, 180, 216, 0.2);
  border-top-color: #00B4D8;
  border-right-color: #8338EC;
  border-radius: 50%;
  animation: spin-radar 0.8s linear infinite;
  box-shadow: 0 0 20px rgba(0, 180, 216, 0.4);
}

@keyframes spin-radar {
  to { transform: rotate(360deg); }
}

/* 3 Price Level Cards (Take Profit, Entry, Stop Loss) */
.ai-levels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.ai-level-card {
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-level-card.entry {
  background: rgba(0, 180, 216, 0.08);
  border-color: rgba(0, 180, 216, 0.35);
}

.ai-level-card.tp {
  background: rgba(14, 203, 129, 0.08);
  border-color: rgba(14, 203, 129, 0.35);
}

.ai-level-card.sl {
  background: rgba(246, 70, 93, 0.08);
  border-color: rgba(246, 70, 93, 0.35);
}

.ai-level-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.ai-level-card.entry .ai-level-label { color: #00B4D8; }
.ai-level-card.tp .ai-level-label { color: #0ECB81; }
.ai-level-card.sl .ai-level-label { color: #F6465D; }

.ai-level-price {
  font-size: 18px;
  font-weight: 800;
}
.ai-level-card.entry .ai-level-price { color: #FFFFFF; }
.ai-level-card.tp .ai-level-price { color: #0ECB81; }
.ai-level-card.sl .ai-level-price { color: #F6465D; }

.ai-level-sub {
  font-size: 11px;
  color: #94A3B8;
}

/* Monte Carlo Stats Strip */
.ai-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.ai-stat-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ai-stat-label {
  font-size: 10.5px;
  color: #94A3B8;
  font-weight: 600;
}

.ai-stat-val {
  font-size: 15px;
  font-weight: 800;
}

/* Rationale Container */
.ai-rationale-card {
  background: rgba(17, 22, 37, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
}

.badge-direction {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}
.badge-direction.up {
  background: rgba(14, 203, 129, 0.15);
  color: #0ECB81;
  border: 1px solid rgba(14, 203, 129, 0.4);
}
.badge-direction.down {
  background: rgba(246, 70, 93, 0.15);
  color: #F6465D;
  border: 1px solid rgba(246, 70, 93, 0.4);
}
