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

html {
  height: 100%;
  height: -webkit-fill-available;
}

body {
  font-family: "Montserrat", sans-serif;
  background: linear-gradient(-45deg, #ff9a9e, #fad0c4, #fecfef, #fbc2eb);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Background Effects */
.background-effects {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

/* Glassmorphism Container */
.container {
  padding: 2rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
  max-width: 90%;
  width: 500px;
  max-height: 95vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  transition: all 0.5s ease;
  position: relative;
  z-index: 10;
}

.container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Typography */
h1 {
  font-family: "Great Vibes", cursive;
  font-size: 2.8rem;
  margin-bottom: 0.8rem;
  background: linear-gradient(135deg, #ff4d6d, #d6336c, #c2255c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 4px rgba(214, 51, 108, 0.3));
}

/* Fix emoji display in gradient text */
h1 .emoji,
.romantic-text .emoji {
  -webkit-text-fill-color: initial;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
}

/* Question heading gentle pulse */
.bounce-text {
  animation: gentlePulse 2s ease-in-out infinite;
}

@keyframes gentlePulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.03);
  }
}

/* Success heading shimmer */
.romantic-text {
  background: linear-gradient(
    90deg,
    #ff4d6d,
    #ff758f,
    #ffb3c1,
    #ff758f,
    #ff4d6d
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0% {
    background-position: 0% center;
  }

  100% {
    background-position: 200% center;
  }
}

p.love-note {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.8;
  color: #5c2340;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.8),
    rgba(255, 204, 213, 0.5)
  );
  padding: 1.2rem 1.5rem;
  border-radius: 15px;
  margin-top: 0.8rem;
  box-shadow:
    0 4px 15px rgba(255, 77, 109, 0.15),
    inset 0 1px 3px rgba(255, 255, 255, 0.6);
  border-left: 4px solid #ff4d6d;
  letter-spacing: 0.5px;
  text-align: center;
  text-wrap: balance;
  /* Slide-up animation */
  opacity: 0;
  transform: translateY(60px);
  transition: none;
}

p.love-note.animate-in {
  animation: slideUpNote 0.8s ease-out forwards;
}

@keyframes slideUpNote {
  0% {
    opacity: 0;
    transform: translateY(60px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Images */
.gif-container img,
.image-container img {
  max-width: 100%;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 0.8rem;
  max-height: 180px;
  object-fit: cover;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.gif-container,
.image-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Button Styling */
.buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  position: relative;
  /* Create a stable area for buttons so flow doesn't break */
  min-height: 60px;
}

.btn {
  padding: 12px 35px;
  font-size: 1.2rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
  position: relative;
  z-index: 5;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.yes-btn {
  background: linear-gradient(45deg, #ff6b6b, #ff8787);
  color: white;
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%,
  100% {
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
  }

  50% {
    box-shadow:
      0 4px 25px rgba(255, 107, 107, 0.6),
      0 0 40px rgba(255, 107, 107, 0.2);
  }
}

.yes-btn:hover {
  transform: scale(1.05) translateY(-3px);
  box-shadow: 0 8px 30px rgba(255, 107, 107, 0.5);
}

.no-btn {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  color: #c2255c;
  font-weight: 700;
  border: 2px solid #ffb3c1;
  transition:
    transform 0.2s,
    top 0.4s ease,
    left 0.4s ease;
  box-shadow: 0 4px 12px rgba(194, 37, 92, 0.15);
  z-index: 100 !important;
}

.no-btn:hover {
  background: linear-gradient(135deg, #ffe0e6, #ffb3c1);
  box-shadow: 0 6px 18px rgba(194, 37, 92, 0.25);
}

/* 3D Heart Animation */
.heart-3d-container {
  perspective: 1000px;
  width: 70px;
  height: 70px;
  margin: 0 auto 10px;
  position: relative;
}

.heart-3d {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: heartBeat 1.5s infinite;
}

.heart-3d::before,
.heart-3d::after {
  content: "";
  position: absolute;
  left: 35px;
  top: 0;
  width: 35px;
  height: 56px;
  background: #ff4d6d;
  border-radius: 35px 35px 0 0;
  transform: rotate(-45deg);
  transform-origin: 0 100%;
  box-shadow: inset -5px -5px 15px rgba(0, 0, 0, 0.1);
}

.heart-3d::after {
  left: 0;
  transform: rotate(45deg);
  transform-origin: 100% 100%;
}

@keyframes heartBeat {
  0% {
    transform: scale(1);
  }

  14% {
    transform: scale(1.3);
  }

  28% {
    transform: scale(1);
  }

  42% {
    transform: scale(1.3);
  }

  70% {
    transform: scale(1);
  }
}

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

/* Floating Hearts Background (Dynamic) */
.heart {
  position: absolute;
  width: 15px;
  height: 15px;
  background-color: var(--c, #ff4d6d);
  transform: rotate(45deg);
  opacity: 0;
  z-index: 0;
  animation: floatUp linear forwards;
}

.heart::before,
.heart::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: var(--c, #ff4d6d);
}

.heart::before {
  top: -7.5px;
  left: 0;
}

.heart::after {
  top: 0;
  left: -7.5px;
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) rotate(45deg) scale(0.5);
    opacity: 0;
  }

  20% {
    opacity: 0.8;
  }

  100% {
    transform: translateY(-100px) rotate(45deg) scale(1.2);
    opacity: 0;
  }
}

/* Love Blast Animation */
.blast-heart {
  position: fixed;
  width: 20px;
  height: 20px;
  background-color: var(--c, #ff4d6d);
  transform: rotate(45deg);
  z-index: 9999;
  pointer-events: none;
  animation: blastOut var(--duration, 1s) cubic-bezier(0.25, 0.46, 0.45, 0.94)
    forwards;
}

.blast-heart::before,
.blast-heart::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--c, #ff4d6d);
}

.blast-heart::before {
  top: -50%;
  left: 0;
}

.blast-heart::after {
  top: 0;
  left: -50%;
}

@keyframes blastOut {
  0% {
    transform: rotate(45deg) scale(0);
    opacity: 1;
  }
  20% {
    transform: rotate(45deg) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: rotate(45deg) translateX(var(--tx)) translateY(var(--ty))
      scale(0.3);
    opacity: 0;
  }
}

/* Sparkle effect */
.sparkle {
  position: fixed;
  width: 8px;
  height: 8px;
  background: radial-gradient(circle, #fff 0%, #ffb3c1 50%, transparent 70%);
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none;
  animation: sparkleOut var(--duration, 0.8s) ease-out forwards;
}

@keyframes sparkleOut {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 1;
  }
  100% {
    transform: translateX(var(--tx)) translateY(var(--ty)) scale(0);
    opacity: 0;
  }
}

/* ==================== MOBILE RESPONSIVE STYLES ==================== */

/* Tablets and smaller desktops */
@media screen and (max-width: 768px) {
  .container {
    padding: 1.5rem;
    width: 92%;
    max-width: 420px;
    border-radius: 16px;
  }

  h1 {
    font-size: 2.2rem;
    margin-bottom: 0.6rem;
  }

  .btn {
    padding: 10px 28px;
    font-size: 1rem;
  }

  .buttons {
    gap: 15px;
    flex-wrap: wrap;
  }

  p.love-note {
    font-size: 0.85rem;
    padding: 1rem 1.2rem;
    line-height: 1.7;
  }

  .gif-container img,
  .image-container img {
    max-height: 150px;
  }

  .heart-3d-container {
    width: 60px;
    height: 60px;
  }

  .heart-3d::before,
  .heart-3d::after {
    width: 30px;
    height: 48px;
    left: 30px;
    border-radius: 30px 30px 0 0;
  }

  .heart-3d::after {
    left: 0;
  }

  .pookie-label {
    font-size: 1rem;
  }

  .pookie-subtext {
    font-size: 0.9rem;
  }

  .pookie-excited {
    font-size: 0.95rem;
  }
}

/* Mobile phones */
@media screen and (max-width: 480px) {
  body {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    padding: 10px;
  }

  .container {
    padding: 1.2rem 1rem;
    width: 95%;
    max-width: 360px;
    border-radius: 14px;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .container::-webkit-scrollbar {
    display: none;
  }

  h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
  }

  .btn {
    padding: 10px 22px;
    font-size: 0.95rem;
    border-radius: 40px;
  }

  .buttons {
    gap: 12px;
    min-height: 50px;
  }

  p.love-note {
    font-size: 0.8rem;
    padding: 0.9rem 1rem;
    line-height: 1.6;
    margin-top: 0.6rem;
    border-radius: 12px;
  }

  .gif-container img,
  .image-container img {
    max-height: 120px;
    border-radius: 12px;
    margin-bottom: 0.6rem;
  }

  .heart-3d-container {
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
  }

  .heart-3d::before,
  .heart-3d::after {
    width: 25px;
    height: 40px;
    left: 25px;
    border-radius: 25px 25px 0 0;
  }

  .heart-3d::after {
    left: 0;
  }

  /* Smaller floating hearts on mobile */
  .heart {
    width: 10px;
    height: 10px;
  }

  .heart::before,
  .heart::after {
    width: 10px;
    height: 10px;
  }

  .heart::before {
    top: -5px;
  }

  .heart::after {
    left: -5px;
  }

  /* Smaller blast hearts on mobile */
  .blast-heart {
    width: 12px;
    height: 12px;
  }

  .sparkle {
    width: 6px;
    height: 6px;
  }
}

/* Very small phones */
@media screen and (max-width: 360px) {
  .container {
    padding: 1rem 0.8rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .btn {
    padding: 8px 18px;
    font-size: 0.85rem;
  }

  p.love-note {
    font-size: 0.75rem;
    padding: 0.8rem;
  }

  .gif-container img,
  .image-container img {
    max-height: 100px;
  }
}

/* Landscape mode on mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .container {
    max-height: 95vh;
    padding: 0.8rem 1.5rem;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .container::-webkit-scrollbar {
    display: none;
  }

  h1 {
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
  }

  .gif-container img,
  .image-container img {
    max-height: 80px;
  }

  .heart-3d-container {
    width: 40px;
    height: 40px;
    margin-bottom: 5px;
  }

  p.love-note {
    padding: 0.6rem 0.8rem;
    font-size: 0.75rem;
    margin-top: 0.4rem;
  }

  .buttons {
    min-height: 40px;
  }

  .btn {
    padding: 8px 18px;
    font-size: 0.85rem;
  }
}
