:root {
  --primary-color: #4a9eca;
  --secondary-color: #e6f3ff;
  --accent-color: #87ceeb;
  --text-color: #333;
  --light-text: #fff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Scrollbar invisible */
::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

body {
  font-family: "Montserrat", sans-serif;
  background-image: url("/img/bg.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed; /* To make the background fixed when scrolling */
  color: var(--text-color);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
  display: none;
}

/* Sobre animado */
.envelope-container {
  position: relative;
  z-index: 10;
  cursor: pointer;
  transition: all 0.3s ease;
}

.envelope-text-top {
  position: absolute;
  top: -60px; /* Reverted to original position as per user feedback */
  left: 50%;
  transform: translateX(-50%);
  font-family: "Dancing Script", cursive;
  font-size: 2.2rem;
  color: var(--primary-color);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  pointer-events: none; /* Allow clicks to pass through to the envelope */
  z-index: 11;
}

.envelope-text-middle {
  position: absolute;
  top: 85%; /* Further adjusted to move "Mis XV" text down */
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Dancing Script", cursive;
  font-size: 3rem;
  color: var(--light-text);
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
  z-index: 3; /* Above the back, below the flap */
  pointer-events: none;
}

.envelope {
  width: 320px;
  height: 220px;
  position: relative;
  filter: drop-shadow(0 15px 35px rgba(135, 206, 235, 0.4));
  animation: bounce 2.5s ease-in-out infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  25% {
    transform: translateY(-12px) scale(1.02);
  }
  50% {
    transform: translateY(0) scale(1);
  }
  75% {
    transform: translateY(-6px) scale(1.01);
  }
}

.envelope-back {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #87ceeb, #6bb6d6, #4a9eca);
  position: absolute;
  border-radius: 0 0 15px 15px;
  box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.4);
}

.envelope-flap {
  width: 0;
  height: 0;
  border-left: 160px solid transparent;
  border-right: 160px solid transparent;
  border-top: 110px solid #87ceeb;
  position: absolute;
  top: 0;
  transform-origin: top;
  transition: transform 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 2;
}

.envelope-flap::before {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-left: 160px solid transparent;
  border-right: 160px solid transparent;
  border-top: 108px solid rgba(255, 255, 255, 0.3);
  top: -108px;
  left: -160px;
}

.envelope.open .envelope-flap {
  transform: rotateX(180deg);
}

.envelope.open {
  animation: zoomOut 1s forwards;
}

/* Estilos para el sello */
.envelope-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  z-index: 3;
  opacity: 0.9;
  transition: all 0.5s ease;
}

.envelope-seal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.envelope.open .envelope-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
}

@keyframes zoomOut {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.8;
  }
  100% {
    transform: scale(0);
    opacity: 0;
  }
}

/* Header Section */
.header {
  text-align: center;
  padding: 40px 0;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0.3;
  z-index: -1;
}

.header::after {
  content: "";
  position: absolute;
  bottom: -50px;
  left: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0.3;
  z-index: -1;
}

.logo {
  font-family: "Dancing Script", cursive;
  font-size: 5rem;
  color: var(--primary-color);
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.event-title {
  font-family: "Dancing Script", cursive;
  font-size: 3rem;
  font-weight: 400;
  color: var(--primary-color);
  margin-bottom: 20px;
  font-style: italic;
}

.main-image {
  max-width: 100%;
  height: auto;
  border-radius: 20px;
  margin: 20px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.decorative-element {
  position: relative;
  height: 40px;
  margin: 20px 0;
}

.decorative-element::before,
.decorative-element::after {
  content: "✿";
  position: absolute;
  font-size: 2rem;
  color: var(--primary-color);
}

.decorative-element::before {
  left: 40%;
}

.decorative-element::after {
  right: 40%;
}

/* Countdown Section */
.countdown-section {
  text-align: center;
  margin: 30px 0;
  padding: 20px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.countdown-title {
  font-family: "Dancing Script", cursive;
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.countdown-date {
  font-family: "Montserrat", sans-serif;
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 20px;
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.countdown-item {
  background: var(--secondary-color);
  padding: 15px 10px;
  border-radius: 10px;
  min-width: 70px;
}

.countdown-number {
  font-family: "Dancing Script", cursive;
  font-size: 2rem;
  color: var(--primary-color);
  font-weight: 700;
}

.countdown-label {
  font-size: 0.8rem;
  color: #666;
  margin-top: 5px;
}

/* Music Player Section */
.music-player {
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin: 30px auto;
  max-width: 500px;
  text-align: center;
}

.player-title {
  font-family: "Dancing Script", cursive;
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.player-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 15px;
}

.player-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.player-btn:hover {
  background: #6bb6d6;
  transform: scale(1.1);
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
  margin: 15px 0;
}

.progress {
  height: 100%;
  width: 0%;
  background: var(--primary-color);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #888;
}

/* Message Section */
.message-section {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin: 30px 0;
  text-align: center;
}

.message-text {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #555;
  margin-bottom: 30px;
  font-style: italic;
}

.parents-section {
  margin-top: 20px;
}

.parents-title {
  font-family: "Dancing Script", cursive;
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.parents-names {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.godparents-section {
  margin-top: 20px;
}

.godparents-title {
  font-family: "Dancing Script", cursive;
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.godparents-names {
  font-size: 1.1rem;
}

/* Event Details Section */
.event-details {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin: 30px 0;
  position: relative;
  overflow: hidden;
}

.event-details::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.section-title {
  font-family: "Dancing Script", cursive;
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 20px;
  text-align: center;
}

.venue-info {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-bottom: 30px;
}

.venue-item {
  display: flex;
  align-items: center;
  gap: 15px;
}

.venue-icon {
  background: var(--secondary-color);
  color: var(--primary-color);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
}

.venue-text h3 {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.venue-text p {
  color: #666;
}

.location-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.location-btn:hover {
  background: #6bb6d6;
  transform: translateY(-2px);
}

.dress-code {
  background: var(--secondary-color);
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  margin: 20px 0;
}

.dress-code h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.dress-code-image {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin-top: 15px;
}

/* RSVP Section */
.rsvp-section {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin: 30px 0;
  text-align: center;
}

.rsvp-title {
  font-family: "Dancing Script", cursive;
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.rsvp-subtitle {
  font-size: 1.2rem;
  margin-bottom: 30px;
  color: #666;
}

.whatsapp-btn {
  background: #25d366;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.whatsapp-btn:hover {
  background: #128c7e;
  transform: translateY(-2px);
}

/* Decorative Elements */
.butterfly {
  position: fixed;
  width: 40px;
  height: 40px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="%234a9eca" d="M224 96c0-35.3 28.7-64 64-64s64 28.7 64 64c0 17.5-7 33.4-18.4 45c-4.8 4.9-7.6 11.4-7.6 18.3c0 15.3 12.4 27.7 27.7 27.7c6.9 0 13.4-2.8 18.3-7.6c11.6-11.4 27.5-18.4 45-18.4c35.3 0 64 28.7 64 64s-28.7 64-64 64c-17.5 0-33.4-7-45-18.4c-4.9-4.8-11.4-7.6-18.3-7.6c-15.3 0-27.7 12.4-27.7 27.7c0 6.9 2.8 13.4 7.6 18.3c11.4 11.6 18.4 27.5 18.4 45c0 35.3-28.7 64-64 64s-64-28.7-64-64c0-17.5 7-33.4 18.4-45c4.8-4.9 7.6-11.4 7.6-18.3c0-15.3-12.4-27.7-27.7-27.7c-6.9 0-13.4 2.8-18.3 7.6c-11.6 11.4-27.5 18.4-45 18.4c-35.3 0-64-28.7-64-64s28.7-64 64-64c17.5 0 33.4 7 45 18.4c4.9 4.8 11.4 7.6 18.3 7.6c15.3 0 27.7-12.4 27.7-27.7c0-6.9-2.8-13.4-7.6-18.3c-11.4-11.6-18.4-27.5-18.4-45z"/></svg>');
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.7;
  z-index: 0;
  pointer-events: none;
}

.butterfly1 {
  top: 10%;
  left: -50px;
  animation: flyAcross1 20s linear infinite;
}

.butterfly2 {
  top: 20%;
  right: -50px;
  animation: flyAcross2 25s linear infinite;
}

.butterfly3 {
  top: 40%;
  left: -50px;
  animation: flyAcross3 18s linear infinite;
}

.butterfly4 {
  top: 60%;
  right: -50px;
  animation: flyAcross4 22s linear infinite;
}

.butterfly5 {
  top: 80%;
  left: -50px;
  animation: flyAcross5 30s linear infinite;
}

.butterfly6 {
  top: 30%;
  right: -50px;
  animation: flyAcross6 28s linear infinite;
}

.butterfly7 {
  top: 50%;
  left: -50px;
  animation: flyAcross7 24s linear infinite;
}

.butterfly8 {
  top: 70%;
  right: -50px;
  animation: flyAcross8 26s linear infinite;
}

@keyframes flyAcross1 {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  25% {
    transform: translateX(25vw) translateY(-20px) rotate(5deg);
  }
  50% {
    transform: translateX(50vw) translateY(20px) rotate(-5deg);
  }
  75% {
    transform: translateX(75vw) translateY(-10px) rotate(3deg);
  }
  100% {
    transform: translateX(110vw) translateY(0) rotate(0deg);
  }
}

@keyframes flyAcross2 {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  25% {
    transform: translateX(-25vw) translateY(15px) rotate(-5deg);
  }
  50% {
    transform: translateX(-50vw) translateY(-15px) rotate(5deg);
  }
  75% {
    transform: translateX(-75vw) translateY(10px) rotate(-3deg);
  }
  100% {
    transform: translateX(-110vw) translateY(0) rotate(0deg);
  }
}

@keyframes flyAcross3 {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  25% {
    transform: translateX(30vw) translateY(-25px) rotate(7deg);
  }
  50% {
    transform: translateX(60vw) translateY(25px) rotate(-7deg);
  }
  75% {
    transform: translateX(90vw) translateY(-15px) rotate(4deg);
  }
  100% {
    transform: translateX(110vw) translateY(0) rotate(0deg);
  }
}

@keyframes flyAcross4 {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  25% {
    transform: translateX(-30vw) translateY(20px) rotate(-6deg);
  }
  50% {
    transform: translateX(-60vw) translateY(-20px) rotate(6deg);
  }
  75% {
    transform: translateX(-90vw) translateY(15px) rotate(-4deg);
  }
  100% {
    transform: translateX(-110vw) translateY(0) rotate(0deg);
  }
}

@keyframes flyAcross5 {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  25% {
    transform: translateX(20vw) translateY(-30px) rotate(8deg);
  }
  50% {
    transform: translateX(40vw) translateY(30px) rotate(-8deg);
  }
  75% {
    transform: translateX(80vw) translateY(-20px) rotate(5deg);
  }
  100% {
    transform: translateX(110vw) translateY(0) rotate(0deg);
  }
}

@keyframes flyAcross6 {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  25% {
    transform: translateX(-20vw) translateY(25px) rotate(-7deg);
  }
  50% {
    transform: translateX(-40vw) translateY(-25px) rotate(7deg);
  }
  75% {
    transform: translateX(-80vw) translateY(20px) rotate(-5deg);
  }
  100% {
    transform: translateX(-110vw) translateY(0) rotate(0deg);
  }
}

@keyframes flyAcross7 {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  25% {
    transform: translateX(35vw) translateY(-18px) rotate(6deg);
  }
  50% {
    transform: translateX(70vw) translateY(18px) rotate(-6deg);
  }
  75% {
    transform: translateX(85vw) translateY(-12px) rotate(3deg);
  }
  100% {
    transform: translateX(110vw) translateY(0) rotate(0deg);
  }
}

@keyframes flyAcross8 {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  25% {
    transform: translateX(-35vw) translateY(22px) rotate(-8deg);
  }
  50% {
    transform: translateX(-70vw) translateY(-22px) rotate(8deg);
  }
  75% {
    transform: translateX(-85vw) translateY(12px) rotate(-3deg);
  }
  100% {
    transform: translateX(-110vw) translateY(0) rotate(0deg);
  }
}

.flower {
  position: absolute;
  width: 30px;
  height: 30px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="%234a9eca" d="M256 0c-53 0-96 43-96 96c0 11.2 2.2 21.8 5.9 31.8C141.2 137.8 120 168.5 120 204c0 52.5 42.5 95 95 95c5.6 0 11.1-.5 16.4-1.4c-1.5 7.1-2.4 14.5-2.4 22.1c0 53 43 96 96 96s96-43 96-96c0-7.6-.9-15-2.4-22.1c5.3.9 10.8 1.4 16.4 1.4c52.5 0 95-42.5 95-95c0-35.5-21.2-66.2-51.9-81.2c3.7-10 5.9-20.6 5.9-31.8c0-53-43-96-96-96c-19.7 0-38 6-53.3 16.2C294 6 275.7 0 256 0z"/></svg>');
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.5;
  z-index: 0;
}

.flower:nth-child(1) {
  top: 15%;
  left: 15%;
  transform: rotate(15deg);
}

.flower:nth-child(2) {
  top: 5%;
  right: 20%;
  transform: rotate(-10deg);
}

.flower:nth-child(3) {
  bottom: 20%;
  left: 12%;
  transform: rotate(5deg);
}

.flower:nth-child(4) {
  bottom: 5%;
  right: 15%;
  transform: rotate(-15deg);
}

.flower:nth-child(5) {
  top: 35%;
  left: 5%;
  transform: rotate(25deg);
}

.flower:nth-child(6) {
  top: 25%;
  right: 8%;
  transform: rotate(-20deg);
}

.flower:nth-child(7) {
  bottom: 35%;
  left: 20%;
  transform: rotate(10deg);
}

.flower:nth-child(8) {
  bottom: 25%;
  right: 25%;
  transform: rotate(-25deg);
}

/* Responsive Design */
@media (max-width: 768px) {
  .logo {
    font-size: 4rem;
  }

  .event-title {
    font-size: 2.5rem;
  }

  .section-title,
  .rsvp-title {
    font-size: 2rem;
  }

  .venue-item {
    flex-direction: column;
    text-align: center;
  }

  .countdown {
    gap: 5px;
  }

  .countdown-item {
    min-width: 60px;
    padding: 10px 5px;
  }

  .countdown-number {
    font-size: 1.5rem;
  }

  .countdown-label {
    font-size: 0.7rem;
  }
}
