/* Romantic Proposal Web App Styles - Designed for Mahir & Maesha */

:root {
  --bg-dark: #0f051d;
  --bg-gradient: linear-gradient(135deg, #0d0211 0%, #200624 40%, #3b0936 80%, #15021a 100%);
  --primary-pink: #ff3366;
  --primary-rose: #ff6584;
  --accent-gold: #ffb703;
  --light-pink: #ffe5ec;
  --text-white: #ffffff;
  --text-dim: #f8c8dc;
  --glass-bg: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 51, 102, 0.2);
  
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-cursive: 'Dancing Script', 'Caveat', cursive;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-sans);
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  color: var(--text-white);
  line-height: 1.6;
}

/* Background Canvas */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

/* Music Floating Toggle Button */
.music-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  padding: 10px 18px;
  border-radius: 50px;
  color: var(--text-white);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.music-btn:hover {
  transform: scale(1.05);
  background: rgba(255, 51, 102, 0.3);
  border-color: var(--primary-pink);
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.5);
}

.music-btn.playing .music-icon {
  animation: spin 3s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Envelope Intro Overlay */
.envelope-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: radial-gradient(circle at center, #2e0828 0%, #0d0211 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.envelope-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
}

.envelope-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  max-width: 360px;
  width: 100%;
}

.envelope {
  position: relative;
  width: 280px;
  height: 180px;
  background: #ff4d79;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 30px rgba(255,77,121,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.4s ease;
}

.envelope:hover {
  transform: translateY(-5deg);
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 140px solid transparent;
  border-right: 140px solid transparent;
  border-top: 100px solid #e63963;
  transform-origin: top;
  transition: transform 0.6s ease;
}

.envelope.open .envelope-flap {
  transform: rotateX(180deg);
}

.envelope-paper {
  background: #ffffff;
  color: #333;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
  width: 88%;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transform: translateY(10px);
  transition: transform 0.5s ease 0.2s;
}

.envelope.open .envelope-paper {
  transform: translateY(-30px);
}

.envelope-paper h2 {
  font-family: var(--font-cursive);
  font-size: 2rem;
  color: var(--primary-pink);
  margin-bottom: 4px;
}

.envelope-paper p {
  font-size: 0.85rem;
  color: #666;
}

.envelope-heart {
  font-size: 2rem;
  animation: pulse 1.5s infinite;
}

.btn-open {
  background: linear-gradient(45deg, var(--primary-pink), var(--primary-rose));
  color: white;
  border: none;
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(255, 51, 102, 0.4);
  transition: all 0.3s ease;
}

.btn-open:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 30px rgba(255, 51, 102, 0.6);
}

/* Main Content Container */
.main-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  opacity: 1;
  transition: opacity 1s ease;
}

.main-content.hidden {
  display: none;
  opacity: 0;
}

/* Hero Section */
.hero-section {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 60px 0 40px;
}

.hero-badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  padding: 6px 18px;
  border-radius: 30px;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, var(--light-pink) 60%, var(--primary-rose) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
  line-height: 1.2;
}

.heart-pulse {
  display: inline-block;
  animation: heartBeat 1.3s infinite ease-in-out;
  -webkit-text-fill-color: initial;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.3); }
  28% { transform: scale(1); }
  42% { transform: scale(1.3); }
  70% { transform: scale(1); }
}

.hero-subtitle {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: var(--text-dim);
  max-width: 600px;
  font-weight: 400;
}

.hero-scroll-indicator {
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.down-arrow {
  font-size: 1.5rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* Common Section Styling */
.section {
  margin-bottom: 100px;
  text-align: center;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  color: #ffffff;
  margin-bottom: 8px;
}

.section-desc {
  color: var(--text-dim);
  font-size: 1rem;
  margin-bottom: 40px;
}

/* Polaroid Grid */
.polaroid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  justify-items: center;
  padding: 10px;
}

.polaroid-card {
  background: #ffffff;
  padding: 16px 16px 24px;
  border-radius: 4px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
  transform: rotate(var(--rotation, 0deg));
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 340px;
  width: 100%;
}

.polaroid-card:hover {
  transform: scale(1.05) rotate(0deg);
  z-index: 10;
  box-shadow: 0 20px 40px rgba(255, 51, 102, 0.3);
}

.polaroid-img-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 2px;
  background: #f0f0f0;
}

.polaroid-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.polaroid-card:hover img {
  transform: scale(1.08);
}

.polaroid-caption {
  margin-top: 16px;
  text-align: center;
  color: #222;
}

.polaroid-caption h3 {
  font-family: var(--font-cursive);
  font-size: 1.8rem;
  color: #d62828;
  margin-bottom: 4px;
}

.polaroid-caption p {
  font-size: 0.9rem;
  color: #555;
}

/* Reasons Cards Grid (3D Flip) */
.reasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 20px;
}

.reason-card {
  height: 220px;
  perspective: 1000px;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.reason-card.flipped .card-inner,
.reason-card:hover .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
}

.card-front {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  box-shadow: var(--glass-shadow);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.card-front p {
  font-weight: 700;
  font-size: 1.1rem;
}

.card-front small {
  color: var(--accent-gold);
  font-size: 0.75rem;
  margin-top: 6px;
}

.card-back {
  background: linear-gradient(135deg, var(--primary-pink), #b01844);
  color: white;
  transform: rotateY(180deg);
  box-shadow: 0 10px 30px rgba(255, 51, 102, 0.4);
}

.card-back p {
  font-family: var(--font-cursive);
  font-size: 1.5rem;
  line-height: 1.3;
}

/* Proposal Section */
.proposal-section {
  padding: 40px 0 100px;
  display: flex;
  justify-content: center;
}

.glass-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  padding: 50px 30px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 20px rgba(255, 51, 102, 0.15);
  width: 100%;
  max-width: 680px;
  position: relative;
}

.sparkle-ring {
  font-size: 3rem;
  margin-bottom: 8px;
  animation: pulse 2s infinite;
}

.proposal-tag {
  background: rgba(255, 183, 3, 0.2);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 0.8rem;
  padding: 4px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.proposal-question {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 24px 0 12px;
  color: #ffffff;
}

.proposal-subtext {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 36px;
}

/* Toast Badge for Dodge feedback */
.dodge-toast {
  background: linear-gradient(45deg, #ffb703, #ff8800);
  color: #000;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: inline-block;
  animation: shake 0.4s ease;
  box-shadow: 0 4px 15px rgba(255, 183, 3, 0.4);
}

.dodge-toast.hidden {
  display: none;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Proposal Action Buttons */
.proposal-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 80px;
  position: relative;
}

.btn-yes {
  background: linear-gradient(135deg, var(--primary-pink) 0%, #ff0055 100%);
  color: white;
  border: none;
  padding: 16px 40px;
  font-size: 1.25rem;
  font-weight: 800;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 51, 102, 0.6);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
  z-index: 5;
}

.btn-yes:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 40px rgba(255, 51, 102, 0.8);
}

.btn-no {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.9);
  padding: 14px 28px;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s ease-out;
  user-select: none;
}

.btn-no.dodging {
  position: fixed;
  z-index: 150;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  background: rgba(255, 51, 102, 0.8);
  border-color: #ffffff;
}

/* Victory Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(13, 2, 17, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.modal-overlay.hidden {
  display: none;
  opacity: 0;
}

.modal-card {
  background: linear-gradient(135deg, #2a0827 0%, #15021a 100%);
  border: 2px solid var(--primary-pink);
  border-radius: 28px;
  padding: 36px 24px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(255, 51, 102, 0.4);
  animation: modalZoom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalZoom {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-badge {
  background: var(--accent-gold);
  color: #000;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 16px;
}

.victory-image-wrapper {
  width: 100%;
  max-height: 380px;
  overflow: hidden;
  border-radius: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.victory-img {
  width: 100%;
  height: auto;
  max-height: 380px;
  object-fit: contain;
  border-radius: 16px;
}

.victory-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--light-pink);
  margin-bottom: 12px;
}

.victory-text {
  font-size: 1.05rem;
  color: var(--text-dim);
  margin-bottom: 28px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-screenshot {
  background: linear-gradient(135deg, var(--primary-pink) 0%, #ff6b00 100%);
  color: white;
  border: none;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(255, 51, 102, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-screenshot:hover {
  transform: scale(1.04);
  box-shadow: 0 12px 30px rgba(255, 51, 102, 0.6);
}

.btn-secondary {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--glass-border);
  padding: 12px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Footer */
.footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  padding-top: 40px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .hero-section {
    min-height: 70vh;
  }

  .proposal-card {
    padding: 30px 20px;
  }

  .proposal-actions {
    flex-direction: column;
    gap: 16px;
  }

  .btn-yes {
    width: 100%;
  }

  .btn-no {
    width: 100%;
  }
}
