/* PAE Notifications — Frontend Popup v3.0 */

#pae-popup {
  position: fixed;
  z-index: 999999;
  width: 320px;
  max-width: calc(100vw - 28px);
  background: #ffffff;
  border-radius: var(--pr, 12px);
  box-shadow:
    0 4px 6px -1px rgba(0,0,0,.09),
    0 12px 40px -4px rgba(0,0,0,.22),
    0 2px 4px -1px rgba(0,0,0,.05);
  overflow: hidden;
  border-left: 4px solid var(--pb, #1a3a1f);
  /* NOT clickable */
  cursor: default !important;
  pointer-events: auto;
  user-select: none;
  transition: opacity .38s ease, transform .5s cubic-bezier(.34,1.4,.64,1);
}

/* ── Positions ──────────────────────────────────── */
#pae-popup.pos-bottom-left  { bottom: 22px; left: 22px; }
#pae-popup.pos-bottom-right { bottom: 22px; right: 22px; }
#pae-popup.pos-top-left     { top: 90px;    left: 22px; }
#pae-popup.pos-top-right    { top: 90px;    right: 22px; }

/* ── Hidden state ───────────────────────────────── */
#pae-popup.pae-hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── Slide animations ───────────────────────────── */
#pae-popup.anim-slide.pos-bottom-left.pae-hidden,
#pae-popup.anim-slide.pos-top-left.pae-hidden    { transform: translateX(calc(-100% - 32px)); }
#pae-popup.anim-slide.pos-bottom-right.pae-hidden,
#pae-popup.anim-slide.pos-top-right.pae-hidden   { transform: translateX(calc(100% + 32px)); }
#pae-popup.anim-slide:not(.pae-hidden)           { transform: translateX(0); }

#pae-popup.anim-fade.pae-hidden             { transform: scale(.94) translateY(6px); }
#pae-popup.anim-fade:not(.pae-hidden)       { transform: scale(1) translateY(0); }

#pae-popup.anim-bounce.pae-hidden           { transform: translateY(20px) scale(.95); }
#pae-popup.anim-bounce:not(.pae-hidden)     { transform: translateY(0) scale(1); }

/* ── Company logo header ────────────────────────── */
.pae-popup-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 40px 10px 14px;
  background: linear-gradient(135deg, #1a3a1f 0%, #0f2414 100%);
  position: relative;
}

/* PAE brand image — shows real logo if set, falls back to text badge */
.pae-logo-img-wrap {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 7px;
  overflow: hidden;
  background: linear-gradient(135deg, #c9a227, #a07a10);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pae-logo-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
/* Fallback text badge if no logo image */
.pae-logo-text-badge {
  font-size: 11px;
  font-weight: 900;
  color: #1a3a1f;
  letter-spacing: -.5px;
  font-family: 'Georgia', serif;
  line-height: 1;
}

.pae-logo-words { flex: 1; min-width: 0; }
.pae-logo-name {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.25;
}
.pae-logo-tagline {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #c9a227;
  display: block;
  margin-top: 2px;
}

/* Gold bottom line under logo header */
.pae-popup-logo::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #c9a227 0%, rgba(201,162,39,.2) 100%);
}

/* ── Main content ───────────────────────────────── */
.pae-popup-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 38px 13px 14px;
}
.pae-popup-flag-wrap {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.pae-popup-body { flex: 1; min-width: 0; }

/* Tag row */
.pae-popup-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}
.pae-live-dot {
  width: 6px; height: 6px;
  background: #3d8b46;
  border-radius: 50%;
  flex-shrink: 0;
  animation: paePulse 1.8s ease-in-out infinite;
}
@keyframes paePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .3; transform: scale(.6); }
}
#pae-tag-text {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--pb, #1a3a1f);
}

/* Title */
.pae-popup-title {
  font-size: 13px;
  font-weight: 700;
  color: #111111;
  line-height: 1.4;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default !important;
  text-decoration: none !important;
}

/* Meta: location + qty badge */
.pae-popup-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.pae-popup-location { font-size: 11.5px; color: #444; }
.pae-popup-qty {
  font-size: 10px;
  font-weight: 700;
  background: var(--pb, #1a3a1f);
  color: #ffffff;
  padding: 2px 9px;
  border-radius: 10px;
  white-space: nowrap;
  letter-spacing: .3px;
}

/* Time ago */
.pae-popup-time { font-size: 10.5px; color: #aaa; }

/* ── Close button ───────────────────────────────── */
.pae-close-btn {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.75);
  font-size: 11px;
  cursor: pointer;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: all .2s;
  z-index: 2;
}
.pae-close-btn:hover {
  background: rgba(255,255,255,.3);
  color: #fff;
  border-color: rgba(255,255,255,.4);
}

/* ── Progress bar ───────────────────────────────── */
.pae-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pa, #c9a227), var(--pb, #1a3a1f));
  transform-origin: left;
}

/* ── Hover glow (non-clickable still gets subtle hover) ── */
#pae-popup:hover {
  box-shadow:
    0 6px 14px -2px rgba(0,0,0,.11),
    0 20px 52px -6px rgba(0,0,0,.26);
}

/* ── Mobile ─────────────────────────────────────── */
@media (max-width: 480px) {
  #pae-popup {
    width: calc(100vw - 20px) !important;
    bottom: 10px !important;
    left: 10px !important;
    right: auto !important;
    top: auto !important;
  }
}
