/* ============================================================
   AI TURBO TRADE — PRICE ALERTS WIDGET
   Floating bell + panel injected by js/price-alerts.js.
   ============================================================ */

/* Bottom-LEFT, clear of the 100px terminal sidebar, so it never
   overlaps the trade panel that slides in from the right. */
#pa-bell {
  position: fixed;
  left: 116px;
  bottom: 20px;
  z-index: 1500;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(18, 21, 29, 0.95);
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
#pa-bell:hover {
  transform: translateY(-3px);
  border-color: #00e5ff;
}
#pa-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #00e5ff, #0077ff);
  color: #06121c;
  font-size: 12px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

#pa-panel {
  position: fixed;
  left: 116px;
  bottom: 84px;
  z-index: 1500;
  width: 330px;
  max-width: calc(100vw - 44px);
  background: #12151d;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
#pa-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#pa-panel .pa-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 229, 255, 0.05);
}
#pa-panel .pa-close {
  background: none;
  border: none;
  color: #8f94a8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
#pa-panel .pa-close:hover { color: #ffffff; }

#pa-panel .pa-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px 16px 6px;
}
#pa-panel .pa-form input,
#pa-panel .pa-form select {
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 13, 20, 0.7);
  color: #ffffff;
  font-size: 13.5px;
  font-family: inherit;
}
#pa-panel .pa-form input:focus,
#pa-panel .pa-form select:focus {
  outline: none;
  border-color: #00e5ff;
}
#pa-panel .pa-form select option {
  background: #12151d;
}
#pa-panel #pa-add {
  border: none;
  border-radius: 8px;
  background: linear-gradient(90deg, #00e5ff, #0077ff);
  color: #06121c;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}
#pa-panel #pa-add:hover { filter: brightness(1.12); }

#pa-panel .pa-note {
  padding: 4px 16px 0;
  font-size: 12px;
  color: #7e849b;
  min-height: 16px;
}
#pa-panel .pa-note.err { color: #ff3b6b; }

#pa-panel ul {
  list-style: none;
  margin: 10px 0 0;
  padding: 0 8px 10px;
  max-height: 220px;
  overflow-y: auto;
}
#pa-panel li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #dfe3f0;
  font-size: 13.5px;
}
#pa-panel li:hover { background: rgba(255, 255, 255, 0.04); }
#pa-panel li strong { color: #00e5ff; font-weight: 600; }
#pa-panel .pa-del {
  background: none;
  border: none;
  color: #8f94a8;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
#pa-panel .pa-del:hover { color: #ff3b6b; }
#pa-panel .pa-empty {
  color: #7e849b;
  font-size: 12.5px;
  cursor: default;
}
#pa-panel .pa-empty:hover { background: none; }

.pa-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  z-index: 3000;
  max-width: min(480px, calc(100vw - 40px));
  background: #12151d;
  border: 1px solid rgba(0, 229, 255, 0.4);
  border-radius: 12px;
  color: #ffffff;
  font-size: 14px;
  padding: 13px 20px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.pa-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* While a trade panel is open (body.panel-open is toggled by the
   FX terminal), get out of the way completely. */
body.panel-open #pa-bell,
body.panel-open #pa-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 600px) {
  #pa-bell { left: 14px; bottom: 76px; width: 46px; height: 46px; font-size: 19px; }
  #pa-panel { left: 14px; bottom: 132px; }
}

@media (prefers-reduced-motion: reduce) {
  #pa-bell, #pa-panel, .pa-toast { transition: none; }
}
