/* ==========================================================================
   ROYAL BLUSH & GOLD LUXURY NIKKAH CARD (UNIFORM SPACING & GOLDEN LACE LINES)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Cinzel:ital,wght@0,400;0,600;0,700;1,400&family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Great+Vibes&family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
  /* Palette */
  --bg-blush: #f5e6e3;
  --bg-blush-light: #faf0ed;
  
  /* Gold Accents */
  --gold-primary: #c89d3c;
  --gold-dark: #8c6317;
  --gold-darker: #3b2502;
  --gold-light: #f7e7af;
  --gold-gradient: linear-gradient(135deg, #d4af37 0%, #fff2b2 50%, #aa7c11 100%);

  /* Text Colors */
  --text-dark: #23170e;
  --text-muted: #5e4a43;
  
  /* Fonts */
  --font-arabic: 'Amiri', serif;
  --font-serif: 'Cormorant Garamond', serif;
  --font-heading: 'Cinzel', serif;
  --font-script: 'Great Vibes', cursive;
  --font-sans: 'Montserrat', sans-serif;

  --shadow-soft: 0 15px 35px rgba(107, 85, 80, 0.15);
  --shadow-gold: 0 10px 25px rgba(200, 157, 60, 0.25);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

html, body {
  width: 100%;
  background-color: var(--bg-blush);
  font-family: var(--font-serif);
  color: var(--text-dark);
}

/* INITIAL STATE: LOCKED VIEWPORT (NO SCROLLBARS AT ALL ON ENVELOPE) */
body.envelope-locked {
  height: 100vh !important;
  overflow: hidden !important;
  touch-action: none;
}

/* OPENED STATE: UNLOCKED SCROLLING FOR CARD CONTENT */
body.envelope-opened {
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
}

/* Canvas for Floating Rose Petals (100% Fixed Viewport Coverage) */
#petals-canvas {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  pointer-events: none !important;
  z-index: 100 !important;
}

/* ==========================================================================
   MAIN VIEWPORT CONTAINER
   ========================================================================== */

.app-viewport {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 10;
  background: #f7e8e5;
  box-shadow: 0 0 50px rgba(0,0,0,0.15);
}

/* ==========================================================================
   STAGE 1: 100% PURE CSS/SVG HIGHLY DETAILED ENVELOPE
   ========================================================================== */

.unboxing-stage {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  background: var(--bg-blush);
  perspective: 1200px;
  transition: opacity 0.8s ease, transform 0.8s ease;
  overflow: hidden;
}

.unboxing-stage.opened-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  display: none !important;
}

/* Pure CSS Envelope Folio */
.envelope-card-3d {
  width: 320px;
  height: 480px;
  position: relative;
  background: linear-gradient(135deg, #fbf2ef 0%, #f4ded8 100%);
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(107, 85, 80, 0.22), inset 0 0 40px rgba(255, 255, 255, 0.6), 0 0 0 1px rgba(200, 157, 60, 0.35);
  transform-style: preserve-3d;
  cursor: pointer;
  transition: transform 0.4s ease;
  overflow: hidden;
}

@media (min-width: 400px) and (min-height: 600px) {
  .envelope-card-3d {
    width: 345px;
    height: 510px;
  }
}

.envelope-card-3d:hover {
  transform: translateY(-4px) scale(1.01);
}

.envelope-body {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #fbf2ef 0%, #f4ded8 100%);
}

.envelope-paper-texture {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.45) 1px, transparent 1px);
  background-size: 8px 8px;
  opacity: 0.6;
}

.corner-ornaments-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.envelope-gold-frame {
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(200, 157, 60, 0.45);
  border-radius: 12px;
  pointer-events: none;
  z-index: 2;
}

/* V-SHAPED TOP ENVELOPE FLAP WITH DETAILED LACE SVG */
.envelope-v-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 56%;
  background: linear-gradient(180deg, #faf2ef 0%, #f0dad4 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.flap-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #fcf6f4 0%, #edd8d2 100%);
}

.embossed-lace-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* 3D Flap Opening Animation */
.envelope-card-3d.open .envelope-v-flap {
  transform: rotateX(180deg);
  z-index: 1;
}

/* Center Gold Wax Seal holding V-Flap */
.wax-seal-wrapper {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.4s ease;
}

.envelope-card-3d.open .wax-seal-wrapper {
  opacity: 0;
  pointer-events: none;
}

.wax-seal-wrapper:hover {
  transform: translate(-50%, -53%) scale(1.06);
}

.wax-seal {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f9e7af 0%, #c89d3c 50%, #91681c 100%);
  box-shadow: 0 10px 30px rgba(140, 99, 23, 0.45), 0 0 25px rgba(247, 231, 175, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid #fff4ce;
  animation: pulseGlow 2.5s infinite alternate ease-in-out;
  position: relative;
}

.seal-gold-beads {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px dotted rgba(255, 244, 206, 0.8);
  pointer-events: none;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 8px 20px rgba(140, 99, 23, 0.4), 0 0 15px rgba(200, 157, 60, 0.4); }
  100% { box-shadow: 0 12px 35px rgba(140, 99, 23, 0.65), 0 0 35px rgba(249, 231, 175, 0.95); }
}

.wax-seal-inner {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1.5px dashed rgba(107, 75, 15, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle, #e9c869 0%, #ab7f1d 100%);
  color: #3b2800;
}

.wax-seal-arabic {
  font-family: var(--font-arabic);
  font-size: 1.25rem;
  font-weight: bold;
  line-height: 1;
  color: #2b1d02;
}

.seal-text-sub {
  font-family: var(--font-heading);
  font-size: 0.6rem;
  letter-spacing: 2px;
  margin-top: 4px;
  font-weight: 700;
  color: #2b1d02;
}

/* Tap To Open Container & Gold Dividers */
.tap-to-open-container {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 15;
  width: 80%;
  justify-content: center;
}

.gold-divider-line {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.tap-to-open-text {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 3px;
  color: var(--gold-dark);
  text-transform: uppercase;
  white-space: nowrap;
  font-weight: 600;
  animation: bounceText 2s infinite ease-in-out;
}

@keyframes bounceText {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

/* ==========================================================================
   CURTAIN SLIDE OVERLAY (SLIDES APART FROM MIDDLE)
   ========================================================================== */

.curtain-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 110;
  display: flex;
  overflow: hidden;
}

.curtain-container.opened-hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.curtain-panel {
  width: 50vw;
  height: 100vh;
  background: linear-gradient(135deg, #5c141d 0%, #8c2331 50%, #450c14 100%);
  box-shadow: inset 0 0 50px rgba(0,0,0,0.6);
  position: relative;
  transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.curtain-left { border-right: 4px solid var(--gold-primary); }
.curtain-right { border-left: 4px solid var(--gold-primary); }

.curtain-container.opened .curtain-left { transform: translateX(-100%); }
.curtain-container.opened .curtain-right { transform: translateX(100%); }

.curtain-fabric {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 15px, transparent 15px, transparent 30px);
}

/* ==========================================================================
   STAGE 2: MAIN CARD PAGE (HIGH CONTRAST GLASSMORPHIC CARDS)
   ========================================================================== */

.card-stage {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  background-image: url('bg_palace.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  padding-bottom: 60px;
  opacity: 0;
  transition: opacity 0.8s ease 0.3s;
}

.card-stage.visible {
  opacity: 1;
}

.card-stage::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(245, 230, 227, 0.6) 30%, rgba(245, 230, 227, 0.95) 100%);
  pointer-events: none;
  z-index: 1;
}

.card-content-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 18px 20px 18px;
  text-align: center;
}

/* ==========================================================================
   HARDWARE ACCELERATED GLASSMORPHISM CARDS
   ========================================================================== */

.glass-card {
  background: rgba(255, 252, 248, 0.68) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12), inset 0 1px 2px rgba(255, 255, 255, 0.9) !important;
  border-radius: 20px !important;
}

.glass-subcard {
  background: rgba(255, 252, 248, 0.75) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
}

.hero-card-container {
  width: 100%;
  padding: 30px 20px;
  margin-top: 15px;
  margin-bottom: 30px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Bismillah Refined Frame Box (Color Matched with Dark Bronze Gold Aesthetics) */
.bismillah-section-box {
  width: 100%;
  max-width: 360px;
  padding: 14px 18px;
  margin-bottom: 12px;
  border: 1.5px solid rgba(200, 157, 60, 0.5);
  border-radius: 14px;
  background: rgba(255, 249, 238, 0.8);
  box-shadow: 0 4px 15px rgba(107, 85, 80, 0.08), inset 0 0 12px rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
}

.bismillah-header {
  width: 100%;
}

.bismillah-svg {
  width: 100%;
  max-width: 320px;
  height: auto;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.12));
}

.bismillah-svg text {
  fill: #3b2502 !important;
  stroke: #3b2502 !important;
  stroke-width: 0.4px !important;
}

.ornate-gold-divider {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--gold-primary);
  margin: 4px 0 16px 0;
  opacity: 0.85;
}

/* Separate Arabic Ayah Block */
.ayah-section-block {
  width: 100%;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.quran-ayah-arabic {
  font-family: var(--font-arabic);
  font-size: 1.9rem;
  font-weight: bold;
  color: var(--gold-darker);
  margin-bottom: 6px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 8px rgba(59, 37, 2, 0.12);
  line-height: 1.3;
}

.quran-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Bride & Groom Names in High-Contrast Dark Bronze Gold */
.couple-names-wrapper {
  width: 100%;
  margin: 10px 0 20px 0;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.couple-name {
  font-family: var(--font-script);
  font-size: 4rem;
  line-height: 1.25;
  color: var(--gold-darker);
  text-shadow: 0 1px 0 rgba(255,255,255,0.9), 0 3px 10px rgba(59, 37, 2, 0.15);
  padding: 4px 10px;
  font-weight: 400;
}

@media (min-width: 400px) {
  .couple-name {
    font-size: 4.6rem;
  }
}

.name-connector-amp {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-style: italic;
  color: var(--gold-dark);
  margin: -8px 0;
}

.event-hero-date {
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: 3px;
  color: var(--text-dark);
  margin-bottom: 25px;
  font-weight: 700;
}

.scroll-down-indicator {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: bounceDown 2s infinite ease-in-out;
}

.scroll-down-indicator svg {
  width: 16px;
  height: 16px;
  color: var(--gold-dark);
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ==========================================================================
   CONTENT CARDS: CALENDAR, VENUE DETAILS, COUNTDOWN, DUA & THANK YOU
   ========================================================================== */

.content-card-box {
  width: 100%;
  padding: 30px 20px;
  margin-bottom: 30px;
}

.dua-box {
  width: 100%;
  padding: 25px 20px;
  margin-bottom: 30px;
}

.card-box-title {
  font-family: var(--font-script);
  font-size: 2.4rem;
  color: var(--gold-darker);
  margin-bottom: 20px;
  line-height: 1;
}

.calendar-month-header {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: var(--text-dark);
  margin-bottom: 15px;
  font-weight: 700;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 25px;
  width: 100%;
}

.cal-head {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  padding-bottom: 5px;
}

.cal-day {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text-dark);
  padding: 8px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
}

.cal-day.wedding-day {
  background: var(--gold-gradient);
  color: #2b1d02;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(200, 157, 60, 0.4);
  transform: scale(1.1);
}

.btn-capsule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  background: var(--gold-gradient);
  color: #2b1d02;
  border: none;
  border-radius: 30px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-gold);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-capsule:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(200, 157, 60, 0.45);
}

.btn-capsule svg {
  width: 18px;
  height: 18px;
}

.venue-details-text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text-dark);
  line-height: 1.6;
  margin-bottom: 20px;
}

.venue-address-highlight {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold-darker);
  margin-top: 5px;
}

.countdown-box {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 15px;
}

.time-card {
  border-radius: 12px;
  padding: 12px 4px;
}

.time-val {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold-darker);
}

.time-lbl {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

.dua-arabic {
  font-family: var(--font-arabic);
  font-size: 1.5rem;
  color: var(--gold-darker);
  margin-bottom: 8px;
  line-height: 1.4;
}

.dua-translation {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
}

/* SECTION 5: THANK YOU BOX AT THE BOTTOM (UNIFORM SPACING) */
.thank-you-box {
  margin-top: 0 !important;
  margin-bottom: 40px !important;
  padding: 35px 22px;
  text-align: center;
}

.thank-you-text {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--text-dark);
  line-height: 1.75;
  margin-bottom: 24px;
  font-style: italic;
}

.thank-you-signature {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 2.5px;
  color: var(--gold-dark);
  line-height: 1.8;
  text-transform: uppercase;
}

.thank-you-signature strong {
  font-family: var(--font-script);
  font-size: 2.2rem;
  text-transform: none;
  display: block;
  margin-top: 6px;
  color: var(--gold-darker);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
  font-weight: 400;
}

/* Audio Toggle Widget (100% FIXED CORNER POSITION ALWAYS PINNED TO SCREEN) */
.audio-toggle-btn {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  background: rgba(255, 252, 248, 0.95) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1.5px solid var(--gold-primary) !important;
  color: var(--gold-darker) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  cursor: pointer !important;
  z-index: 9999 !important;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2) !important;
  transition: transform 0.3s ease, opacity 0.4s ease !important;
  opacity: 0;
  pointer-events: none;
}

.audio-toggle-btn.visible {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.sound-waves {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
}

.sound-wave-bar {
  width: 2.5px;
  background: var(--gold-darker);
  border-radius: 2px;
  animation: soundWave 1.2s infinite ease-in-out alternate;
}

.sound-wave-bar:nth-child(1) { height: 5px; animation-delay: 0.1s; }
.sound-wave-bar:nth-child(2) { height: 12px; animation-delay: 0.3s; }
.sound-wave-bar:nth-child(3) { height: 8px; animation-delay: 0.2s; }
.sound-wave-bar:nth-child(4) { height: 14px; animation-delay: 0.4s; }

.audio-toggle-btn.muted .sound-wave-bar {
  animation: none;
  height: 2px;
}
