/* ===================================================
   ROMANTIC HEART CONFESSION WEBSITE - STYLESHEET
   =================================================== */

:root {
  --primary-color: #ff3366;
  --primary-glow: rgba(255, 51, 102, 0.6);
  --secondary-color: #ff6b8b;
  --accent-gold: #ffd166;
  --bg-dark: #080311;
  --bg-cosmic-1: #150522;
  --bg-cosmic-2: #240a2f;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-glow: rgba(255, 105, 180, 0.25);
  --text-main: #ffffff;
  --text-muted: #e2cce4;
  --font-romantic: 'Dancing Script', 'Great Vibes', 'Segoe Script', 'Brush Script MT', 'Pacifico', cursive;
  --font-sans: 'Quicksand', 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-sans);
  color: var(--text-main);
  background: radial-gradient(circle at 50% 40%, var(--bg-cosmic-2) 0%, var(--bg-cosmic-1) 50%, var(--bg-dark) 100%);
  position: relative;
}

/* ================= Canvas Layers ================= */
#bg-canvas, #heart-canvas, #fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#bg-canvas {
  z-index: 1; /* Floating stars, nebula, gentle embers */
}

#heart-canvas {
  z-index: 2; /* 3D Parametric Pulsing Heart */
}

#fx-canvas {
  z-index: 4; /* Cursor sparkles & fireworks celebration */
  pointer-events: none;
}

/* Ambient Glow */
.ambient-glow {
  position: fixed;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 51, 102, 0.25) 0%, rgba(255, 107, 139, 0.08) 50%, transparent 75%);
  filter: blur(60px);
  z-index: 1;
  pointer-events: none;
  animation: ambientPulse 4s ease-in-out infinite alternate;
}

@keyframes ambientPulse {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

/* ================= Audio & Control Bar ================= */
.audio-control-bar {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 12px;
  z-index: 20;
}

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

.glass-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 107, 139, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 51, 102, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.icon-btn .pulse-icon {
  display: inline-block;
  animation: spinSlow 6s linear infinite;
}

.icon-btn.paused .pulse-icon {
  animation-play-state: paused;
  filter: grayscale(1);
}

@keyframes spinSlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ================= Intro Screen ================= */
.intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 3, 17, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  visibility: hidden;
}

.intro-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.glass-panel {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px var(--glass-glow), inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.intro-card {
  padding: 40px 30px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  animation: popIn 0.8s var(--ease-spring);
}

@keyframes popIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.intro-heart-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
  display: inline-block;
  animation: heartFloat 2s ease-in-out infinite alternate;
}

@keyframes heartFloat {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-10px) scale(1.1); filter: drop-shadow(0 0 15px #ff3366); }
}

.intro-title {
  font-family: var(--font-romantic);
  font-size: 2.4rem;
  margin-bottom: 10px;
  color: #fff;
  text-shadow: 0 0 15px rgba(255, 51, 102, 0.8);
}

.intro-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 25px;
}

.intro-tip {
  margin-top: 15px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
}

/* ================= Main UI Container ================= */
.main-container {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 80px 20px 40px;
  pointer-events: none; /* Let canvas capture mouse unless on interactive cards */
}

.header-section {
  text-align: center;
  pointer-events: auto;
  max-width: 650px;
  animation: fadeInDown 1.2s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-25px); }
  to { opacity: 1; transform: translateY(0); }
}

.badge-tag {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255, 51, 102, 0.2);
  border: 1px solid rgba(255, 51, 102, 0.5);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: #ff9ebb;
  margin-bottom: 10px;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(255, 51, 102, 0.3);
}

.receiver-name {
  font-family: var(--font-romantic);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  text-shadow: 0 0 20px rgba(255, 51, 102, 0.8), 0 0 40px rgba(255, 107, 139, 0.5);
  margin-bottom: 8px;
}

.sub-greeting {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Hint */
.heart-hint {
  pointer-events: none;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 18px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  margin: 15px 0;
  animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.6; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.02); }
}

/* ================= Confession Letter & Question ================= */
.confession-section {
  width: 100%;
  max-width: 580px;
  pointer-events: auto;
  margin-top: auto;
  margin-bottom: 25px;
}

.letter-card {
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.letter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
  padding-bottom: 12px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: #ff9ebb;
}

.letter-header .stamp {
  font-weight: 700;
  letter-spacing: 1px;
}

.letter-header .date {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.letter-body {
  min-height: 75px;
  margin-bottom: 20px;
}

.typewriter-text {
  font-family: var(--font-romantic);
  font-size: 1.55rem;
  line-height: 1.55;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  white-space: pre-line;
}

.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background-color: #ff3366;
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 0.8s infinite;
}

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

/* Question & Buttons */
.question-container {
  text-align: center;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.question-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 18px;
  text-shadow: 0 0 12px rgba(255, 107, 139, 0.6);
}

.decision-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  position: relative;
  min-height: 60px;
}

/* Big Glowing Action Button */
.glow-button {
  background: linear-gradient(135deg, #ff3366, #ff6b8b);
  border: none;
  border-radius: 30px;
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 25px rgba(255, 51, 102, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.4);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.glow-button:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 35px rgba(255, 51, 102, 0.85), inset 0 1px 3px rgba(255, 255, 255, 0.6);
}

.glow-button.main-btn {
  padding: 16px 36px;
  font-size: 1.15rem;
}

.glow-button.mini-btn {
  padding: 10px 24px;
  font-size: 0.95rem;
}

/* Choice Buttons */
.choice-btn {
  position: relative;
  padding: 14px 30px;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  outline: none;
}

.yes-glow {
  background: linear-gradient(135deg, #ff1493, #ff4d6d);
  color: #fff;
  box-shadow: 0 4px 25px rgba(255, 20, 147, 0.6), 0 0 15px rgba(255, 105, 180, 0.4);
  animation: yesHeartbeat 1.6s infinite ease-in-out;
}

.yes-glow:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 6px 35px rgba(255, 20, 147, 0.9), 0 0 25px rgba(255, 255, 255, 0.6);
}

@keyframes yesHeartbeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.08); }
  28% { transform: scale(1); }
  42% { transform: scale(1.06); }
  70% { transform: scale(1); }
}

.no-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #e2cce4;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 5;
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.2s ease;
}

/* Extra Floating Action Pills */
.floating-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  pointer-events: auto;
  z-index: 10;
}

.pill-btn {
  padding: 9px 18px;
  font-size: 0.85rem;
  border-radius: 25px;
}

/* ================= Modals ================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 3, 17, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

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

.modal-box {
  position: relative;
  padding: 35px 28px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  animation: modalIn 0.4s var(--ease-spring);
}

@keyframes modalIn {
  from { transform: scale(0.85) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

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

.modal-close-btn:hover {
  color: #ff3366;
}

.modal-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.modal-title {
  font-family: var(--font-romantic);
  font-size: 2.2rem;
  color: #fff;
  margin-bottom: 12px;
  text-shadow: 0 0 15px rgba(255, 51, 102, 0.7);
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.reason-content-box {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  margin-bottom: 20px;
}

.reason-text {
  font-family: var(--font-romantic);
  font-size: 1.45rem;
  color: #ffd166;
  line-height: 1.45;
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.4);
}

/* ================= Celebration Modal ================= */
.celebration-screen .celebration-card {
  max-width: 540px;
  width: 90%;
  padding: 40px 30px;
  text-align: center;
}

.big-celebration-heart {
  font-size: 4.5rem;
  animation: celebrationHeart 1s infinite alternate ease-in-out;
  display: inline-block;
  margin-bottom: 10px;
}

@keyframes celebrationHeart {
  0% { transform: scale(1); filter: drop-shadow(0 0 10px #ff1493); }
  100% { transform: scale(1.25); filter: drop-shadow(0 0 30px #ff3366); }
}

.celebration-title {
  font-family: var(--font-romantic);
  font-size: 2.8rem;
  color: #fff;
  text-shadow: 0 0 20px #ff3366;
  margin-bottom: 15px;
}

.celebration-text {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 25px;
}

.love-counter-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 51, 102, 0.3);
  border-radius: 20px;
  padding: 16px 20px;
  margin-bottom: 25px;
  box-shadow: inset 0 0 20px rgba(255, 51, 102, 0.15);
}

.counter-label {
  display: block;
  font-size: 0.85rem;
  color: #ff9ebb;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.counter-timer {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.time-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 55px;
}

.time-col span {
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffd166;
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.7);
}

.time-col label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.forever-text {
  font-family: var(--font-romantic);
  font-size: 1.6rem;
  color: #ff758c;
  margin-bottom: 15px;
}

/* ================= Customizer Modal Form ================= */
.customize-box {
  max-width: 520px;
  text-align: left;
}

.customize-box .modal-title,
.customize-box .modal-icon,
.customize-box .modal-desc {
  text-align: center;
}

.custom-form .form-group {
  margin-bottom: 15px;
}

.custom-form label {
  display: block;
  font-size: 0.85rem;
  color: #ff9ebb;
  margin-bottom: 6px;
  font-weight: 600;
}

.custom-form input,
.custom-form textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-form input:focus,
.custom-form textarea:focus {
  border-color: #ff3366;
  box-shadow: 0 0 12px rgba(255, 51, 102, 0.5);
}

.custom-form .form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.custom-form .form-actions button {
  flex: 1;
  padding: 12px;
}

/* ================= Toast Notification ================= */
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(255, 51, 102, 0.92);
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s var(--ease-spring), opacity 0.3s;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ================= Responsive Queries ================= */
@media (max-width: 600px) {
  .receiver-name {
    font-size: 2.2rem;
  }

  .sub-greeting {
    font-size: 0.95rem;
  }

  .typewriter-text {
    font-size: 1.35rem;
  }

  .main-container {
    padding: 70px 15px 30px;
  }

  .audio-control-bar {
    top: 15px;
    right: 15px;
  }

  .audio-control-bar .btn-text {
    display: none;
  }

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

  .choice-btn {
    padding: 12px 22px;
    font-size: 0.95rem;
  }

  .counter-timer {
    gap: 8px;
  }

  .time-col {
    min-width: 44px;
  }

  .time-col span {
    font-size: 1.4rem;
  }

  .celebration-title {
    font-size: 2.2rem;
  }
}
