/* ═══════════════════════════════════════════════════════════════
   IMPULSE ENGINE — Confetti, Ticker, Flash Sales, Floating CTA
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --ie-rust: #FF6B00;
  --ie-rust-dark: #e55f00;
  --ie-green: #22c55e;
  --ie-orange: #f97316;
  --ie-gold: #FF6B00;
  --ie-dark: #0a0a0a;
  --ie-white: #ffffff;
  --ie-radius: 12px;
  --ie-shadow: 0 4px 24px rgba(0,0,0,0.35);
  --ie-z-ticker: 900;
  --ie-z-banner: 950;
  --ie-z-float: 1000;
  --ie-z-popup: 1100;
  --ie-z-confetti: 9999;
  --ie-z-overlay: 1050;
}

/* ══════════════════════════════════════════════════════════════
   1. CONFETTI CANVAS
   ══════════════════════════════════════════════════════════════ */
#ie-confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: var(--ie-z-confetti);
  display: none;
}

/* ── Purchase Celebration Overlay ────────────────────────────── */
#ie-celebration-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: var(--ie-z-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#ie-celebration-overlay.active {
  display: flex;
}

.ie-celebration-card {
  background: #111;
  border: 1px solid rgba(255, 107, 0,0.4);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(255, 107, 0,0.15);
  animation: ie-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes ie-pop-in {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.ie-celebration-card .ie-emoji {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
  animation: ie-bounce 0.6s ease infinite alternate;
}

@keyframes ie-bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}

.ie-celebration-card h2 {
  color: #fff;
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.ie-celebration-card p {
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  margin: 0 0 1.75rem;
}

.ie-celebration-card .ie-celebration-cta {
  display: inline-block;
  background: var(--ie-green);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
}

.ie-celebration-card .ie-celebration-cta:hover {
  background: #16a34a;
  transform: translateY(-1px);
}

.ie-celebration-card .ie-dismiss-link {
  display: block;
  margin-top: 0.75rem;
  color: rgba(255,255,255,0.35);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

/* ── Lite Celebration Toast ──────────────────────────────────── */
.ie-toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--ie-z-popup);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  width: 340px;
  max-width: 95vw;
}

.ie-toast {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 0.875rem 1.25rem;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: ie-toast-in 0.3s ease forwards;
  pointer-events: auto;
}

.ie-toast.ie-toast-success {
  border-color: rgba(34,197,94,0.4);
  background: linear-gradient(135deg, #0f2e1a 0%, #1a1a1a 100%);
}

.ie-toast .ie-toast-icon { font-size: 1.4rem; flex-shrink: 0; }

@keyframes ie-toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes ie-toast-out {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(-20px); opacity: 0; }
}

/* ══════════════════════════════════════════════════════════════
   2. SOCIAL PROOF TICKER
   ══════════════════════════════════════════════════════════════ */
#ie-ticker-bar {
  background: rgba(10,10,10,0.92);
  border-bottom: 1px solid rgba(255, 107, 0,0.25);
  height: 40px;
  overflow: hidden;
  position: relative;
  z-index: var(--ie-z-ticker);
  display: none; /* hidden until items loaded */
}

#ie-ticker-bar.visible {
  display: block;
}

.ie-ticker-inner {
  display: flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  animation: ie-ticker-scroll 40s linear infinite;
  will-change: transform;
}

.ie-ticker-inner:hover {
  animation-play-state: paused;
}

.ie-ticker-item {
  display: inline-flex;
  align-items: center;
  padding: 0 2.5rem;
  color: rgba(255,255,255,0.75);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.ie-ticker-item strong {
  color: var(--ie-rust);
  margin: 0 0.2em;
}

.ie-ticker-separator {
  color: rgba(255,255,255,0.15);
  padding: 0 0.5rem;
}

@keyframes ie-ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ══════════════════════════════════════════════════════════════
   3. FLASH SALE BANNER
   ══════════════════════════════════════════════════════════════ */
#ie-flash-banner {
  background: linear-gradient(90deg, #7c1d06 0%, #FF6B00 50%, #7c1d06 100%);
  background-size: 200% auto;
  animation: ie-banner-shine 4s linear infinite;
  color: #fff;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: var(--ie-z-banner);
  display: none;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

#ie-flash-banner.visible {
  display: block;
}

@keyframes ie-banner-shine {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.ie-flash-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ie-flash-label {
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.ie-flash-countdown {
  font-family: 'Courier New', monospace;
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.ie-flash-banner-close {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.15s;
}

.ie-flash-banner-close:hover { color: #fff; }

/* ══════════════════════════════════════════════════════════════
   4. FLOATING UPGRADE BUTTON
   ══════════════════════════════════════════════════════════════ */
#ie-float-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: var(--ie-z-float);
  display: none;
}

#ie-float-btn.visible {
  display: block;
  animation: ie-float-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes ie-float-in {
  from { transform: scale(0) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0);    opacity: 1; }
}

.ie-float-btn-inner {
  background: var(--ie-rust);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.875rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 107, 0,0.5), 0 0 0 0 rgba(255, 107, 0,0.4);
  transition: background 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  animation: ie-pulse-ring 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
  text-decoration: none;
}

.ie-float-btn-inner:hover {
  background: var(--ie-rust-dark);
  transform: translateY(-2px);
}

@keyframes ie-pulse-ring {
  0%   { box-shadow: 0 4px 20px rgba(255, 107, 0,0.5), 0 0 0 0 rgba(255, 107, 0,0.4); }
  70%  { box-shadow: 0 4px 20px rgba(255, 107, 0,0.5), 0 0 0 12px rgba(255, 107, 0,0); }
  100% { box-shadow: 0 4px 20px rgba(255, 107, 0,0.5), 0 0 0 0 rgba(255, 107, 0,0); }
}

/* ══════════════════════════════════════════════════════════════
   5. ABANDONED UPGRADE POPUP
   ══════════════════════════════════════════════════════════════ */
#ie-upgrade-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: var(--ie-z-popup);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#ie-upgrade-popup.active {
  display: flex;
  animation: ie-fade-in 0.25s ease forwards;
}

@keyframes ie-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ie-upgrade-popup-card {
  background: #141414;
  border: 1px solid rgba(255, 107, 0,0.35);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  max-width: 400px;
  width: 100%;
  position: relative;
  box-shadow: var(--ie-shadow);
  animation: ie-pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.ie-popup-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.15s;
}

.ie-popup-close-btn:hover { color: rgba(255,255,255,0.7); }

.ie-upgrade-popup-card .ie-popup-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(249,115,22,0.15);
  border: 1px solid rgba(249,115,22,0.3);
  color: var(--ie-orange);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  margin-bottom: 1rem;
}

.ie-upgrade-popup-card h3 {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
  line-height: 1.25;
}

.ie-upgrade-popup-card p {
  color: rgba(255,255,255,0.6);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
  line-height: 1.6;
}

.ie-popup-bonus-box {
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  margin-bottom: 1.5rem;
  color: var(--ie-green);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ie-popup-upgrade-btn {
  display: block;
  width: 100%;
  background: var(--ie-rust);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}

.ie-popup-upgrade-btn:hover {
  background: var(--ie-rust-dark);
  transform: translateY(-1px);
  color: #fff;
}

.ie-popup-no-thanks {
  display: block;
  text-align: center;
  margin-top: 0.875rem;
  color: rgba(255,255,255,0.3);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
}

.ie-popup-no-thanks:hover {
  color: rgba(255,255,255,0.5);
}

/* ══════════════════════════════════════════════════════════════
   6. URGENCY BADGES
   ══════════════════════════════════════════════════════════════ */
.ie-urgency-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
}

.ie-urgency-badge.today-count {
  background: rgba(255, 107, 0,0.12);
  border: 1px solid rgba(255, 107, 0,0.3);
  color: var(--ie-rust);
}

.ie-urgency-badge.flash-ends {
  background: rgba(249,115,22,0.12);
  border: 1px solid rgba(249,115,22,0.3);
  color: var(--ie-orange);
}

/* ══════════════════════════════════════════════════════════════
   7. ONE-TAP BUTTON STYLES
   ══════════════════════════════════════════════════════════════ */
.ie-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0.875rem 1.75rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  letter-spacing: 0.01em;
  text-decoration: none;
  line-height: 1;
}

.ie-buy-btn-protect {
  background: var(--ie-rust);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 107, 0,0.35);
}

.ie-buy-btn-protect:hover {
  background: var(--ie-rust-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 107, 0,0.45);
  color: #fff;
}

.ie-buy-btn-pro {
  background: linear-gradient(135deg, #FF6B00 0%, #e55f00 100%);
  color: #000;
  box-shadow: 0 4px 16px rgba(245,158,11,0.35);
}

.ie-buy-btn-pro:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #FF6B00 100%);
  transform: translateY(-2px);
  color: #000;
}

.ie-buy-btn-loading {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

/* Sale price display */
.ie-price-display {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}

.ie-price-original {
  text-decoration: line-through;
  opacity: 0.45;
  font-size: 0.85em;
}

.ie-price-sale {
  color: var(--ie-orange);
  font-weight: 800;
}

/* ══════════════════════════════════════════════════════════════
   8. SPARKLE ANIMATION (lite celebration)
   ══════════════════════════════════════════════════════════════ */
.ie-sparkle-container {
  position: relative;
  display: inline-block;
}

.ie-sparkle {
  position: absolute;
  pointer-events: none;
  animation: ie-sparkle-burst 0.8s ease forwards;
  font-size: 1.2rem;
}

@keyframes ie-sparkle-burst {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--sx), var(--sy)) scale(0); opacity: 0; }
}

/* ══════════════════════════════════════════════════════════════
   9. MOBILE ADJUSTMENTS
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .ie-float-btn-inner {
    padding: 0.75rem 1.25rem;
    font-size: 0.88rem;
  }

  #ie-float-btn {
    bottom: 1rem;
    right: 1rem;
  }

  .ie-celebration-card {
    padding: 2rem 1.5rem;
  }

  .ie-celebration-card h2 {
    font-size: 1.4rem;
  }

  .ie-upgrade-popup-card h3 {
    font-size: 1.25rem;
  }

  #ie-flash-banner {
    font-size: 0.8rem;
  }

  .ie-ticker-item {
    font-size: 0.78rem;
  }
}
