/* Final Economic Calendar polish: filter icon + event popup. Scoped to calendar only. */

/* The generic .ec-filter-command-copy span rule was overriding the icon span. */
.ec-filter-command-copy > .ec-filter-icon {
  position: relative;
  display: grid !important;
  place-items: center !important;
  flex: 0 0 38px;
  width: 38px !important;
  height: 38px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid rgba(244, 190, 24, .22);
  border-radius: 12px;
  color: #f0c744 !important;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 220, 88, .14), transparent 55%),
    rgba(244, 190, 24, .055);
  box-shadow: inset 0 1px rgba(255,255,255,.035), 0 8px 22px rgba(0,0,0,.14);
}

.ec-filter-command-copy > .ec-filter-icon::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(244,190,24,.07);
  border-radius: 9px;
  pointer-events: none;
}

.ec-filter-command-copy > .ec-filter-icon svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 18px;
  height: 18px;
  margin: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Popup backdrop */
.ec-event-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 54;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(244,190,24,.055), transparent 30rem),
    rgba(2, 5, 9, .72);
  backdrop-filter: blur(9px) saturate(115%);
  transition: opacity .26s ease, visibility .26s ease;
}

.ec-event-popup-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.ec-event-popup-open {
  overflow: hidden;
}

/* Convert old side drawer into a premium centered popup on desktop. */
.ec-drawer {
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  width: min(760px, calc(100vw - 42px)) !important;
  max-width: 760px !important;
  height: min(86vh, 820px) !important;
  max-height: 820px;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,.16) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(520px 220px at 12% -12%, rgba(244,190,24,.10), transparent 70%),
    linear-gradient(155deg, rgba(14,20,30,.985), rgba(6,10,16,.985)) !important;
  box-shadow:
    0 40px 120px rgba(0,0,0,.64),
    0 0 0 1px rgba(255,255,255,.018) inset,
    0 1px rgba(255,255,255,.035) inset !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -48%) scale(.965) !important;
  transition: opacity .25s ease, transform .30s cubic-bezier(.2,.8,.2,1), visibility .25s ease !important;
}

.ec-drawer.open {
  right: auto !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1) !important;
}

.ec-drawer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  z-index: 4;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244,190,24,.62), transparent);
  pointer-events: none;
}

.ec-drawer-close {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 58px !important;
  padding: 0 20px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(148,163,184,.09) !important;
  color: #7f8c9b !important;
  background: rgba(255,255,255,.012) !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: .045em;
  cursor: pointer;
}

.ec-drawer-close:hover {
  color: #eef2f6 !important;
  background: rgba(255,255,255,.025) !important;
}

.ec-drawer-close svg {
  width: 19px;
  height: 19px;
  padding: 3px;
  border: 1px solid rgba(148,163,184,.12);
  border-radius: 7px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.ec-drawer-content {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 24px 26px 30px !important;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.ec-drawer-content::-webkit-scrollbar {
  width: 8px;
}

.ec-drawer-content::-webkit-scrollbar-track {
  background: transparent;
}

.ec-drawer-content::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(244,190,24,.22);
  background-clip: padding-box;
}

.ec-popup-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  color: #bf9a2f;
  font-size: 8px;
  font-weight: 860;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.ec-popup-eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: linear-gradient(90deg, #f4be18, transparent);
}

.ec-drawer-content > h3 {
  max-width: 610px;
  margin: 0 0 18px !important;
  color: #f7f9fb !important;
  font-size: clamp(25px, 3.2vw, 38px) !important;
  line-height: 1.04 !important;
  letter-spacing: -.04em !important;
  font-weight: 820 !important;
}

/* Make raw detail paragraphs read like a compact professional terminal grid. */
.ec-drawer-content > p:not(.ec-drawer-alert-note) {
  position: relative;
  margin: 7px 0 !important;
  padding: 12px 13px 12px 15px !important;
  border: 1px solid rgba(148,163,184,.085) !important;
  border-radius: 12px !important;
  color: #84909e !important;
  background: rgba(255,255,255,.014) !important;
  font-size: 10px !important;
  line-height: 1.55 !important;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.ec-drawer-content > p:not(.ec-drawer-alert-note):hover {
  transform: translateX(2px);
  border-color: rgba(244,190,24,.14) !important;
  background: rgba(244,190,24,.022) !important;
}

.ec-drawer-content > p:not(.ec-drawer-alert-note)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  bottom: 11px;
  width: 2px;
  border-radius: 999px;
  background: rgba(148,163,184,.16);
}

.ec-drawer-content > p:nth-of-type(5)::before {
  background: #f4be18;
  box-shadow: 0 0 10px rgba(244,190,24,.22);
}

.ec-drawer-content > p strong {
  color: #dbe3eb !important;
  font-weight: 760;
}

.ec-drawer-content .ec-drawer-alert-panel {
  margin: 2px 0 18px !important;
}

.ec-history {
  margin-top: 18px !important;
  padding: 14px !important;
  border-color: rgba(244,190,24,.13) !important;
  border-radius: 16px !important;
  background:
    linear-gradient(180deg, rgba(244,190,24,.03), transparent),
    rgba(255,255,255,.012) !important;
}

.ec-history-head {
  margin-bottom: 12px !important;
}

.ec-history-head strong {
  color: #edf2f7 !important;
  font-size: 11px;
}

.ec-history-head span {
  color: #7d8997 !important;
  font-size: 9px !important;
}

.ec-history-chart {
  border-radius: 12px !important;
}

.ec-history-list {
  gap: 0 !important;
  margin-top: 12px !important;
  border: 1px solid rgba(148,163,184,.07);
  border-radius: 11px;
  overflow: hidden;
}

.ec-history-list li {
  min-height: 38px;
  align-items: center;
  padding: 7px 10px !important;
  border-bottom: 1px solid rgba(148,163,184,.065) !important;
  background: rgba(255,255,255,.01);
}

.ec-history-list li:last-child {
  border-bottom: 0 !important;
}

.ec-share-btn--drawer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px !important;
  margin-top: 16px !important;
  padding: 0 14px !important;
  border-color: rgba(244,190,24,.18) !important;
  color: #e5c655 !important;
  background: rgba(244,190,24,.045) !important;
}

.ec-share-btn--drawer:hover {
  border-color: rgba(244,190,24,.34) !important;
  background: rgba(244,190,24,.075) !important;
}

@keyframes ecPopupBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 760px) {
  .ec-filter-command-copy > .ec-filter-icon {
    flex-basis: 36px;
    width: 36px !important;
    height: 36px !important;
    border-radius: 11px;
  }

  .ec-drawer {
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: min(88dvh, 760px) !important;
    max-height: 88dvh !important;
    border-width: 1px 0 0 !important;
    border-radius: 22px 22px 0 0 !important;
    opacity: 1;
    visibility: hidden;
    transform: translateY(104%) !important;
    transition: transform .30s cubic-bezier(.2,.8,.2,1), visibility .30s ease !important;
  }

  .ec-drawer.open {
    visibility: visible;
    transform: translateY(0) !important;
  }

  .ec-drawer::after {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    z-index: 6;
    width: 34px;
    height: 3px;
    border-radius: 999px;
    background: rgba(148,163,184,.25);
    transform: translateX(-50%);
  }

  .ec-drawer-close {
    min-height: 52px !important;
    padding: 5px 14px 0 !important;
  }

  .ec-drawer-content {
    padding: 16px 14px 24px !important;
  }

  .ec-drawer-content > h3 {
    font-size: 27px !important;
  }

  .ec-popup-eyebrow {
    margin-top: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ec-event-popup-backdrop,
  .ec-drawer,
  .ec-drawer-content > p:not(.ec-drawer-alert-note) {
    transition: none !important;
  }
}
