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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  min-height: 100vh;
  position: relative;
}

.page {
  display: none;
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.page.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Página de Entrada */
#entry-page {
  background: linear-gradient(135deg, #ff6b9d 0%, #c44569 50%, #f8b500 100%);
  animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
  0%,
  100% {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 50%, #f8b500 100%);
  }
  50% {
    background: linear-gradient(135deg, #c44569 0%, #f8b500 50%, #ff6b9d 100%);
  }
}

.entry-container {
  text-align: center;
  z-index: 10;
  animation: fadeInUp 1s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.entry-flowers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.entry-flowers .tulip {
  font-size: 45px;
  animation: tulipSway 3s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.tulip-left {
  animation-delay: 0s;
}

.tulip-right {
  animation-delay: 0.5s;
}

@keyframes tulipSway {
  0%,
  100% {
    transform: rotate(-8deg) scale(1);
  }
  50% {
    transform: rotate(8deg) scale(1.1);
  }
}

.heart-animation {
  font-size: 80px;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.entry-title {
  font-size: 2.5rem;
  color: white;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

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

.entry-subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 30px;
}

.enter-button {
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid white;
  color: white;
  padding: 15px 40px;
  font-size: 1.3rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
}

.enter-button:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.enter-button:active {
  transform: scale(0.98);
}

.button-icon {
  font-size: 1.5rem;
  animation: float 2s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Página Principal */
#main-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: 200% 200%;
  animation: gradientMove 15s ease infinite;
}

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

/* Esquinas con tulipanes decorativos */
.tulips-corner {
  position: absolute;
  font-size: 28px;
  opacity: 0.5;
  z-index: 2;
  animation: tulipGlow 4s ease-in-out infinite;
  pointer-events: none;
}

.tulips-bottom-left {
  bottom: 20px;
  left: 15px;
  transform: rotate(-15deg);
}

.tulips-bottom-right {
  bottom: 20px;
  right: 15px;
  transform: rotate(15deg);
  animation-name: tulipGlowRight;
}

@keyframes tulipGlow {
  0%,
  100% {
    opacity: 0.4;
    transform: rotate(-15deg) scale(1);
  }
  50% {
    opacity: 0.7;
    transform: rotate(-12deg) scale(1.05);
  }
}

@keyframes tulipGlowRight {
  0%,
  100% {
    opacity: 0.4;
    transform: rotate(15deg) scale(1);
  }
  50% {
    opacity: 0.7;
    transform: rotate(18deg) scale(1.05);
  }
}

.hearts-container {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.heart {
  position: absolute;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.6);
  animation: floatHeart 15s infinite linear;
  pointer-events: none;
}

@keyframes floatHeart {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

/* Carrusel */
.carousel-wrapper {
  position: relative;
  z-index: 10;
  width: 95%;
  max-width: 420px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px 0;
  min-height: 0;
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 72vh;
}

.card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transform: translateX(30px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    visibility 0.4s;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow-y: auto;
}

.card.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  position: relative;
}

.card-with-image {
  gap: 0;
}

.card-image-wrap {
  width: 100%;
  min-height: 200px;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 45vh;
}

.card-image-wrap:has(.card-image[src=""]) .card-image,
.card-image-wrap .card-image:not([src]),
.card-image-wrap .card-image[src=""] {
  display: none;
}

.card-message-box {
  background: linear-gradient(135deg, #ffeef7 0%, #fff5f8 100%);
  border: 2px solid rgba(196, 69, 105, 0.2);
  border-top: none;
  border-radius: 0 0 16px 16px;
  padding: 18px 20px;
  position: relative;
}

.card-message-box::before {
  content: "🌷";
  position: absolute;
  top: 5px;
  right: 10px;
  font-size: 28px;
  opacity: 0.2;
}

.card-love-message {
  font-size: 1rem;
  line-height: 1.65;
  color: #333;
  text-align: center;
  margin: 0;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: rgba(180, 50, 90, 0.92);
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.carousel-btn:hover {
  background: rgba(196, 69, 105, 1);
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.carousel-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.carousel-btn-prev {
  left: -10px;
}

.carousel-btn-next {
  right: -10px;
}

.main-content-footer {
  position: relative;
  z-index: 10;
  padding: 12px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.carousel-dots {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.25s ease;
  padding: 0;
}

.carousel-dot:hover {
  background: rgba(255, 255, 255, 0.7);
}

.carousel-dot.active {
  background: white;
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.main-content {
  position: relative;
  z-index: 10;
  width: 90%;
  max-width: 600px;
  padding: 20px;
}

.message-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.8s ease;
  backdrop-filter: blur(10px);
}

.message-container.card {
  max-height: none;
  padding: 20px;
  align-self: center;
  max-width: 100%;
}

.card.message-container.active {
  justify-content: center;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.main-title {
  font-size: 1.75rem;
  color: #c44569;
  text-align: center;
  margin-bottom: 16px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.title-tulip {
  display: inline-block;
  animation: tulipSway 2.5s ease-in-out infinite;
  margin-left: 5px;
}

.message-box {
  background: linear-gradient(135deg, #ffeef7 0%, #fff5f8 100%);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 0;
  border: 2px solid rgba(196, 69, 105, 0.2);
  position: relative;
  overflow: hidden;
}

.message-box::before {
  content: "🌷";
  position: absolute;
  top: -16px;
  right: -16px;
  font-size: 72px;
  opacity: 0.12;
  transform: rotate(-15deg);
}

.message-box::after {
  content: "🌷";
  position: absolute;
  bottom: -24px;
  left: -16px;
  font-size: 60px;
  opacity: 0.1;
  transform: rotate(10deg);
}

.love-message {
  font-size: 1rem;
  line-height: 1.65;
  color: #333;
  text-align: justify;
  position: relative;
  z-index: 1;
}

.controls {
  display: flex;
  justify-content: center;
  margin-top: 0;
}

.music-button {
  background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
  border: none;
  color: white;
  padding: 10px 22px;
  font-size: 1rem;
  border-radius: 22px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(196, 69, 105, 0.4);
}

.music-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196, 69, 105, 0.6);
}

.music-button:active {
  transform: translateY(0);
}

.music-button.playing {
  background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
  box-shadow: 0 4px 15px rgba(68, 160, 141, 0.4);
}

.music-button.playing:hover {
  box-shadow: 0 6px 20px rgba(68, 160, 141, 0.6);
}

#music-icon {
  font-size: 1.3rem;
  animation: musicPulse 1.5s ease-in-out infinite;
}

.music-button.playing #music-icon {
  animation: musicPlay 0.5s ease-in-out infinite;
}

@keyframes musicPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes musicPlay {
  0%,
  100% {
    transform: rotate(-10deg) scale(1);
  }
  50% {
    transform: rotate(10deg) scale(1.1);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .entry-title {
    font-size: 2rem;
  }

  .entry-subtitle {
    font-size: 1rem;
  }

  .entry-flowers .tulip {
    font-size: 35px;
  }

  .heart-animation {
    font-size: 60px;
  }

  .enter-button {
    padding: 12px 30px;
    font-size: 1.1rem;
  }

  .carousel-wrapper {
    max-width: 100%;
    padding: 8px 50px 6px;
  }

  .carousel-container {
    max-height: min(80vh, calc(100vh - 95px));
  }

  .main-content-footer {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 8px 16px 14px;
    gap: 12px;
  }

  .main-content-footer .controls {
    margin-top: 0;
  }

  .music-button {
    padding: 8px 18px;
    font-size: 0.95rem;
  }

  .carousel-btn-prev {
    left: 5px;
  }

  .carousel-btn-next {
    right: 5px;
  }

  .main-title {
    font-size: 1.5rem;
    margin-bottom: 12px;
  }

  .love-message {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .message-container {
    padding: 16px;
  }

  .message-container.card {
    padding: 14px;
  }

  .message-box {
    padding: 14px 16px;
  }

  .card-love-message {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .entry-title {
    font-size: 1.6rem;
  }

  .entry-flowers .tulip {
    font-size: 28px;
  }

  .heart-animation {
    font-size: 50px;
  }

  .tulips-corner {
    font-size: 22px;
  }

  .carousel-wrapper {
    padding: 6px 45px 4px;
  }

  .carousel-container {
    max-height: min(82vh, calc(100vh - 88px));
  }

  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 1.4rem;
  }

  .carousel-btn-prev {
    left: 2px;
  }

  .carousel-btn-next {
    right: 2px;
  }

  .main-title {
    font-size: 1.35rem;
    margin-bottom: 10px;
  }

  .love-message {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .message-container {
    padding: 12px;
  }

  .message-container.card {
    padding: 12px;
  }

  .message-container.card .message-box {
    padding: 12px 14px;
  }

  .card-message-box {
    padding: 12px 14px;
  }

  .card-love-message {
    font-size: 0.9rem;
  }

  .main-content-footer {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 6px 12px 10px;
    gap: 10px;
  }

  .music-button {
    padding: 6px 14px;
    font-size: 0.9rem;
  }

  #music-icon {
    font-size: 1.1rem;
  }
}
