/* =============================================================================
   ROB E BANK AI — Marketing / Promo Module CSS  [v1.0 — 2026-05-04]
   Edit campaign values in: backend/static/js/marketing.js  (ROB_MARKETING_CONFIG)
   ============================================================================= */

/* ── BACKDROP ────────────────────────────────────────────────────────────────── */
.marketing-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: mktFadeIn 0.28s ease;
}
.marketing-modal-backdrop.hidden {
  display: none;
}
@keyframes mktFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── MODAL CARD ──────────────────────────────────────────────────────────────── */
.marketing-modal {
  position: relative;
  width: 100%;
  max-width: 390px;
  background: linear-gradient(155deg, #130f08 0%, #080604 100%);
  border: 1px solid rgba(200, 140, 48, 0.78);
  border-radius: 12px;
  padding: 24px 22px 20px;
  box-shadow:
    0 0 0 1px rgba(200, 140, 48, 0.22),
    0 0 36px rgba(180, 120, 32, 0.34),
    0 0 72px rgba(180, 120, 32, 0.14),
    0 8px 32px rgba(0, 0, 0, 0.70),
    inset 0 1px 0 rgba(210, 152, 52, 0.14);
  animation: mktCardIn 0.30s cubic-bezier(0.22, 1, 0.36, 1);
  /* Breathing glow — subtle, no layout shift */
  animation: mktCardIn 0.30s cubic-bezier(0.22, 1, 0.36, 1) both,
             mktBreath 4s ease-in-out 0.5s infinite;
  will-change: box-shadow;
  overflow: hidden;
}
@keyframes mktCardIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes mktBreath {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(200, 140, 48, 0.22),
      0 0 36px rgba(180, 120, 32, 0.34),
      0 0 72px rgba(180, 120, 32, 0.14),
      0 8px 32px rgba(0, 0, 0, 0.70),
      inset 0 1px 0 rgba(210, 152, 52, 0.14);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(200, 140, 48, 0.40),
      0 0 52px rgba(180, 120, 32, 0.50),
      0 0 90px rgba(180, 120, 32, 0.20),
      0 8px 32px rgba(0, 0, 0, 0.70),
      inset 0 1px 0 rgba(210, 152, 52, 0.22);
  }
}

/* Accent stripe at top */
.marketing-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #d09530 30%, #eaaa36 50%, #d09530 70%, transparent 100%);
  border-radius: 12px 12px 0 0;
}

/* ── CLOSE BUTTON ────────────────────────────────────────────────────────────── */
.marketing-close {
  position: absolute;
  top: 11px;
  right: 13px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(200, 140, 48, 0.28);
  border-radius: 50%;
  color: rgba(200, 175, 130, 0.75);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  font-family: inherit;
  padding: 0;
}
.marketing-close:hover {
  background: rgba(200, 140, 48, 0.16);
  border-color: rgba(200, 140, 48, 0.55);
  color: #eaaa36;
}

/* ── MODAL HEADER ────────────────────────────────────────────────────────────── */
.marketing-modal-title {
  font-size: 13px;
  font-weight: 700;
  color: #eaaa36;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(210, 149, 48, 0.55);
  margin-bottom: 3px;
  padding-right: 28px;
}
.marketing-modal-subtitle {
  font-size: 10.5px;
  color: rgba(222, 196, 154, 0.70);
  margin-bottom: 16px;
  padding-right: 28px;
}

/* ── DIVIDER ─────────────────────────────────────────────────────────────────── */
.marketing-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(200, 140, 48, 0.32) 30%, rgba(200, 140, 48, 0.32) 70%, transparent 100%);
  margin: 12px 0;
}

/* ── PRICE SECTION ───────────────────────────────────────────────────────────── */
.marketing-price-block {
  margin-bottom: 14px;
}
.marketing-price-label {
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(192, 162, 115, 0.56);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

/* Regular price — struck through, muted red */
.regular-price {
  font-size: 13px;
  color: rgba(239, 68, 68, 0.60);
  text-decoration: line-through;
  text-decoration-color: rgba(239, 68, 68, 0.40);
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.regular-price-amount {
  font-size: 17px;
  font-weight: 700;
}

/* Discount price — bright green glow */
.promo-price {
  font-size: 13px;
  color: #22c55e;
  margin-bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.promo-price-amount {
  font-size: 26px;
  font-weight: 800;
  color: #4ade80;
  text-shadow: 0 0 20px rgba(34, 197, 94, 0.55), 0 0 40px rgba(34, 197, 94, 0.25);
  letter-spacing: -0.01em;
  /* Fixed width to prevent countdown reflow */
  min-width: 0;
}
.promo-price-unit {
  font-size: 11.5px;
  color: rgba(34, 197, 94, 0.72);
  font-weight: 500;
}

/* Save badge */
.marketing-save-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.30);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  color: #4ade80;
  margin-top: 4px;
  letter-spacing: 0.03em;
}

/* ── COUNTDOWN ───────────────────────────────────────────────────────────────── */
.promo-countdown-section {
  margin: 14px 0;
}
.promo-countdown-label {
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(192, 162, 115, 0.56);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 7px;
}
.promo-countdown {
  display: flex;
  align-items: center;
  gap: 6px;
}
.promo-countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 7px 6px 5px;
  background: rgba(6, 4, 1, 0.78);
  border: 1px solid rgba(200, 140, 48, 0.36);
  border-radius: 7px;
  box-shadow: 0 0 10px rgba(180, 120, 32, 0.14),
              inset 0 1px 0 rgba(210, 152, 52, 0.08);
}
.promo-countdown-num {
  font-size: 19px;
  font-weight: 800;
  color: #eaaa36;
  text-shadow: 0 0 14px rgba(210, 149, 48, 0.45);
  letter-spacing: 0.02em;
  /* Stable width to prevent reflow */
  min-width: 2ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.promo-countdown-sub {
  font-size: 8px;
  color: rgba(192, 162, 115, 0.56);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.promo-countdown-sep {
  font-size: 18px;
  font-weight: 700;
  color: rgba(200, 140, 48, 0.40);
  align-self: flex-start;
  padding-top: 5px;
  flex-shrink: 0;
}

/* Expired state */
.promo-countdown-expired {
  font-size: 11px;
  color: rgba(239, 68, 68, 0.72);
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ── DISCLAIMER ──────────────────────────────────────────────────────────────── */
.marketing-disclaimer {
  font-size: 9.5px;
  color: rgba(192, 162, 115, 0.50);
  line-height: 1.55;
  margin-bottom: 14px;
}

/* ── CTA BUTTONS ─────────────────────────────────────────────────────────────── */
.marketing-cta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.marketing-cta {
  flex: 1;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 14px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: all 0.20s;
  white-space: nowrap;
}
/* Primary — WhatsApp/Admin — purple accent */
.marketing-cta-primary {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.90) 0%, rgba(109, 40, 217, 0.95) 100%);
  color: #f5f3ff;
  box-shadow: 0 0 14px rgba(124, 58, 237, 0.30);
}
.marketing-cta-primary:hover {
  background: linear-gradient(135deg, rgba(124, 58, 237, 1) 0%, rgba(109, 40, 217, 1) 100%);
  box-shadow: 0 0 22px rgba(124, 58, 237, 0.50);
  transform: translateY(-1px);
}
/* Secondary — Telegram group — outline gold */
.marketing-cta-secondary {
  background: transparent;
  border: 1px solid rgba(200, 140, 48, 0.55);
  color: #eaaa36;
}
.marketing-cta-secondary:hover {
  background: rgba(200, 140, 48, 0.10);
  border-color: rgba(200, 140, 48, 0.80);
  box-shadow: 0 0 12px rgba(200, 140, 48, 0.22);
  transform: translateY(-1px);
}

/* ── PROMO TOAST ─────────────────────────────────────────────────────────────── */
.marketing-toast {
  position: fixed;
  bottom: 22px;
  right: 18px;
  z-index: 8900;
  width: 280px;
  max-width: calc(100vw - 28px);
  background: linear-gradient(145deg, #130f08 0%, #080604 100%);
  border: 1px solid rgba(200, 140, 48, 0.60);
  border-radius: 9px;
  padding: 11px 14px 11px 13px;
  box-shadow:
    0 0 20px rgba(180, 120, 32, 0.22),
    0 4px 20px rgba(0, 0, 0, 0.60),
    inset 0 1px 0 rgba(210, 152, 52, 0.10);
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: mktToastIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  /* Pointer events so close X is clickable */
  pointer-events: auto;
}
.marketing-toast.hidden {
  display: none;
}
@keyframes mktToastIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.marketing-toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.marketing-toast-title {
  font-size: 9.5px;
  font-weight: 700;
  color: #eaaa36;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-shadow: 0 0 10px rgba(210, 149, 48, 0.35);
}
.marketing-toast-close {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(200, 140, 48, 0.22);
  border-radius: 50%;
  color: rgba(200, 175, 130, 0.65);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  font-family: inherit;
  padding: 0;
  flex-shrink: 0;
}
.marketing-toast-close:hover {
  background: rgba(200, 140, 48, 0.14);
  color: #eaaa36;
}
.marketing-toast-msg {
  font-size: 11px;
  color: rgba(222, 196, 154, 0.82);
  line-height: 1.48;
}
.marketing-toast-sub {
  font-size: 10px;
  color: rgba(192, 162, 115, 0.50);
  margin-top: 1px;
}
/* Auto-dismiss progress bar at bottom of toast */
.marketing-toast-progress {
  height: 2px;
  background: rgba(200, 140, 48, 0.15);
  border-radius: 1px;
  margin-top: 6px;
  overflow: hidden;
}
.marketing-toast-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #d09530, #eaaa36);
  border-radius: 1px;
  width: 100%;
  transition: width linear;
}

/* ── MOBILE RESPONSIVE ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .marketing-modal {
    max-width: 100%;
    padding: 20px 16px 18px;
    margin: 0;
    border-radius: 10px;
  }
  .marketing-modal-backdrop {
    padding: 10px;
    align-items: flex-end;
  }
  .promo-countdown-unit {
    min-width: 44px;
    padding: 6px 4px 4px;
  }
  .promo-countdown-num {
    font-size: 16px;
  }
  .promo-price-amount {
    font-size: 22px;
  }
  .marketing-cta {
    font-size: 11.5px;
    padding: 9px 10px;
  }
  /* Toast: bottom-center on mobile */
  .marketing-toast {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 16px;
    width: calc(100vw - 28px);
    max-width: 340px;
  }
  @keyframes mktToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  }
}
