/* ═══════════════════════════════════════════════════════════════════
   MID-AUTUMN FESTIVAL 2026 POPUP BANNER (TRUNG THU S5)
   Design System: Deep Navy Blue + Warm Gold + Festive Vietnamese Art
   Responsive, Accessible, Lightweight SVG & Pure CSS Animations
═══════════════════════════════════════════════════════════════════ */

/* ── 1. BACKDROP & MODAL WRAPPER ── */
.s5-ma-backdrop {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(6, 16, 32, 0.88) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 2147483647 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 350ms cubic-bezier(0.22, 1, 0.36, 1), visibility 350ms cubic-bezier(0.22, 1, 0.36, 1);
}

.s5-ma-backdrop.s5-ma-visible {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ── 2. MAIN POPUP DIALOG CONTAINER ── */
.s5-ma-dialog {
  position: relative;
  width: 820px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  background: linear-gradient(135deg, #09172c 0%, #0f2744 50%, #15345c 100%);
  border-radius: 24px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.65),
    0 0 50px rgba(245, 158, 11, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: grid;
  grid-template-columns: 320px 1fr;
  overflow: hidden !important;
  overflow-x: hidden !important;
  opacity: 0;
  transform: translateY(30px) scale(0.96);
  transition: opacity 550ms cubic-bezier(0.22, 1, 0.36, 1), transform 550ms cubic-bezier(0.22, 1, 0.36, 1);
}

.s5-ma-backdrop.s5-ma-visible .s5-ma-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.s5-ma-backdrop.s5-ma-closing .s5-ma-dialog {
  opacity: 0;
  transform: translateY(15px) scale(0.98);
  transition: opacity 250ms ease, transform 250ms ease;
}

/* ── 3. CLOSE BUTTON ── */
.s5-ma-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.2s ease;
}

.s5-ma-close-btn:hover,
.s5-ma-close-btn:focus-visible {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #fbbf24;
  transform: rotate(90deg) scale(1.08);
  outline: none;
}

/* ── 4. LEFT ARTWORK SECTION (MOON, LANTERNS, SKYLINE) ── */
.s5-ma-artwork {
  position: relative;
  background: radial-gradient(ellipse at 50% 30%, #173868 0%, #0c203d 60%, #061325 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(245, 158, 11, 0.2);
  min-height: 480px;
}

/* Full Moon Glow & Pulse */
.s5-ma-moon-wrap {
  position: absolute;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 170px;
  height: 170px;
  z-index: 2;
}

.s5-ma-moon {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #fffbeb 25%, #fef3c7 50%, #fde68a 75%, #f59e0b 100%);
  box-shadow: 
    0 0 35px rgba(251, 191, 36, 0.6),
    0 0 80px rgba(245, 158, 11, 0.35),
    inset -8px -8px 20px rgba(217, 119, 6, 0.4);
  animation: s5MoonPulse 6s ease-in-out infinite;
  position: relative;
}

/* Stylized Rabbit Silhouette on Moon */
.s5-ma-moon-rabbit {
  position: absolute;
  bottom: 22px;
  right: 32px;
  width: 38px;
  height: 38px;
  opacity: 0.22;
  fill: #78350f;
}

/* Auspicious Clouds */
.s5-ma-cloud {
  position: absolute;
  z-index: 3;
  opacity: 0.75;
  pointer-events: none;
}

.s5-ma-cloud-1 {
  top: 110px;
  left: -20px;
  width: 140px;
  animation: s5CloudDrift1 14s ease-in-out infinite alternate;
}

.s5-ma-cloud-2 {
  top: 55px;
  right: -25px;
  width: 120px;
  animation: s5CloudDrift2 18s ease-in-out infinite alternate;
}

/* Hanging Lanterns */
.s5-ma-lanterns {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 190px;
  z-index: 5;
  pointer-events: none;
}

.s5-ma-lantern {
  position: absolute;
  transform-origin: top center;
}

.s5-ma-lantern-left {
  top: -5px;
  left: 24px;
  width: 44px;
  animation: s5LanternSwing1 4.5s ease-in-out infinite;
}

.s5-ma-lantern-right {
  top: -10px;
  right: 28px;
  width: 38px;
  animation: s5LanternSwing2 5.2s ease-in-out infinite;
  animation-delay: 1.4s;
}

.s5-ma-lantern-center {
  top: -8px;
  left: 110px;
  width: 34px;
  animation: s5LanternSwing3 4.8s ease-in-out infinite;
  animation-delay: 2.6s;
}

/* Skyline & Silhouette at bottom */
.s5-ma-skyline-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 160px;
  z-index: 4;
  pointer-events: none;
}

.s5-ma-skyline-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Floating Gold Sparkle Particles */
.s5-ma-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.s5-ma-particle {
  position: absolute;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 6px #f59e0b;
}

.s5-ma-p1 { width: 3px; height: 3px; top: 25%; left: 20%; animation: s5Twinkle 3s ease-in-out infinite; }
.s5-ma-p2 { width: 4px; height: 4px; top: 40%; left: 80%; animation: s5Twinkle 4s ease-in-out infinite 1s; }
.s5-ma-p3 { width: 2px; height: 2px; top: 15%; left: 65%; animation: s5Twinkle 2.8s ease-in-out infinite 0.5s; }
.s5-ma-p4 { width: 3px; height: 3px; top: 60%; left: 15%; animation: s5Twinkle 3.5s ease-in-out infinite 1.8s; }
.s5-ma-p5 { width: 4px; height: 4px; top: 75%; left: 70%; animation: s5Twinkle 4.2s ease-in-out infinite 2.2s; }

/* ── 5. RIGHT CONTENT SECTION ── */
.s5-ma-content {
  padding: 32px 32px 28px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 10;
  overflow-x: hidden !important;
  overflow-y: auto;
  max-height: calc(100vh - 40px);
  box-sizing: border-box !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.3) transparent;
}

.s5-ma-content::-webkit-scrollbar {
  width: 5px;
}

.s5-ma-content::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.25);
  border-radius: 10px;
}

/* Tagline / Header Badge */
.s5-ma-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
  width: fit-content;
}

/* Big Headline with Gold Shimmer */
.s5-ma-title {
  margin: 0 0 10px;
  line-height: 1.22;
}

.s5-ma-line1 {
  display: block;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #f59e0b 0%, #fffbeb 40%, #fbbf24 70%, #d97706 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: s5GoldShimmer 5s ease-in-out infinite;
}

.s5-ma-line2 {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-top: 2px;
}

/* Subtitle & Invitation Message */
.s5-ma-quote {
  font-style: italic;
  color: #fde68a;
  font-size: 0.88rem;
  margin-bottom: 6px;
  font-weight: 500;
}

.s5-ma-desc {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #cbd5e1;
  margin: 0 0 16px;
}

/* Activities Chips Grid */
.s5-ma-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.s5-ma-chip {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Event Info Meta Card */
.s5-ma-meta-box {
  background: rgba(15, 39, 68, 0.65);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.s5-ma-meta-row {
  display: flex;
  align-items: center;
  font-size: 0.83rem;
  color: #cbd5e1;
  gap: 8px;
}

.s5-ma-meta-row .s5-ma-lbl {
  color: #94a3b8;
  min-width: 68px;
}

.s5-ma-meta-row strong {
  color: #fef08a;
  font-weight: 600;
}

/* Action Buttons (CTAs) */
.s5-ma-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.s5-ma-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #d97706 100%);
  color: #0f2744 !important;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: 12px;
  text-decoration: none !important;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  border: none;
  cursor: pointer;
}

.s5-ma-btn-primary:hover,
.s5-ma-btn-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.5);
  filter: brightness(1.08);
  color: #09172c !important;
}

.s5-ma-btn-primary .s5-arrow {
  transition: transform 0.25s ease;
}

.s5-ma-btn-primary:hover .s5-arrow {
  transform: translateX(4px);
}

.s5-ma-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: #fef08a !important;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(254, 240, 138, 0.4);
  text-decoration: none !important;
  transition: all 0.25s ease;
  cursor: pointer;
}

.s5-ma-btn-secondary:hover,
.s5-ma-btn-secondary:focus-visible {
  background: rgba(254, 240, 138, 0.12);
  border-color: #fef08a;
  color: #ffffff !important;
}

/* Footer Attribution */
.s5-ma-footer-note {
  font-size: 0.74rem;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

/* ── 6. FLOATING MINI TRIGGER BUTTON (RE-OPEN POPUP) ── */
.s5-ma-float-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, #0f2744 0%, #173868 100%);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  padding: 10px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(15, 39, 68, 0.35), 0 0 16px rgba(245, 158, 11, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 9999;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  text-decoration: none;
}

.s5-ma-float-btn:hover,
.s5-ma-float-btn:focus-visible {
  transform: translateY(-3px) scale(1.04);
  background: linear-gradient(135deg, #15315c 0%, #1e457e 100%);
  border-color: #fbbf24;
  box-shadow: 0 12px 30px rgba(15, 39, 68, 0.5), 0 0 24px rgba(245, 158, 11, 0.4);
  color: #fff;
  outline: none;
}

.s5-ma-float-btn .s5-float-lantern {
  font-size: 1.1rem;
  animation: s5FloatLanternBob 3s ease-in-out infinite;
}

/* ── 7. KEYFRAME ANIMATIONS ── */
@keyframes s5MoonPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 35px rgba(251, 191, 36, 0.6), 0 0 80px rgba(245, 158, 11, 0.35);
  }
  50% {
    transform: scale(1.035);
    box-shadow: 0 0 50px rgba(251, 191, 36, 0.8), 0 0 100px rgba(245, 158, 11, 0.45);
  }
}

@keyframes s5LanternSwing1 {
  0%, 100% { transform: rotate(-3.5deg); }
  50% { transform: rotate(3.5deg); }
}

@keyframes s5LanternSwing2 {
  0%, 100% { transform: rotate(3deg); }
  50% { transform: rotate(-3deg); }
}

@keyframes s5LanternSwing3 {
  0%, 100% { transform: rotate(-2.5deg); }
  50% { transform: rotate(2.5deg); }
}

@keyframes s5CloudDrift1 {
  0% { transform: translateX(-8px); }
  100% { transform: translateX(8px); }
}

@keyframes s5CloudDrift2 {
  0% { transform: translateX(6px); }
  100% { transform: translateX(-6px); }
}

@keyframes s5Twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.3); }
}

@keyframes s5GoldShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes s5FloatLanternBob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-3px) rotate(3deg); }
}

/* ── 8. RESPONSIVE DESIGN (MOBILE <= 680px) ── */
@media (max-width: 680px) {
  .s5-ma-dialog {
    grid-template-columns: 1fr;
    max-height: 92vh;
    border-radius: 20px;
  }

  .s5-ma-close-btn {
    top: 10px !important;
    right: 10px !important;
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
    background: rgba(9, 23, 44, 0.75) !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
    color: #fbbf24 !important;
    z-index: 50 !important;
  }

  .s5-ma-artwork {
    min-height: 180px;
    height: 180px;
    border-right: none;
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  }

  .s5-ma-moon-wrap {
    top: 15px;
    width: 110px;
    height: 110px;
  }

  .s5-ma-moon-rabbit {
    width: 26px;
    height: 26px;
    bottom: 14px;
    right: 20px;
  }

  .s5-ma-lantern-left { width: 34px; left: 16px; top: -5px; }
  .s5-ma-lantern-right { width: 30px; right: 16px; top: -8px; }
  .s5-ma-lantern-center { display: none; }

  .s5-ma-cloud-1 { top: 70px; width: 90px; }
  .s5-ma-cloud-2 { top: 30px; width: 80px; }

  .s5-ma-skyline-wrap { height: 90px; }

  .s5-ma-content {
    padding: 22px 20px 20px;
    max-height: calc(92vh - 180px);
  }

  .s5-ma-line1 {
    font-size: 1.35rem;
  }

  .s5-ma-line2 {
    font-size: 1.12rem;
  }

  .s5-ma-desc {
    font-size: 0.84rem;
    margin-bottom: 12px;
  }

  .s5-ma-actions {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .s5-ma-btn-primary,
  .s5-ma-btn-secondary {
    width: 100%;
    padding: 11px 16px;
    font-size: 0.88rem;
  }

  .s5-ma-float-btn {
    bottom: 72px !important;
    right: 14px !important;
    padding: 7px 12px !important;
    font-size: 0.76rem !important;
    z-index: 9990 !important;
  }
}

/* ── 9. ACCESSIBILITY: REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  .s5-ma-dialog,
  .s5-ma-backdrop,
  .s5-ma-moon,
  .s5-ma-lantern,
  .s5-ma-cloud,
  .s5-ma-particle,
  .s5-ma-line1,
  .s5-ma-float-btn .s5-float-lantern {
    animation: none !important;
    transition: opacity 0.2s linear !important;
  }
}
