/* Core Variables & Design System */
:root {
  --font-heading: 'Playfair Display', serif;
  --font-script: 'Great Vibes', cursive;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  --primary-pink: #ff3b68;
  --primary-light: #ff7597;
  --rose-gold: #ffb3c1;
  --deep-velvet: #0e0314;
  --velvet-mid: #1d0726;
  --velvet-accent: #2e0d3b;
  --gold-glow: #ffd700;
  
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-hover: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 117, 151, 0.25);
  --glass-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  
  --text-main: #ffffff;
  --text-muted: #f3c4d4;
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: var(--font-body);
  background: radial-gradient(circle at 50% 20%, #2b0836 0%, #15031d 50%, #09010f 100%);
  color: var(--text-main);
  overflow-x: hidden;
  position: relative;
}

/* Background Canvas */
#heartCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Audio Control Fixed Header */
.audio-control-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
}

.glass-btn {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 10px 18px;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 59, 104, 0.2);
}

.glass-btn:hover {
  background: rgba(255, 59, 104, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 59, 104, 0.4);
}

.audio-btn.playing {
  background: linear-gradient(135deg, #ff3b68, #ff7597);
  border-color: transparent;
  animation: pulseAudio 2s infinite;
}

@keyframes pulseAudio {
  0%, 100% { box-shadow: 0 0 15px rgba(255, 59, 104, 0.5); }
  50% { box-shadow: 0 0 25px rgba(255, 59, 104, 0.8); }
}

/* Main Layout Wrapper */
.main-wrapper {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Glassmorphic Card Styling */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 35px 30px;
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(255, 117, 151, 0.45);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 40px 10px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 117, 151, 0.15);
  border: 1px solid rgba(255, 117, 151, 0.3);
  padding: 6px 18px;
  border-radius: 50px;
  font-size: 0.9rem;
  color: var(--rose-gold);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 25px;
  animation: float 4s ease-in-out infinite;
}

.glowing-heart-svg {
  width: 70px;
  height: 70px;
  fill: url(#heartGradient);
  filter: drop-shadow(0 0 20px rgba(255, 59, 104, 0.8));
  animation: heartbeat 1.4s ease-in-out infinite;
  margin-bottom: 20px;
}

/* Fallback color for SVG path */
.glowing-heart-svg path {
  fill: #ff3b68;
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.15); }
  28% { transform: scale(1); }
  42% { transform: scale(1.12); }
  70% { transform: scale(1); }
}

.main-title {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
  text-shadow: 0 0 30px rgba(255, 59, 104, 0.4);
}

.gradient-accent {
  background: linear-gradient(135deg, #ff7597 0%, #ff3b68 50%, #ffe3ec 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  font-family: var(--font-script);
  font-size: 1.3em;
  font-weight: normal;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.6;
  margin-bottom: 30px;
  font-weight: 300;
}

/* Buttons */
.action-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #ff3b68 0%, #ff7597 100%);
  color: #fff;
  box-shadow: 0 8px 25px rgba(255, 59, 104, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(255, 59, 104, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 117, 151, 0.2);
  transform: translateY(-3px);
  border-color: rgba(255, 117, 151, 0.5);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
  background: rgba(255, 117, 151, 0.2);
  color: #fff;
  border: 1px solid var(--glass-border);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.icon-btn:hover {
  background: var(--primary-pink);
  transform: scale(1.1);
}

/* Card Header Common */
.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.card-header h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: #fff;
}

.card-icon {
  color: var(--primary-pink);
  font-size: 1.3rem;
}

/* Timer Section */
.timer-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 25px;
}

.timer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.timer-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 117, 151, 0.15);
  border-radius: 16px;
  padding: 18px 10px;
  text-align: center;
  transition: all 0.3s ease;
}

.timer-box:hover {
  border-color: var(--primary-pink);
  transform: translateY(-2px);
}

.timer-num {
  display: block;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 59, 104, 0.5);
  font-variant-numeric: tabular-nums;
}

.timer-label {
  font-size: 0.8rem;
  color: var(--rose-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 5px;
}

/* Reasons Section */
.reason-card-display {
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed rgba(255, 117, 151, 0.3);
  border-radius: 16px;
  padding: 30px 20px;
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 20px 0;
  position: relative;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.reason-number {
  font-size: 0.85rem;
  color: var(--rose-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-weight: 600;
}

.reason-text {
  font-size: 1.15rem;
  line-height: 1.5;
  color: #fff;
  font-family: var(--font-heading);
  font-style: italic;
}

.reason-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Promises Section */
.promises-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.promise-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 22px 18px;
  transition: all 0.3s ease;
}

.promise-item:hover {
  background: rgba(255, 59, 104, 0.1);
  transform: translateY(-4px);
}

.promise-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.promise-item h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: #fff;
}

.promise-item p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Tap Banner Hint */
.tap-hint-banner {
  text-align: center;
  font-size: 0.9rem;
  color: var(--rose-gold);
  padding: 12px;
  background: rgba(255, 117, 151, 0.08);
  border: 1px border-radius;
  border-radius: 30px;
  border: 1px dashed rgba(255, 117, 151, 0.3);
  animation: pulseBanner 2.5s infinite;
}

@keyframes pulseBanner {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Footer */
.romantic-footer {
  text-align: center;
  padding-top: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 2, 12, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  position: relative;
  max-width: 550px;
  width: 100%;
  background: linear-gradient(145deg, rgba(30, 10, 38, 0.95), rgba(15, 3, 20, 0.95));
  border: 1px solid rgba(255, 117, 151, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 59, 104, 0.3);
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: #fff;
}

/* Envelope Modal Content */
.envelope-header {
  text-align: center;
  margin-bottom: 20px;
}

.envelope-heart {
  font-size: 2.5rem;
  color: var(--primary-pink);
  margin-bottom: 10px;
  filter: drop-shadow(0 0 10px rgba(255, 59, 104, 0.6));
}

.letter-title {
  font-family: var(--font-script);
  font-size: 2.2rem;
  color: var(--rose-gold);
}

.letter-body {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  line-height: 1.7;
  color: #fce4ec;
  margin-bottom: 25px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.letter-signature {
  margin-top: 10px;
  font-style: italic;
  font-size: 1.1rem;
}

.letter-signature span {
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: var(--primary-light);
  display: inline-block;
  margin-top: 5px;
}

.modal-action {
  text-align: center;
}

/* Surprise Modal Content */
.surprise-content {
  text-align: center;
  padding: 40px 30px;
}

.surprise-icon-large {
  font-size: 4rem;
  margin-bottom: 15px;
  animation: bounce 2s infinite;
}

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

.surprise-quote {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--rose-gold);
  line-height: 1.6;
  margin: 25px 0;
  padding: 15px;
  border-top: 1px solid rgba(255, 117, 151, 0.2);
  border-bottom: 1px solid rgba(255, 117, 151, 0.2);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .main-wrapper {
    padding: 20px 15px 40px;
    gap: 25px;
  }
  
  .glass-card {
    padding: 25px 18px;
    border-radius: 20px;
  }

  .action-buttons {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .timer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .audio-control-container {
    top: 15px;
    right: 15px;
  }
  
  .audio-text {
    display: none;
  }

  .glass-btn {
    padding: 10px;
    border-radius: 50%;
  }
}
