/**
 * Royal Wedding Invitation Opening Experience
 * Nisarga B K Weds Sharath B
 * Style: style.css (Core Design Tokens, Lighting & Ambience, UI Components)
 */

:root {
  /* Color Palette */
  --bg-ivory: #FBF8F2;
  --bg-cream: #F5EFEB;
  --bg-warm-sand: #EDE3D4;
  
  --envelope-ivory: #FAF6EE;
  --envelope-inner: #F1E7D5;
  --envelope-lining: #851C2C;
  
  --gold-highlight: #FFF2B2;
  --gold-primary: #D4AF37;
  --gold-rich: #C59B27;
  --gold-dark: #8C6B1B;
  --gold-foil: linear-gradient(135deg, #ECC868 0%, #D4AF37 50%, #997819 100%);
  --gold-shimmer: linear-gradient(90deg, rgba(212,175,55,0) 0%, rgba(255,242,178,0.8) 50%, rgba(212,175,55,0) 100%);
  
  --maroon-primary: #6B1724;
  --maroon-dark: #450912;
  --maroon-velvet: #58121D;
  --maroon-accent: #8E2034;
  
  --text-dark: #2C1810;
  --text-gold: #B08D25;
  --text-muted: #7A695E;
  
  /* Typography */
  --font-kannada: 'Noto Serif Kannada', 'Tiro Kannada', serif;
  --font-display: 'Cinzel', 'Playfair Display', serif;
  --font-elegant: 'Cormorant Garamond', Georgia, serif;
  --font-ui: 'Montserrat', system-ui, -apple-system, sans-serif;
  
  /* Shadows & Depth */
  --shadow-subtle: 0 4px 15px rgba(44, 24, 16, 0.06);
  --shadow-medium: 0 10px 25px rgba(44, 24, 16, 0.12);
  --shadow-deep: 0 20px 45px rgba(44, 24, 16, 0.22);
  --shadow-gold-glow: 0 0 35px rgba(212, 175, 55, 0.35);
  
  /* Smooth Easing */
  --ease-cinematic: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
  background-color: var(--bg-ivory);
  font-family: var(--font-elegant);
  color: var(--text-dark);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none; /* Handled via touch gestures in JS */
}

.luxury-wedding-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-image: 
    radial-gradient(ellipse at 50% 30%, rgba(255, 250, 240, 0.9) 0%, rgba(245, 238, 226, 0.75) 60%, rgba(235, 224, 208, 0.95) 100%),
    url('../images/envelope-texture.png');
  background-repeat: repeat;
  background-size: auto, 380px;
}

/* Ambient Canvas (Floating Rose Petals & Golden Stardust) */
.ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 990;
}

/* Backdrop Overlays */
.cinematic-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.radial-light-glow {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120vw;
  height: 90vh;
  background: radial-gradient(circle, rgba(255, 238, 194, 0.45) 0%, rgba(245, 230, 200, 0.15) 50%, transparent 75%);
  filter: blur(40px);
}

.vignette-overlay {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 100px rgba(70, 30, 20, 0.12);
}

/* Traditional Indian Floral Corner Garlands with Hanging Bells */
.corner-ornament {
  position: absolute;
  width: clamp(120px, 30vw, 200px);
  height: clamp(120px, 30vw, 200px);
  pointer-events: none;
  opacity: 0.95;
  transition: opacity 0.8s ease;
}

.corner-ornament .floral-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(80, 20, 20, 0.15));
}

.corner-top-left {
  top: -10px;
  left: -10px;
}

.corner-top-right {
  top: -10px;
  right: -10px;
  transform: scaleX(-1);
}

.corner-bottom-left {
  bottom: -15px;
  left: -10px;
  transform: scaleY(-1);
  opacity: 0.65;
}

.corner-bottom-right {
  bottom: -15px;
  right: -10px;
  transform: scale(-1, -1);
  opacity: 0.65;
}

/* Header Branding & Action Buttons */
.app-header {
  position: relative;
  z-index: 995;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: env(safe-area-inset-top, 16px) 20px 10px 20px;
  width: 100%;
  height: 70px;
}

.header-monogram {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 2px;
  color: var(--maroon-primary);
  text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

.monogram-letter {
  background: var(--gold-foil);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 2px rgba(140, 107, 27, 0.35));
}

.monogram-amp {
  font-family: var(--font-elegant);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--maroon-accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--maroon-primary);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.08);
  transition: all 0.3s var(--ease-cinematic);
}

.btn-icon:hover {
  transform: translateY(-1px);
  border-color: var(--gold-primary);
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.25);
  background: rgba(255, 255, 255, 0.95);
}

.btn-icon:active {
  transform: scale(0.94);
}

.sound-pulse-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-primary);
  opacity: 0;
  pointer-events: none;
}

.audio-active .sound-pulse-ring {
  animation: audioPulse 2s infinite ease-out;
}

@keyframes audioPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.35); opacity: 0; }
}

.header-replay-btn {
  color: var(--gold-dark);
}

.btn-text-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Main Stage Viewport */
.main-stage {
  flex: 1;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* WEDDING INVITATION TOP HEADER */
.invitation-top-header {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  text-align: center;
  padding: 4px 16px;
  width: 90%;
  max-width: 440px;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.top-ganesha-shloka {
  margin-bottom: 2px;
}

.shloka-deva {
  font-family: var(--font-kannada);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold-dark);
  letter-spacing: 1.5px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85);
}

.top-wedding-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-bottom: 3px;
}

.title-english {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--gold-rich);
  text-transform: uppercase;
}

.title-kannada {
  font-family: var(--font-kannada);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--maroon-primary);
  letter-spacing: 0.5px;
}

.top-couple-names {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--maroon-primary);
  margin-bottom: 5px;
}

.couple-name {
  background: linear-gradient(135deg, #7A1927 0%, #450912 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 1px rgba(140, 107, 27, 0.25));
}

.couple-weds {
  font-family: var(--font-elegant);
  font-style: italic;
  font-size: 1rem;
  font-weight: 400;
  color: var(--gold-rich);
  text-transform: lowercase;
}

.top-ornamental-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto;
  max-width: 200px;
}

.ornament-line {
  flex: 1;
  height: 1px;
  background: var(--gold-foil);
  opacity: 0.75;
}

.ornament-mandala {
  color: var(--gold-primary);
  font-size: 0.7rem;
  letter-spacing: 2px;
  opacity: 0.9;
}

/* SWIPE UP INSTRUCTION UI */
.swipe-instruction-container {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 24px) + 20px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 80;
  transition: opacity 0.5s ease, transform 0.5s ease;
  text-align: center;
  padding: 10px 24px;
  background: rgba(255, 252, 246, 0.72);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 30px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(60, 20, 15, 0.08);
}

.swipe-arrow-wrapper {
  margin-bottom: 4px;
  color: var(--gold-rich);
  animation: floatArrow 1.8s infinite ease-in-out;
}

.swipe-animated-arrow {
  filter: drop-shadow(0 2px 4px rgba(212, 175, 55, 0.5));
}

@keyframes floatArrow {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(-7px); opacity: 1; filter: drop-shadow(0 4px 8px rgba(212, 175, 55, 0.8)); }
}

.instruction-kannada {
  font-family: var(--font-kannada);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--maroon-primary);
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.instruction-english {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--gold-dark);
  text-transform: uppercase;
}

.instruction-progress-bar {
  width: 90px;
  height: 3px;
  background: rgba(212, 175, 55, 0.2);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--gold-foil);
  transition: width 0.1s linear;
}

/* EXPLORE CTA BUTTON (Final Presentation) */
.explore-cta-container {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 24px) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  width: 90%;
  max-width: 340px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s var(--ease-cinematic), transform 0.6s var(--ease-cinematic);
}

.explore-cta-container.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.btn-royal-explore {
  width: 100%;
  padding: 14px 24px;
  border: 1.5px solid var(--gold-primary);
  border-radius: 40px;
  background: linear-gradient(135deg, #7A1927 0%, #520D17 60%, #35080E 100%);
  color: #FFF6DF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 10px 25px rgba(88, 18, 29, 0.4),
    0 0 20px rgba(212, 175, 55, 0.3),
    inset 0 1px 1px rgba(255, 230, 160, 0.4);
  transition: all 0.35s var(--ease-cinematic);
}

.btn-royal-explore:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 14px 32px rgba(88, 18, 29, 0.5),
    0 0 30px rgba(212, 175, 55, 0.5),
    inset 0 1px 2px rgba(255, 230, 160, 0.6);
}

.btn-royal-explore:active {
  transform: scale(0.97);
}

.btn-sparkle-bg {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: var(--gold-shimmer);
  transform: skewX(-25deg);
  animation: buttonShimmer 3.2s infinite ease-in-out;
}

@keyframes buttonShimmer {
  0% { left: -100%; }
  30%, 100% { left: 200%; }
}

.btn-text-kannada {
  font-family: var(--font-kannada);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #FFF3D6;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.btn-text-english {
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 2.2px;
  color: var(--gold-highlight);
  text-transform: uppercase;
}

.btn-arrow-icon {
  position: absolute;
  right: 20px;
  color: var(--gold-primary);
  transition: transform 0.3s ease;
}

.btn-royal-explore:hover .btn-arrow-icon {
  transform: translateX(4px);
}

/* TRANSITION PLACEHOLDER MODAL */
.transition-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 10, 15, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.modal-card {
  position: relative;
  background: var(--bg-ivory);
  background-image: 
    radial-gradient(circle at 50% 20%, rgba(255,248,230,0.9), rgba(245,236,220,0.95)),
    url('../images/envelope-texture.png');
  border: 2px solid var(--gold-primary);
  border-radius: 20px;
  padding: 36px 24px 30px 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 
    0 24px 60px rgba(25, 5, 8, 0.6),
    0 0 35px rgba(212, 175, 55, 0.25);
  transform: scale(0.9);
  opacity: 0;
  animation: modalPopIn 0.5s var(--ease-elastic) forwards;
}

@keyframes modalPopIn {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-gold-mandap-icon {
  margin-bottom: 12px;
}

.modal-heading-kannada {
  font-family: var(--font-kannada);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--maroon-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.modal-subheading-english {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 16px;
}

.modal-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.divider-line {
  height: 1px;
  width: 50px;
  background: var(--gold-foil);
}

.divider-gem {
  color: var(--gold-primary);
  font-size: 0.8rem;
}

.modal-desc {
  font-family: var(--font-elegant);
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text-dark);
  margin-bottom: 18px;
}

.modal-couple-names {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--maroon-primary);
  margin-bottom: 24px;
}

.btn-modal-close {
  background: var(--maroon-primary);
  color: #FFF3D6;
  border: 1px solid var(--gold-primary);
  border-radius: 30px;
  padding: 12px 24px;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.25s ease;
  width: 100%;
}

.btn-modal-close:hover {
  background: var(--maroon-dark);
  box-shadow: 0 4px 15px rgba(107, 23, 36, 0.4);
}

/* Utilities */
.hidden {
  display: none !important;
}
