/* ==========================================================================
   ROMANTIC PROPOSAL DESIGN SYSTEM
   Mobile-First • Luxury Romance • Glassmorphism • Ethereal Animations
   Parth Gundaiya to Judith Salpura
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-dark: #0A040E;
  --bg-deep-velvet: #16081F;
  --bg-card: rgba(26, 12, 36, 0.72);
  --bg-card-hover: rgba(38, 16, 52, 0.85);
  --border-glass: rgba(255, 215, 0, 0.18);
  --border-subtle: rgba(255, 117, 143, 0.15);

  /* Romantic Accents */
  --rose-primary: #FF4D6D;
  --rose-glow: #FF758F;
  --rose-deep: #C9184A;
  --rose-wine: #590D22;
  --gold-accent: #D4AF37;
  --gold-sparkle: #FDE047;
  --gold-champagne: #F3E5AB;
  
  /* Text & Surfaces */
  --text-pure: #FFFFFF;
  --text-soft: #F9EBF0;
  --text-muted: #D1B4C9;
  --text-gold: #F7D070;

  /* Typography */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-script: 'Great Vibes', cursive, 'Brush Script MT';
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Shadows & Glows */
  --shadow-card: 0 16px 40px -10px rgba(0, 0, 0, 0.7), 0 0 25px rgba(255, 77, 109, 0.15);
  --shadow-gold-glow: 0 0 25px rgba(212, 175, 55, 0.35);
  --shadow-rose-glow: 0 0 30px rgba(255, 77, 109, 0.45);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-soft);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
  background-image: 
    radial-gradient(circle at 50% 10%, rgba(201, 24, 74, 0.22) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(89, 13, 34, 0.3) 0%, transparent 60%),
    radial-gradient(circle at 20% 60%, rgba(26, 12, 36, 0.6) 0%, transparent 70%);
  background-attachment: fixed;
}

/* Fullscreen Background & Canvas Layers */
.canvas-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10;
}

#confetti-canvas {
  z-index: 999;
  display: none;
}

.bg-backdrop-img {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  opacity: 0.25;
  filter: blur(2px) brightness(0.65);
  z-index: 1;
  pointer-events: none;
}

/* Floating Audio Control */
.audio-control-float {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
}

.audio-btn {
  background: rgba(30, 10, 40, 0.75);
  border: 1px solid var(--border-glass);
  color: var(--gold-champagne);
  padding: 8px 14px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.audio-btn.playing {
  border-color: var(--rose-primary);
  box-shadow: 0 0 16px rgba(255, 77, 109, 0.4);
}

.audio-btn .sound-wave {
  display: flex;
  gap: 2.5px;
  align-items: flex-end;
  height: 12px;
}

.sound-wave span {
  width: 2.5px;
  height: 4px;
  background-color: var(--gold-champagne);
  border-radius: 2px;
  transition: height 0.2s ease;
}

.audio-btn.playing .sound-wave span:nth-child(1) {
  animation: wave 1s infinite alternate ease-in-out;
}
.audio-btn.playing .sound-wave span:nth-child(2) {
  animation: wave 1s 0.25s infinite alternate ease-in-out;
}
.audio-btn.playing .sound-wave span:nth-child(3) {
  animation: wave 1s 0.5s infinite alternate ease-in-out;
}

@keyframes wave {
  0% { height: 3px; }
  100% { height: 12px; background-color: var(--rose-primary); }
}

/* ==========================================================================
   ACT 0: THE WAX-SEALED ENVELOPE (FIRST SCREEN)
   ========================================================================== */
.envelope-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #240c31 0%, #0d0413 85%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  text-align: center;
  transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1), transform 0.9s ease;
}

.envelope-screen.opened {
  opacity: 0;
  transform: scale(1.08);
  pointer-events: none;
}

.envelope-card {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(145deg, rgba(42, 18, 56, 0.95), rgba(20, 7, 28, 0.98));
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  border-radius: 20px;
  padding: 40px 24px 32px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 35px rgba(212, 175, 55, 0.2);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(15px);
}

.envelope-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-accent), transparent);
}

.envelope-tag {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-accent);
  margin-bottom: 12px;
  opacity: 0.9;
}

.envelope-title {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 500;
  color: var(--text-pure);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.envelope-subtitle {
  font-family: var(--font-script);
  font-size: 2.2rem;
  color: var(--rose-glow);
  margin-bottom: 24px;
  line-height: 1;
}

.envelope-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.envelope-meta .dest {
  color: var(--gold-champagne);
  font-style: italic;
  font-size: 0.92rem;
}

/* Wax Seal Button */
.wax-seal-wrapper {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  margin-bottom: 16px;
}

.wax-seal {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FF4D6D 0%, #A30826 60%, #4D020F 100%);
  border: 2px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 77, 109, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #FFE6E9;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: pulse-seal 2.5s infinite ease-in-out;
}

.wax-seal:hover, .wax-seal:active {
  transform: scale(1.08);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 35px rgba(255, 77, 109, 0.75);
}

.wax-seal.broken {
  transform: scale(0.6) rotate(25deg);
  opacity: 0;
}

.seal-monogram {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #FFF;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.seal-heart {
  font-size: 0.75rem;
  margin-top: -2px;
}

.wax-seal-hint {
  font-size: 0.8rem;
  color: var(--text-gold);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 10px;
  animation: fade-hint 1.8s infinite alternate ease-in-out;
}

@keyframes pulse-seal {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 77, 109, 0.4); }
  50% { transform: scale(1.04); box-shadow: 0 0 35px rgba(255, 77, 109, 0.7), 0 0 15px rgba(212, 175, 55, 0.4); }
}

@keyframes fade-hint {
  0% { opacity: 0.5; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(3px); }
}

/* ==========================================================================
   PROPOSAL MAIN CONTENT
   ========================================================================== */
.proposal-container {
  display: none;
  opacity: 0;
  transition: opacity 1s ease;
  position: relative;
  z-index: 20;
  max-width: 480px;
  margin: 0 auto;
  padding: 30px 18px 120px;
}

.proposal-container.active {
  display: block;
  opacity: 1;
}

/* Romantic Header */
.letter-header {
  text-align: center;
  padding: 40px 10px 24px;
}

.letter-header .from-to-badge {
  display: inline-block;
  padding: 6px 18px;
  background: rgba(255, 77, 109, 0.12);
  border: 1px solid rgba(255, 77, 109, 0.3);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--rose-glow);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.letter-header h1 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--text-pure);
  line-height: 1.25;
  margin-bottom: 8px;
}

.letter-header .script-sub {
  font-family: var(--font-script);
  font-size: 2.5rem;
  color: var(--gold-accent);
  line-height: 1;
  display: block;
}

/* Story Cards / Chapters */
.story-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 30px 22px;
  margin-bottom: 24px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transform: translateY(25px);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.8s ease;
}

.story-card.in-view {
  transform: translateY(0);
  opacity: 1;
}

.story-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--border-glass), transparent);
}

.chapter-number {
  font-size: 0.72rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold-accent);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chapter-number::after {
  content: '';
  height: 1px;
  flex: 1;
  background: rgba(212, 175, 55, 0.2);
}

.story-card h2, .story-card h3 {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--text-pure);
  margin-bottom: 14px;
  line-height: 1.3;
}

.story-card p {
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 14px;
  font-weight: 300;
}

.story-card p:last-child {
  margin-bottom: 0;
}

.story-card .highlight-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--gold-champagne);
  border-left: 2px solid var(--rose-primary);
  padding-left: 14px;
  margin: 18px 0;
  line-height: 1.6;
}

.tagalog-touch {
  color: var(--rose-glow);
  font-weight: 500;
  font-style: italic;
}

/* Act 4: The Ring & Proposal Grand Finale */
.proposal-grand-card {
  background: linear-gradient(160deg, rgba(46, 17, 62, 0.95), rgba(18, 6, 26, 0.98));
  border: 1.8px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(212, 175, 55, 0.25);
  text-align: center;
  padding: 36px 20px 32px;
}

.ring-image-wrapper {
  width: 140px;
  height: 140px;
  margin: 0 auto 20px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold-accent);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.4), 0 8px 20px rgba(0, 0, 0, 0.6);
  position: relative;
}

.ring-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.proposal-grand-card:hover .ring-image-wrapper img {
  transform: scale(1.05);
}

.the-question-heading {
  font-family: var(--font-serif);
  font-size: 1.95rem;
  font-weight: 700;
  color: #FFF;
  margin-bottom: 6px;
  line-height: 1.25;
}

.the-question-name {
  font-family: var(--font-script);
  font-size: 2.8rem;
  color: var(--rose-glow);
  line-height: 1.1;
  margin-bottom: 12px;
  text-shadow: 0 0 15px rgba(255, 77, 109, 0.4);
}

.marriage-promise-line {
  font-size: 0.98rem;
  color: var(--text-soft);
  max-width: 320px;
  margin: 0 auto 28px;
  font-weight: 300;
}

/* ==========================================================================
   BUTTONS INTERACTIVE AREA & DODGING REJECT MECHANIC
   ========================================================================== */
.buttons-area {
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 10px;
  padding: 15px 0 25px;
}

/* Primary "YES" Button */
.btn-yes {
  width: 100%;
  max-width: 320px;
  background: linear-gradient(135deg, #FF4D6D 0%, #C9184A 50%, #9D0208 100%);
  color: #FFF;
  border: 1.5px solid rgba(255, 215, 0, 0.4);
  border-radius: 35px;
  padding: 16px 24px;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(201, 24, 74, 0.5), 0 0 20px rgba(255, 77, 109, 0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  z-index: 5;
}

.btn-yes::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent,
    rgba(255, 255, 255, 0.25),
    transparent
  );
  transform: rotate(30deg);
  animation: shine-yes 3s infinite;
}

@keyframes shine-yes {
  0% { transform: translateX(-100%) rotate(30deg); }
  25%, 100% { transform: translateX(100%) rotate(30deg); }
}

.btn-yes:active {
  transform: scale(0.96);
}

/* Reject / Smart Evading Button */
.btn-reject {
  width: auto;
  min-width: 200px;
  max-width: 310px;
  background: rgba(35, 14, 48, 0.85);
  color: var(--text-muted);
  border: 1px solid rgba(255, 117, 143, 0.3);
  border-radius: 30px;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 400;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
  user-select: none;
  touch-action: manipulation;
  z-index: 10;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-reject.dodging {
  animation: reject-shake 0.3s ease;
}

@keyframes reject-shake {
  0%, 100% { transform: scale(0.96); }
  35% { transform: scale(0.92) rotate(-3deg); }
  70% { transform: scale(0.94) rotate(3deg); }
}

/* Transformed "I Need Time To Think" State */
.btn-reject.morphed-think {
  background: linear-gradient(135deg, rgba(72, 202, 228, 0.15), rgba(155, 93, 229, 0.2));
  border: 1.5px solid rgba(72, 202, 228, 0.45);
  color: #CAF0F8;
  font-weight: 500;
  padding: 14px 26px;
  box-shadow: 0 6px 20px rgba(72, 202, 228, 0.25);
  animation: gentle-glow 2s infinite alternate ease-in-out;
}

@keyframes gentle-glow {
  0% { box-shadow: 0 4px 15px rgba(72, 202, 228, 0.2); }
  100% { box-shadow: 0 6px 25px rgba(155, 93, 229, 0.35); }
}

.reassurance-note {
  font-size: 0.82rem;
  color: var(--text-gold);
  margin-top: 14px;
  font-style: italic;
  opacity: 0.85;
}

/* ==========================================================================
   MODALS: "NEED TIME TO THINK" & "YES CELEBRATION"
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 3, 14, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(160deg, #250E34 0%, #12051C 100%);
  border: 1.5px solid var(--border-glass);
  border-radius: 24px;
  padding: 32px 22px 24px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(255, 77, 109, 0.25);
  transform: translateY(30px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.modal-close-top {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  font-size: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close-top:hover, .modal-close-top:active {
  background: rgba(255, 77, 109, 0.25);
  color: #FFF;
}

.modal-backdrop.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
  display: inline-block;
  animation: float-icon 2.5s infinite ease-in-out;
}

@keyframes float-icon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.modal-card h3 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--text-pure);
  margin-bottom: 8px;
}

.modal-card .modal-subtitle {
  font-family: var(--font-script);
  font-size: 2.2rem;
  color: var(--gold-accent);
  line-height: 1;
  margin-bottom: 18px;
}

.modal-card p {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 20px;
  font-weight: 300;
}

/* Note Input Box */
.think-input-area {
  margin: 18px 0;
  text-align: left;
}

.think-input-area label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-gold);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.think-textarea {
  width: 100%;
  height: 90px;
  background: rgba(14, 5, 20, 0.7);
  border: 1px solid rgba(255, 117, 143, 0.25);
  border-radius: 12px;
  padding: 12px;
  color: #FFF;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  resize: none;
  outline: none;
  transition: border-color 0.3s;
}

.think-textarea:focus {
  border-color: var(--rose-primary);
  box-shadow: 0 0 10px rgba(255, 77, 109, 0.3);
}

.btn-action-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--rose-primary), var(--rose-deep));
  color: #FFF;
  border: none;
  border-radius: 25px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  box-shadow: 0 8px 20px rgba(201, 24, 74, 0.4);
  transition: transform 0.2s;
}

.btn-action-primary:active {
  transform: scale(0.97);
}

.btn-whatsapp-direct {
  width: 100%;
  background: #25D366;
  color: #0B2912;
  border: none;
  border-radius: 25px;
  padding: 13px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35);
  transition: transform 0.2s;
}

.btn-whatsapp-direct:active {
  transform: scale(0.97);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 8px;
  text-decoration: underline;
}

/* Submitted confirmation pill */
.submitted-pill {
  display: none;
  background: rgba(46, 196, 182, 0.15);
  border: 1px solid rgba(46, 196, 182, 0.4);
  color: #2EC4B6;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  margin-bottom: 14px;
}

/* Footer Details */
.proposal-footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px 10px;
  border-top: 1px solid rgba(255, 215, 0, 0.15);
}

.footer-names {
  font-family: var(--font-script);
  font-size: 2.2rem;
  color: var(--gold-accent);
  margin-bottom: 6px;
}

.footer-location {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.footer-tracker-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 8px;
}

.footer-tracker-link:hover {
  color: var(--text-gold);
}
