/* -------------------------------
   Global Styles
--------------------------------*/
@import url('https://fonts.googleapis.com/css2?family=Crafty+Girls&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Crafty Girls', cursive;
}

/* Ensure full coverage background */
html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Unified Body Styling */
body {
  background: url("images/background_hearts.jpg") no-repeat center center fixed;
  background-size: cover;
  background-color: #dce6ee; /* fallback color if image doesn't load */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #444;
  position: relative;
  padding: 20px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Optional: soft overlay to match the aesthetic */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(255, 255, 255, 0.25); /* soft tint */
  z-index: 0;
  pointer-events: none;
}

/* Ensure all main containers are above the overlay */
.container, .page, .letter-content, .gallery-content {
  position: relative;
  z-index: 1;
}

.welcome-text {
  margin-bottom: 50px;
}

.pretty-button {
  background-color: #ffb6c1;
  color: #fff;
  border: none;
  border-radius: 40px;
  padding: 14px 38px;
  font-size: 1.2rem;
  font-family: 'Crafty Girls', cursive;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.pretty-button:hover {
  background-color: #ff99aa;
  transform: scale(1.05);
}

.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.center-image {
  width: 280px;
  max-width: 70%;
  margin-bottom: 25px;
  display: block;
}

/* Each page takes full height */
.page {
  min-height: 100vh;
  width: 100vw;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.8s ease-in-out;
}

h1, h2, h3, p {
  color: #4e3a4a;
}

/* Continue buttons */
button.continue {
  margin-top: 30px;
  padding: 12px 28px;
  background-color: #ffb6c1;
  border: none;
  border-radius: 25px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

button.continue:hover {
  transform: scale(1.05);
  background-color: #ffa6b3;
}

/* Hint text */
.hint {
  position: absolute;
  bottom: 20px;
  right: 20px;
  font-size: 1rem;
  color: #555;
  animation: fadeIn 2s ease-in-out forwards;
}

.flowers-container .heart {
  position: absolute;
  width: 65px;
  height: 65px;
  background: url('images/heart.png') no-repeat center/contain;
  cursor: pointer;
  transition: transform 0.3s ease;
  z-index: 2;
}


/* Heart and bubble styles */
.heart {
  position: absolute;
  font-size: 2.2rem;
  cursor: pointer;
  transition: transform 0.3s ease, color 0.3s ease;
}

.heart.clicked {
  transform: scale(1.4);
  color: #ff4976;
}

/* Bubble text */
.bubble {
  position: absolute;
  background-color: rgba(255, 255, 255, 0.96);
  border-radius: 12px;
  padding: 12px 16px;
  width: auto;
  max-width: 340px;
  min-width: 220px;
  font-size: 1rem;
  color: #333;
  z-index: 30;
  animation: fadeIn 0.25s ease;
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
  display: inline-block;
  white-space: normal;
  line-height: 1.35;
  top: 50%;
  transform: translateY(-50%);
}

.bubble::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  top: 50%;
  transform: translateY(-50%);
  z-index: 29;
}

.bubble.point-left::after {
  left: -16px;
  border-right-color: rgba(255,255,255,0.96);
}

.bubble.point-right::after {
  right: -16px;
  border-left-color: rgba(255,255,255,0.96);
}

/* Gallery */
.gallery-content {
  text-align: center;
  padding: 40px 20px 80px 20px;
  min-height: 100vh;
  display: block;
  overflow-y: auto;
  box-sizing: border-box;
}

.gallery-subtitle {
  margin-bottom: 30px;
  font-size: 1.1rem;
  color: #555;
}

.gallery-grid {
  columns: 3 200px;
  column-gap: 15px;
  max-width: 1000px;
  margin: 0 auto 40px auto;
}

.gallery-grid img {
  width: 100%;
  margin-bottom: 15px;
  border-radius: 16px;
  display: block;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-grid img:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .gallery-grid {
    columns: 2 150px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    columns: 1 100%;
  }
}

/* Letter Box */
.letter {
  background: rgba(255,255,255,0.8);
  border-radius: 20px;
  padding: 30px;
  width: 80%;
  max-width: 700px;
  line-height: 1.6;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

#music-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  background: rgba(255,255,255,0.7);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  font-size: 1.4rem;
}

/* Animations */
@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}

/* Letter Page */
body.letter-page {
  display: block;
  overflow-y: auto;
}

.letter-content {
  text-align: center;
  padding: 60px 20px;
}

.letter-box {
  background-color: #fffdf9;
  border: 2px solid #e0dcd3;
  border-radius: 20px;
  max-width: 700px;
  margin: 40px auto;
  padding: 40px 50px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  text-align: left;
  font-family: 'Homemade Apple', cursive;
  font-size: 18px;
  line-height: 1.8;
  color: #4a4a4a;
}

.letter-content .pretty-button {
  display: block;
  margin: 30px auto 0 auto;
}
