/* ═══════════════════════════════════════════════════════════════
   GLOBAL CORTEX — Alerta Pop-up Global
   Escopo fechado: .gortex-alert-overlay (não vaza para o resto da UI)
   ═══════════════════════════════════════════════════════════════ */
.gortex-alert-overlay {
  --ga-gold: #d4af37;
  --ga-gold-dim: rgba(212, 175, 55, 0.55);
  --ga-gold-dark: #8a7024;
  --ga-bg: rgba(0, 0, 0, 0.85);
  --ga-cyan: #00a8cc;
  --ga-cyan-dim: rgba(0, 168, 204, 0.55);
  --ga-cyan-border: rgba(0, 168, 204, 0.45);
  --ga-cyan-glow: rgba(0, 168, 204, 0.55);
  --ga-bear-fire: #e8a020;
  --ga-bear-red: rgba(220, 72, 58, 0.92);
  --ga-mono: var(--font-bloomberg);
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ga-mono);
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.gortex-alert-overlay *,
.gortex-alert-overlay *::before,
.gortex-alert-overlay *::after {
  box-sizing: border-box;
}

.gortex-alert-overlay.ih-hidden,
.gortex-alert-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gortex-alert-overlay:not(.ih-hidden):not(.hidden) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ── Backdrop: escurece + filtro ciano institucional ── */
.gortex-alert-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(1px) saturate(0.85);
  -webkit-backdrop-filter: blur(1px) saturate(0.85);
  transition: background 0.3s ease-in-out;
}

.gortex-alert-overlay:not(.ih-hidden):not(.hidden) .gortex-alert-overlay__backdrop {
  background:
    linear-gradient(180deg, rgba(0, 168, 204, 0.06) 0%, rgba(0, 0, 0, 0.58) 100%);
}

/* ── Painel central (2× escala) ── */
.gortex-alert-overlay__panel {
  position: relative;
  z-index: 1;
  width: min(840px, calc(100vw - 40px));
  background: var(--ga-bg);
  border: 1px solid var(--ga-cyan-border);
  box-shadow:
    0 0 0 1px rgba(0, 168, 204, 0.12),
    0 32px 80px rgba(0, 0, 0, 0.72);
  animation: ga-border-pulse 2.4s ease-in-out infinite;
  transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

@keyframes ga-border-pulse {
  0%, 100% {
    border-color: rgba(0, 168, 204, 0.38);
    box-shadow:
      0 0 0 1px rgba(0, 168, 204, 0.08),
      0 0 8px rgba(0, 168, 204, 0.14),
      0 32px 80px rgba(0, 0, 0, 0.72);
  }
  50% {
    border-color: rgba(0, 168, 204, 0.92);
    box-shadow:
      0 0 0 1px rgba(0, 168, 204, 0.22),
      0 0 14px rgba(0, 168, 204, 0.32),
      0 32px 80px rgba(0, 0, 0, 0.72);
  }
}

/* ── Cabeçalho ── */
.gortex-alert-overlay__hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 0 14px 0 18px;
  background: linear-gradient(90deg, rgba(0, 168, 204, 0.14) 0%, rgba(0, 168, 204, 0.04) 100%);
  border-bottom: 1px solid rgba(0, 168, 204, 0.42);
}

.gortex-alert-overlay__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--ga-gold);
}

.gortex-alert-overlay__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(0, 168, 204, 0.28);
  background: transparent;
  color: var(--ga-cyan-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease-in-out, background 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.gortex-alert-overlay__close:hover {
  color: var(--ga-cyan);
  border-color: rgba(0, 168, 204, 0.65);
  background: rgba(0, 168, 204, 0.1);
}

/* ── Corpo ── */
.gortex-alert-overlay__body {
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ── Mini-card montanha ── */
.gortex-alert-overlay__mini {
  border: 1px solid rgba(200, 136, 58, 0.28);
  background: #070707;
  transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.gortex-alert-overlay__mini-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0, 168, 204, 0.18);
}

.gortex-alert-overlay__sym {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--ga-gold);
}

.gortex-alert-overlay__tf {
  font-size: 10px;
  letter-spacing: 1px;
  color: rgba(212, 175, 55, 0.65);
  padding: 2px 8px;
  border: 1px solid rgba(0, 168, 204, 0.28);
}

.gortex-alert-overlay__badge {
  margin-left: auto;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 2px 7px;
  border: 1px solid rgba(200, 136, 58, 0.35);
  color: rgba(200, 136, 58, 0.85);
  transition: all 0.3s ease-in-out;
}

.gortex-alert-overlay__mountain {
  position: relative;
  height: 296px;
  min-height: 296px;
  overflow: hidden;
  background: #070707;
  cursor: default;
  flex: 1 1 auto;
  width: 100%;
}

.gortex-alert-overlay__mountain::after,
.gortex-alert-overlay .mtg-mountain::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.gortex-alert-overlay__loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: rgba(212, 175, 55, 0.45);
  background: #070707;
  transition: opacity 0.25s ease-in-out;
}

.gortex-alert-overlay__loading.ih-hidden,
.gortex-alert-overlay__loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.gortex-alert-overlay__chart-host {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 296px;
  transition: filter 0.3s ease-in-out;
}

.gortex-alert-overlay__chart-host canvas,
.gortex-alert-overlay__chart-host iframe {
  width: 100% !important;
  height: 100% !important;
}

/* ── Cross bullish (ignição ciano) ── */
.gortex-alert-overlay__mini.cross-bullish {
  border-color: rgba(0, 168, 204, 0.45);
  box-shadow: inset 0 0 0 1px rgba(0, 168, 204, 0.1);
}

.gortex-alert-overlay__mini.cross-bullish .gortex-alert-overlay__mountain::after,
.gortex-alert-overlay__mini.cross-bullish .mtg-mountain::after {
  opacity: 1;
  animation: ga-mountain-ignite-cyan 1.8s ease-in-out infinite;
  background: linear-gradient(
    180deg,
    rgba(0, 168, 204, 0.22) 0%,
    rgba(0, 168, 204, 0.06) 55%,
    transparent 100%
  );
}

.gortex-alert-overlay__mini.cross-bullish .gortex-alert-overlay__chart-host {
  filter: drop-shadow(0 0 6px rgba(0, 168, 204, 0.22));
}

.gortex-alert-overlay__mini.cross-bullish .gortex-alert-overlay__badge {
  color: var(--ga-cyan);
  border-color: rgba(0, 168, 204, 0.65);
  animation: ga-cross-pulse-cyan 1.6s ease-in-out infinite;
}

@keyframes ga-mountain-ignite-cyan {
  0%, 100% { opacity: 0.12; }
  50% { opacity: 0.3; }
}

@keyframes ga-cross-pulse-cyan {
  0%, 100% { box-shadow: 0 0 2px rgba(0, 168, 204, 0.2); }
  50% { box-shadow: 0 0 4px var(--ga-cyan-glow); }
}

/* ── Cross bearish (pulso âmbar/vermelho) ── */
.gortex-alert-overlay__mini.cross-bearish {
  border-color: rgba(232, 160, 32, 0.48);
  box-shadow: inset 0 0 0 1px rgba(220, 72, 58, 0.12);
}

.gortex-alert-overlay__mini.cross-bearish .gortex-alert-overlay__mountain::after,
.gortex-alert-overlay__mini.cross-bearish .mtg-mountain::after {
  opacity: 1;
  animation: ga-mountain-pulse-bear 1.5s ease-in-out infinite;
  background: linear-gradient(
    180deg,
    rgba(232, 160, 32, 0.2) 0%,
    rgba(220, 72, 58, 0.1) 55%,
    transparent 100%
  );
}

.gortex-alert-overlay__mini.cross-bearish .gortex-alert-overlay__chart-host {
  filter: drop-shadow(0 0 6px rgba(220, 72, 58, 0.2));
}

.gortex-alert-overlay__mini.cross-bearish .gortex-alert-overlay__badge {
  color: var(--ga-bear-fire);
  border-color: rgba(220, 72, 58, 0.55);
  animation: ga-cross-pulse-bear 1.4s ease-in-out infinite;
}

@keyframes ga-mountain-pulse-bear {
  0%, 100% { opacity: 0.14; }
  50% { opacity: 0.34; }
}

@keyframes ga-cross-pulse-bear {
  0%, 100% { box-shadow: 0 0 2px rgba(232, 160, 32, 0.25); }
  50% { box-shadow: 0 0 4px rgba(220, 72, 58, 0.65); }
}

/* ── Texto de alerta ── */
.gortex-alert-overlay__msg {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  text-align: center;
  color: var(--ga-gold);
  animation: ga-msg-blink 2.8s ease-in-out infinite;
}

@keyframes ga-msg-blink {
  0%, 100% { opacity: 1; color: var(--ga-gold); }
  50% { opacity: 0.62; color: rgba(212, 175, 55, 0.72); }
}

/* ── Botão de ação — moldura ciano, texto âmbar ── */
.gortex-alert-overlay__action {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid rgba(0, 168, 204, 0.55);
  background: linear-gradient(180deg, rgba(0, 88, 108, 0.72) 0%, rgba(0, 48, 58, 0.85) 100%);
  color: var(--ga-gold);
  font-family: var(--ga-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

.gortex-alert-overlay__action:hover {
  background: linear-gradient(180deg, rgba(0, 168, 204, 0.28) 0%, rgba(0, 88, 108, 0.72) 100%);
  border-color: rgba(0, 168, 204, 0.85);
  box-shadow: 0 0 12px rgba(0, 168, 204, 0.22);
}

.gortex-alert-overlay__action:active {
  transform: translateY(1px);
}

/* Fila pendente (indicador discreto no canto do painel) */
.gortex-alert-overlay__queue {
  position: absolute;
  top: 6px;
  right: 36px;
  font-size: 8px;
  letter-spacing: 0.8px;
  color: rgba(212, 175, 55, 0.45);
  pointer-events: none;
}

.gortex-alert-overlay__queue:empty {
  display: none;
}
