/* Economic Calendar popup controls v5.
   Final mobile UX guard: one pure-CSS close icon and alert form collapsed by default. */

/* The close button owns the only visible X. Hide every legacy child/icon/text
   and draw the cross directly on the button so older SVG rules cannot create
   a second nested square/X. */
.ec-popup-topbar .ec-drawer-close {
  position: relative !important;
  display: inline-grid !important;
  place-items: center !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(148, 163, 184, .14) !important;
  border-radius: 12px !important;
  color: #8f9aa7 !important;
  background: rgba(255, 255, 255, .018) !important;
  box-shadow: none !important;
  font-size: 0 !important;
  line-height: 0 !important;
}

.ec-popup-topbar .ec-drawer-close > * {
  display: none !important;
  visibility: hidden !important;
}

.ec-popup-topbar .ec-drawer-close::before,
.ec-popup-topbar .ec-drawer-close::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 16px !important;
  height: 1.8px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: currentColor !important;
  box-shadow: none !important;
  pointer-events: none !important;
  transform-origin: center !important;
}

.ec-popup-topbar .ec-drawer-close::before {
  transform: translate(-50%, -50%) rotate(45deg) !important;
}

.ec-popup-topbar .ec-drawer-close::after {
  transform: translate(-50%, -50%) rotate(-45deg) !important;
}

.ec-popup-topbar .ec-drawer-close:hover,
.ec-popup-topbar .ec-drawer-close:focus-visible {
  color: #f4d76b !important;
  border-color: rgba(244, 190, 24, .30) !important;
  background: rgba(244, 190, 24, .055) !important;
}

/* Alert form is intentionally absent at first impact. It is mounted by the
   existing alert controller but remains invisible until the top bell asks for it. */
.ec-drawer-alert-panel {
  display: none !important;
}

.ec-drawer-alert-panel.is-user-open {
  display: block !important;
  animation: ecAlertFormReveal .24s cubic-bezier(.2, .8, .2, 1) both !important;
}

.ec-popup-quick-alert[aria-expanded="true"] {
  border-color: rgba(244, 190, 24, .38) !important;
  background: rgba(244, 190, 24, .075) !important;
  box-shadow: 0 8px 22px rgba(244, 190, 24, .07) !important;
}

.ec-popup-quick-alert[aria-expanded="true"]::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: 1px;
  border-radius: 50%;
  background: #f4be18;
  box-shadow: 0 0 8px rgba(244, 190, 24, .65);
}

@keyframes ecAlertFormReveal {
  from {
    opacity: 0;
    transform: translateY(-7px) scale(.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 760px) {
  .ec-popup-topbar .ec-drawer-close {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  .ec-popup-topbar .ec-drawer-close::before,
  .ec-popup-topbar .ec-drawer-close::after {
    width: 17px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ec-drawer-alert-panel.is-user-open {
    animation: none !important;
  }
}
