/* ==========================================================================
   ANIMATED DIGITAL WEDDING INVITATION — PRODUCTION STYLES
   Dr. Zara Shah & Arsh Ali Khan — Bhopal, December 2026
   PRD v1.0: Video-Accurate Auto-Play & Interactive Curtain Experience
   ========================================================================== */

:root {
  --ivory: #F5EBDD;
  --cream: #EFE2CF;
  --gold: #C9A66B;
  --gold-dark: #9C7A3C;
  --maroon: #6B1F2A;
  --deep-brown: #4B3025;
  --sage: #8A9A74;
  --white-bloom: #FFFDF8;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #E8DCCF;
  color: var(--maroon);
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  user-select: none;
  -webkit-user-select: none;
}

/* Ambient Desk Background */
.ambient-desk-bg {
  background: radial-gradient(circle at 50% 30%, #FBF6EF 0%, #EDE1D1 60%, #D8C3AC 100%);
}

/* Typography Helpers */
.font-script {
  font-family: 'Great Vibes', cursive;
  font-style: normal;
}

.font-serif {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
}

.font-display {
  font-family: 'Playfair Display', serif;
}

.font-sans {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.font-arabic {
  font-family: 'Amiri', 'Noto Naskh Arabic', serif;
  direction: rtl;
}

/* ==========================================================================
   CENTRAL PHYSICAL INVITATION CARD FRAME (9:16 Canvas)
   ========================================================================== */
.invitation-book-card {
  box-shadow: 
    0 32px 80px -16px rgba(107, 31, 42, 0.35),
    0 16px 36px -10px rgba(75, 48, 37, 0.22),
    0 0 0 1px rgba(201, 166, 107, 0.38);
  border-radius: 28px;
  background: var(--ivory);
  position: relative;
  overflow: hidden;
  aspect-ratio: 9 / 16;
}

@media (max-width: 640px) {
  .invitation-book-card {
    border-radius: 0;
    box-shadow: none;
    max-width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto;
  }
}

/* ==========================================================================
   SLIDE PAGINATION INDICATOR (Top Segmented Pills / Dots)
   ========================================================================== */
#slideIndicatorContainer,
#audioToggleBtn,
.nav-edge-arrow,
#scrollHintPill {
  transition: opacity 0.5s ease, transform 0.3s ease;
}

body:not(.is-card-opened) #slideIndicatorContainer,
body:not(.is-card-opened) #audioToggleBtn,
body:not(.is-card-opened) .nav-edge-arrow,
body:not(.is-card-opened) #scrollHintPill {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

body.controls-idle .nav-edge-arrow,
body.controls-idle #scrollHintPill {
  opacity: 0.15;
}

body.controls-idle #slideIndicatorContainer {
  opacity: 0.35;
}

body.controls-idle .nav-edge-arrow:hover,
body.controls-idle #slideIndicatorContainer:hover {
  opacity: 1;
}

.slide-indicator-container {
  position: absolute;
  top: 10px;
  left: 14px;
  right: 14px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 45;
  pointer-events: auto;
}

.slide-dots-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
}

.slide-dot {
  flex: 1;
  height: 4px;
  background: rgba(201, 166, 107, 0.35);
  border-radius: 4px;
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  cursor: pointer;
  border: none;
  padding: 0;
  outline: none;
  position: relative;
}

.slide-dot::after {
  content: "";
  position: absolute;
  inset: -6px 0;
}

.slide-dot:hover {
  background: rgba(201, 166, 107, 0.75);
}

.slide-dot.active {
  background: var(--maroon);
  box-shadow: 0 0 8px rgba(107, 31, 42, 0.45);
  transform: scaleY(1.3);
}

.slide-counter-badge {
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--maroon);
  background: rgba(255, 253, 248, 0.88);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(201, 166, 107, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  white-space: nowrap;
  user-select: none;
}

/* ==========================================================================
   CURTAIN DOORS (FR-1 & FR-8: Ribbon & Doves Opening/Closing)
   ========================================================================== */
.curtain-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  overflow: hidden;
  display: flex;
  transition: visibility 0.3s ease;
}

.curtain-door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  will-change: transform;
  transition: transform 1.6s cubic-bezier(0.65, 0, 0.35, 1);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.25);
  background-color: var(--ivory);
}

.curtain-door.left {
  left: 0;
  transform: translateX(0);
}

.curtain-door.right {
  right: 0;
  transform: translateX(0);
}

.curtain-door img {
  position: absolute;
  top: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  pointer-events: none;
}

.curtain-door.left img {
  left: 0;
}

.curtain-door.right img {
  right: 0;
}

/* Door Opened State */
.curtain-container.opened .curtain-door.left {
  transform: translateX(-100%);
}

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

/* Pulsing "Tap to Open" Hint */
.curtain-hint {
  position: absolute;
  bottom: calc(2.2rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-dark);
  font-weight: 700;
  animation: pulseHint 2s infinite ease-in-out;
  pointer-events: none;
  background: rgba(255, 249, 241, 0.85);
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid rgba(201, 166, 107, 0.4);
  backdrop-blur: 4px;
}

@keyframes pulseHint {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(0.97); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.03); }
}

/* Closing Curtain Replay/Share Overlay */
.closing-overlay-controls {
  position: absolute;
  bottom: calc(2.5rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease 0.6s;
}

.closing-overlay-controls.visible {
  opacity: 1;
  pointer-events: auto;
}

.curtain-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.95);
  border: 1px solid var(--gold);
  color: var(--maroon);
  box-shadow: 0 4px 12px rgba(107, 31, 42, 0.15);
  cursor: pointer;
  transition: all 0.3s ease;
}

.curtain-btn:hover {
  background: var(--maroon);
  color: var(--ivory);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(107, 31, 42, 0.25);
}

/* ==========================================================================
   STRICT ISOLATED SLIDE ARCHITECTURE
   ========================================================================== */
/* ==========================================================================
   SCROLLABLE SLIDE ARCHITECTURE (Vertical Scroll-Snap Deck)
   ========================================================================== */
.slide-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: hidden; /* locked while card is closed */
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Hide scrollbars for clean physical invitation aesthetic */
  -ms-overflow-style: none;
}

.slide-viewport.is-unlocked {
  overflow-y: auto;
}

.slide-viewport::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.invitation-slide {
  display: flex !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  flex-shrink: 0;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Background Image Layer */
.slide-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

/* Structured Content Layer */
.slide-content-canvas {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* Centered in mid properly */
  text-align: center;
  padding: 0 1.25rem;
}

/* Names containers with clear margins */
.names-stage-container {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 0 4px;
}

.names-arch-container {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  padding: 12px 14px;
  background: rgba(255, 252, 246, 0.85);
  border: 1px solid rgba(158, 110, 34, 0.4);
  border-radius: 22px;
  box-shadow: 0 4px 18px rgba(94, 18, 30, 0.08);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* S2 Couple Verse Card: Placed high in arch negative space without face overlap */
.couple-verse-card {
  width: 100%;
  max-width: 290px;
  margin: 0 auto;
  padding: 10px 16px;
  background: rgba(255, 252, 246, 0.9);
  border: 1px solid rgba(158, 110, 34, 0.45);
  border-radius: 20px;
  box-shadow: 0 4px 18px rgba(94, 18, 30, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* S5 Details Icon Rows */
.details-icon-list {
  width: 100%;
  max-width: 325px;
  margin: 0 auto;
}

.details-icon-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255, 252, 246, 0.9);
  border: 1px solid rgba(201, 166, 107, 0.4);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(107, 31, 42, 0.06);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-align: left;
}

.details-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(201, 166, 107, 0.15);
  border: 1px solid rgba(201, 166, 107, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.details-icon-text {
  flex: 1;
}

.details-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.95);
  border: 1px solid var(--gold);
  color: var(--maroon);
  box-shadow: 0 3px 10px rgba(107, 31, 42, 0.12);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
}

.details-action-btn:hover {
  background: var(--maroon);
  color: var(--ivory);
  border-color: var(--maroon);
  transform: translateY(-1.5px);
  box-shadow: 0 5px 14px rgba(107, 31, 42, 0.22);
}

.couple-title-script {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(2rem, 6.8vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: #5E121E;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.95);
  white-space: nowrap;
}

.couple-arch-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.4rem, 5.4vw, 1.85rem);
  font-weight: 800;
  line-height: 1.15;
  color: #5E121E;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.95);
  white-space: nowrap;
}

.ceremony-title-script {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(2.3rem, 7.8vw, 2.9rem);
  font-weight: 700;
  line-height: 1.05;
  color: #5E121E;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.95);
}

/* Canvas margin for standard mosque frame: centered in middle clear parchment */
.canvas-framed {
  padding-top: calc(34px + 6%);
  padding-bottom: 25%;
  justify-content: center;
}

/* Canvas margin for couple arch artwork: centered high in middle arch opening */
.canvas-couple {
  padding-top: calc(34px + 14%);
  padding-bottom: 45%;
  justify-content: flex-start;
}

/* Canvas margin for floral stage canopy: centered in middle stage opening */
.canvas-stage {
  padding-top: calc(34px + 10%);
  padding-bottom: 22%;
  justify-content: center;
}

/* Canvas margin for closing Duas slide */
.canvas-dua-clean {
  padding-top: calc(34px + 2%);
  padding-bottom: clamp(20px, 3.5vh, 32px);
  justify-content: space-between;
}

/* Luxury Floating Edge Arrows (Prev / Next Buttons) */
.nav-edge-arrow {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(201, 166, 107, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--maroon);
  box-shadow: 0 4px 14px rgba(107, 31, 42, 0.18);
  cursor: pointer;
  z-index: 35;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  user-select: none;
}

.nav-edge-arrow:hover {
  background: var(--maroon);
  color: var(--ivory);
  border-color: var(--maroon);
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(107, 31, 42, 0.3);
}

.nav-edge-arrow.prev {
  bottom: 16px;
  left: 16px;
}

.nav-edge-arrow.next {
  bottom: 16px;
  right: 16px;
}

.nav-edge-arrow.disabled {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

/* Scroll Hint Pill */
.scroll-hint-pill {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(201, 166, 107, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 4px 14px;
  border-radius: 20px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--maroon);
  font-weight: 700;
  z-index: 30;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: pulseHint 2s infinite ease-in-out;
  transition: opacity 0.4s ease;
}

.scroll-hint-pill.hidden {
  opacity: 0;
  pointer-events: none;
}

.final-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.95);
  border: 1px solid var(--gold);
  color: var(--maroon);
  box-shadow: 0 3px 10px rgba(107, 31, 42, 0.15);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
}

.final-action-btn:hover {
  background: var(--maroon);
  color: var(--ivory);
  border-color: var(--maroon);
  transform: translateY(-1.5px);
  box-shadow: 0 5px 14px rgba(107, 31, 42, 0.25);
}

/* Minimal Text Link */
.editorial-text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--maroon);
  font-weight: 700;
  text-decoration: none;
  padding: 4px 8px;
  border-bottom: 1.5px solid var(--gold);
  transition: color 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}

.editorial-text-link:hover {
  color: var(--gold-dark);
  border-color: var(--gold-dark);
}

/* Fine Decorative Gold Hairline */
.gold-hairline-accent {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 166, 107, 0.55), transparent);
}

/* Calendar Styling & Heart Drawing */
.calendar-grid-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px 3px;
  table-layout: fixed;
}

.calendar-cell {
  height: 24px;
  font-size: 11.5px;
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  color: var(--maroon);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
}

.calendar-cell.celebration {
  font-weight: 700;
  color: var(--gold-dark);
}

.calendar-cell.celebration::after {
  content: "";
  position: absolute;
  inset: 1px;
  border: 1px solid rgba(201, 166, 107, 0.4);
  border-radius: 50%;
  pointer-events: none;
}

.calendar-cell.nikah-date {
  font-weight: 800;
  color: var(--maroon);
  animation: pulseDate 1.2s ease-in-out 1.2s 2;
}

@keyframes pulseDate {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}

.calendar-heart-svg {
  position: absolute;
  inset: -6px;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  pointer-events: none;
  z-index: 2;
}

.heart-path {
  fill: none;
  stroke: var(--maroon);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.is-active .heart-path {
  animation: drawHeart 1.3s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.4s;
}

@keyframes drawHeart {
  to {
    stroke-dashoffset: 0;
  }
}
