/* Estilos base mejorados */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #fff0f6, #f0f4ff);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  color: #333;
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 900px;
  perspective: 1000px;
}

/* Tarjeta cerrada - Estilo mejorado */
.card.closed {
  background: linear-gradient(145deg, #ffffff, #fff9fb);
  border-radius: 20px;
  padding: 5px;
  cursor: pointer;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  transition: all 0.4s ease;
  transform-style: preserve-3d;
  width: 350px;
  height: 450px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.closed-card-inner {
  background: linear-gradient(to bottom right, #ff66b3, #9966ff);
  border-radius: 15px;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.closed-card-inner::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
  transform: rotate(30deg);
}

.card.closed:hover {
  transform: translateY(-10px) rotateX(5deg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.closed-card-content h2 {
  font-size: 28px;
  margin-bottom: 15px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
}

.closed-card-content .subtitle {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 25px;
  position: relative;
  z-index: 2;
}

.decoration {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  position: relative;
  z-index: 2;
}

.deco-element {
  font-size: 28px;
  animation: float 3s ease-in-out infinite;
}

.deco-element:nth-child(1) { animation-delay: 0s; }
.deco-element:nth-child(2) { animation-delay: 0.5s; }
.deco-element:nth-child(3) { animation-delay: 1s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* Tarjeta abierta - Estilo mejorado */
.card.open {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  position: relative;
  opacity: 0;
  transform: rotateY(90deg);
  transform-origin: left center;
  transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.card.open.visible {
  opacity: 1;
  transform: rotateY(0deg);
}

.card-header {
  background: linear-gradient(to right, #ff66b3, #9966ff);
  padding: 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.card-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.1"><circle cx="25" cy="25" r="5" fill="white"/><circle cx="75" cy="25" r="5" fill="white"/><circle cx="50" cy="50" r="5" fill="white"/><circle cx="25" cy="75" r="5" fill="white"/><circle cx="75" cy="75" r="5" fill="white"/></svg>');
}

.card-header h1 {
  color: white;
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
}

.header-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  font-weight: 300;
  position: relative;
}

.card-content {
  display: flex;
  flex-wrap: wrap;
  padding: 40px;
  background-color: #fff;
}

.left-side, .right-side {
  flex: 1;
  min-width: 300px;
  padding: 20px;
}

.left-side {
  border-right: 1px solid #f0f0f0;
}

h3 {
  color: #9966ff;
  font-size: 24px;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f5f5f5;
  display: flex;
  align-items: center;
  gap: 10px;
}

h3 .icon {
  font-size: 28px;
}

ul {
  list-style: none;
}

li {
  padding: 12px 0;
  color: #555;
  font-size: 18px;
  position: relative;
  padding-left: 40px;
  margin-bottom: 8px;
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.5s ease;
  line-height: 1.5;
}

.left-side li::before {
  content: "💖";
  position: absolute;
  left: 0;
  font-size: 24px;
}

.right-side li::before {
  content: "✨";
  position: absolute;
  left: 0;
  font-size: 24px;
}

.card-footer {
  background: linear-gradient(to right, #ff88c2, #aa88ff);
  padding: 20px;
  text-align: center;
  position: relative;
}

.card-footer p {
  color: white;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.footer-note {
  font-size: 16px;
  opacity: 0.9;
  font-weight: 400;
}

/* Decoraciones florales mejoradas */
.flower {
  position: absolute;
  font-size: 40px;
  opacity: 0;
  transition: all 1s ease;
  z-index: 1;
  pointer-events: none;
  animation: float 4s ease-in-out infinite;
}

.flower-1 {
  top: -20px;
  left: -20px;
  color: #ff66b3;
  animation-delay: 0.2s;
}

.flower-2 {
  bottom: -20px;
  right: -20px;
  color: #9966ff;
  animation-delay: 0.4s;
}

.flower-3 {
  top: 20%;
  right: -15px;
  color: #ffcc66;
  animation-delay: 0.6s;
}

.flower-4 {
  bottom: 20%;
  left: -15px;
  color: #66ccff;
  animation-delay: 0.8s;
}

.flower-5 {
  top: 10%;
  left: 10%;
  color: #ff6666;
  animation-delay: 1s;
}

.flower-6 {
  bottom: 10%;
  right: 10%;
  color: #66ff99;
  animation-delay: 1.2s;
}

/* Clases de animación */
.show-item {
  opacity: 1 !important;
  transform: translateX(0) !important;
}

.show-flower {
  opacity: 0.8 !important;
}

/* Efecto de confeti mejorado */
.confetti {
  position: fixed;
  font-size: 24px;
  pointer-events: none;
  z-index: 100;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  to {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .card.closed {
    width: 300px;
    height: 400px;
  }
  
  .closed-card-content h2 {
    font-size: 24px;
  }
  
  .card-content {
    padding: 20px;
  }
  
  .left-side, .right-side {
    min-width: 100%;
  }
  
  .left-side {
    border-right: none;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 30px;
    margin-bottom: 20px;
  }
  
  .card-header h1 {
    font-size: 28px;
  }
  
  h3 {
    font-size: 22px;
  }
  
  li {
    font-size: 16px;
    padding-left: 35px;
  }
}