/* ==========================================================================
   CINEMATIC DOOR OPENING EXPERIENCE — Luxury Revamp
   ========================================================================== */

/* ---- Overlay Base ---- */
.opening-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  perspective: 1400px;
  perspective-origin: center center;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  pointer-events: auto;
}

/* ---- Background Glow behind doors ---- */
.opening-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(11, 66, 42, 0.95) 0%, rgba(6, 44, 32, 0.98) 60%, rgba(3, 29, 21, 1) 100%);
  pointer-events: none;
  z-index: 999;
  transition: opacity 0.8s ease;
}

/* ---- Door Canvas / Particles ---- */
#door-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1005;
}

/* ---- Central Light Glow from behind the opening doors ---- */
.light-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.2);
  background: radial-gradient(circle,
    rgba(255, 245, 200, 0.85) 0%,
    rgba(201, 162, 39, 0.5) 40%,
    rgba(15, 81, 50, 0) 70%
  );
  z-index: 1000; /* Di belakang panel pintu agar tidak menutupi pintu */
  opacity: 0;
  pointer-events: none;
  filter: blur(15px);
  transition:
    opacity 0.4s ease,
    transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.light-burst.active {
  opacity: 0.9;
  transform: translate(-50%, -50%) scale(8);
}

/* ---- 3D Door Panels ---- */
.door-panel {
  position: absolute;
  top: 0;
  width: 50.2%;
  height: 100%;
  background: linear-gradient(165deg, #0F5132 0%, #0B422A 35%, #062C20 70%, #031D15 100%);
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform;
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.8),
    0 0 30px rgba(0, 0, 0, 0.7);
}

.door-left {
  left: 0;
  border-right: 2px solid var(--clr-champagne-gold);
  transform-origin: left center;
}

.door-right {
  right: 0;
  border-left: 2px solid var(--clr-champagne-gold);
  transform-origin: right center;
}

/* ---- Door Inner Bevel & Gold Ornament Frames ---- */
.door-inner {
  position: absolute;
  inset: 1.25rem;
  border: 1px solid rgba(201, 162, 39, 0.35);
  pointer-events: none;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5);
}

.door-inner::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(201, 162, 39, 0.2);
}

/* ---- Door Seam Crest (Splits on opening) ---- */
.door-crest {
  position: absolute;
  top: 50%;
  width: 120px;
  height: 120px;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1003;
  filter: drop-shadow(0 0 10px rgba(201, 162, 39, 0.5));
}

.door-left .door-crest {
  right: -60px;
}

.door-right .door-crest {
  left: -60px;
}

.door-crest img {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---- Opening Content Card ---- */
.opening-content {
  position: relative;
  z-index: 1010;
  text-align: center;
  padding: 3rem 2rem;
  max-width: 440px;
  width: 88%;
  background: rgba(3, 29, 21, 0.88);
  border: 1px solid rgba(201, 162, 39, 0.5);
  border-radius: var(--border-radius-md);
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(201, 162, 39, 0.15),
    inset 0 1px 0 rgba(201, 162, 39, 0.2),
    0 0 40px rgba(201, 162, 39, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: cardEntrance 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Inner double-border decoration */
.opening-content::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(201, 162, 39, 0.2);
  border-radius: calc(var(--border-radius-md) - 4px);
  pointer-events: none;
}

/* Subtle top shimmer */
.opening-content::after {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 162, 39, 0.6), transparent);
}

/* ---- Guest Badge ---- */
.guest-badge {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.55rem 1.5rem;
  background: rgba(201, 162, 39, 0.12);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: var(--border-radius-pill);
  font-size: var(--fs-xs);
  color: var(--clr-ivory);
  letter-spacing: 0.06em;
}

.guest-badge strong {
  color: var(--clr-champagne-gold);
  font-weight: 600;
}

/* ---- Decorative corner ornaments on opening card ---- */
.opening-content .corner-ornament {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: rgba(201, 162, 39, 0.5);
  border-style: solid;
}
.opening-content .corner-ornament.tl { top: 12px; left: 12px; border-width: 1px 0 0 1px; }
.opening-content .corner-ornament.tr { top: 12px; right: 12px; border-width: 1px 1px 0 0; }
.opening-content .corner-ornament.bl { bottom: 12px; left: 12px; border-width: 0 0 1px 1px; }
.opening-content .corner-ornament.br { bottom: 12px; right: 12px; border-width: 0 1px 1px 0; }

/* ---- Opening Card Gold Floral Accents ---- */
.opening-flower-tl,
.opening-flower-br {
  width: clamp(85px, 18vw, 120px);
  z-index: 1;
  opacity: 0.45;
}

.opening-flower-tl {
  top: -10px;
  left: -10px;
  transform: rotate(180deg);
}

.opening-flower-br {
  bottom: -10px;
  right: -10px;
}

/* ---- Floating Petal Layer (post-open) ---- */
#petal-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.8s ease;
}

#petal-canvas.visible {
  opacity: 1;
}

/* ---- Confetti Layer (post-open) ---- */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.6s ease;
}

#confetti-canvas.visible {
  opacity: 1;
}

/* ---- Sparkle Burst Overlay ---- */
.sparkle-burst-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  overflow: hidden;
}

.sparkle-star {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, #FFF8DC, #C9A227);
  box-shadow: 0 0 6px 2px rgba(201, 162, 39, 0.7);
  opacity: 0;
  animation: sparkleFade var(--dur, 1.5s) var(--delay, 0s) ease-out forwards;
}

@keyframes sparkleFade {
  0%   { opacity: 0; transform: scale(0) translateY(0); }
  30%  { opacity: 1; transform: scale(1) translateY(calc(-1 * var(--travel, 40px))); }
  100% { opacity: 0; transform: scale(0.3) translateY(calc(-2 * var(--travel, 40px))); }
}

/* ---- Flower Petals Rain ---- */
.petal {
  position: fixed;
  top: -40px;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  will-change: transform, opacity;
  animation: petalFall var(--fall-duration, 6s) var(--fall-delay, 0s) linear forwards;
}

@keyframes petalFall {
  0% {
    opacity: 0;
    transform: translateY(-40px) rotate(0deg) translateX(0px);
  }
  5% { opacity: 0.9; }
  90% { opacity: 0.8; }
  100% {
    opacity: 0;
    transform: translateY(110vh) rotate(720deg) translateX(var(--drift, 60px));
  }
}

/* ---- Script Name Typography ---- */
.opening-script-names {
  font-family: 'Great Vibes', 'Cormorant Garamond', cursive;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 400;
  color: var(--clr-champagne-gold);
  line-height: 1.15;
  margin: 0.3rem 0;
  text-shadow:
    0 2px 12px rgba(201, 162, 39, 0.4),
    0 0 40px rgba(201, 162, 39, 0.15);
  animation: shimmerText 3s ease-in-out infinite alternate;
}

@keyframes shimmerText {
  from { text-shadow: 0 2px 12px rgba(201, 162, 39, 0.35), 0 0 30px rgba(201, 162, 39, 0.1); }
  to   { text-shadow: 0 2px 20px rgba(201, 162, 39, 0.6),  0 0 60px rgba(201, 162, 39, 0.25); }
}

/* ---- Floral SVG dividers ---- */
.opening-floral-top,
.opening-floral-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem auto;
  opacity: 0.9;
}

/* ---- Hint text ---- */
.opening-hint {
  margin-top: 1rem;
  font-family: var(--ff-body);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(201, 162, 39, 0.45);
  animation: hintPulse 2.5s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.35; }
  50%       { opacity: 0.75; }
}

/* ---- Door Opened State (Fallback) ---- */
.opening-overlay.opened .door-left {
  transform: translateX(-102%) rotateY(-20deg);
}

.opening-overlay.opened .door-right {
  transform: translateX(102%) rotateY(20deg);
}

.opening-overlay.opened .opening-content {
  opacity: 0;
  transform: scale(0.9) translateY(-16px);
  pointer-events: none;
}

.opening-overlay.opened {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease 1.2s;
}

.opening-overlay.hidden {
  display: none !important;
}
