/* Custom Animations and Styles */
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  --rose-gold: #E8B4B8;
  --soft-pink: #F8E8E9;
  --romantic-red: #D63384;
  --golden: #FFD700;
}

body {
  font-family: 'Playfair Display', serif;
  overflow-x: hidden;
}

.font-script {
  font-family: 'Dancing Script', cursive;
}

.font-romantic {
  font-family: 'Playfair Display', serif;
}

/* Custom Animations */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

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

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

@keyframes butterfly-fly {
  0% { transform: translateX(-100vw) translateY(50vh) rotate(0deg); }
  25% { transform: translateX(25vw) translateY(25vh) rotate(90deg); }
  50% { transform: translateX(50vw) translateY(75vh) rotate(180deg); }
  75% { transform: translateX(75vw) translateY(25vh) rotate(270deg); }
  100% { transform: translateX(150vw) translateY(50vh) rotate(360deg); }
}

@keyframes gift-unwrap {
  0% { 
    transform: translateY(0) rotate(0deg); 
    opacity: 1; 
  }
  50% { 
    transform: translateY(-20px) rotate(5deg); 
  }
  80% { 
    transform: translateY(-40px) rotate(10deg) scale(1.2); 
    opacity: 0.8; 
  }
  100% { 
    transform: translateY(-100px) rotate(45deg) scale(0.5); 
    opacity: 0; 
  }
}

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

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

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.3); }
  28% { transform: scale(1); }
  42% { transform: scale(1.3); }
  70% { transform: scale(1); }
}

/* Gift Box Styles */
.gift-box {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.gift-box:hover {
  transform: scale(1.05);
}

.gift-lid {
  position: absolute;
  top: 0;
  width: 100%;
  height: 60px;
  z-index: 2;
  transition: all 1s ease;
}

.gift-body {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 140px;
  z-index: 1;
}

.ribbon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 80px;
  background: linear-gradient(45deg, var(--romantic-red), #ff1744);
}

.ribbon:before {
  content: '';
  position: absolute;
  top: -40px;
  left: -15px;
  width: 50px;
  height: 30px;
  background: inherit;
  border-radius: 15px;
}

.gift-sparkles {
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  background: radial-gradient(circle, transparent 20%, rgba(255, 215, 0, 0.3) 21%, transparent 22%);
  animation: sparkle 2s linear infinite;
}

/* Floating Hearts */
.floating-hearts {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.floating-heart {
  position: absolute;
  font-size: 2rem;
  animation: hearts-float 8s linear infinite;
  pointer-events: none;
}

/* Message Cards */
.message-card {
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.message-card:before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.1), transparent);
  transform: rotate(45deg);
  transition: all 0.5s ease;
  opacity: 0;
}

.message-card:hover:before {
  opacity: 1;
  animation: sparkle 1s ease-in-out;
}

/* Butterfly Cursor Effect */
.butterfly-cursor {
  position: fixed;
  width: 30px;
  height: 30px;
  pointer-events: none;
  z-index: 9999;
  transition: all 0.1s ease;
  color: var(--romantic-red);
}

/* Photo Gallery Styles */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  aspect-ratio: 1;
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 40px rgba(214, 51, 132, 0.3);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(214, 51, 132, 0.8), rgba(255, 105, 180, 0.8));
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  position: relative;
  margin: auto;
  padding: 20px;
  width: 90%;
  max-width: 800px;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
}

.modal img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 15px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.close:hover {
  color: var(--romantic-red);
  transform: scale(1.2);
}

/* Heart Explosion */
.heart-explosion {
  position: absolute;
  font-size: 3rem;
  color: #ff1744;
  animation: heartExplosion 2s ease-out forwards;
  pointer-events: none;
}

@keyframes heartExplosion {
  0% {
    opacity: 1;
    transform: scale(0) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.5) rotate(180deg);
  }
  100% {
    opacity: 0;
    transform: scale(2) rotate(360deg) translateY(-200px);
  }
}

/* Countdown Styles */
#countdown .grid > div {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Particles Container */
#particles-js {
  background: linear-gradient(135deg, #fef7f7, #fdf2f8, #fce7f3);
}

/* Responsive Design */
@media (max-width: 768px) {
  .gift-box {
    width: 150px;
    height: 150px;
  }
  
  .gift-lid {
    height: 45px;
  }
  
  .gift-body {
    height: 105px;
  }
  
  .floating-heart {
    font-size: 1.5rem;
  }
  
  .message-card {
    padding: 1.5rem;
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: linear-gradient(135deg, #fef7f7, #fdf2f8);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--romantic-red), #ff69b4);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #ff1744, var(--romantic-red));
}

/* Glowing Effects */
.glow-heart {
  box-shadow: 0 0 20px rgba(214, 51, 132, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 20px rgba(214, 51, 132, 0.6); }
  50% { box-shadow: 0 0 40px rgba(214, 51, 132, 0.8); }
  100% { box-shadow: 0 0 20px rgba(214, 51, 132, 0.6); }
}

/* Loading Animation */
.loading-heart {
  display: inline-block;
  animation: heartBeat 1.5s ease-in-out infinite;
}

/* Fade In Animation */
.fade-in {
  animation: fadeInUp 1s ease-out forwards;
}

.fade-in-delay-1 {
  animation: fadeInUp 1s ease-out 0.5s forwards;
  opacity: 0;
}

.fade-in-delay-2 {
  animation: fadeInUp 1s ease-out 1s forwards;
  opacity: 0;
}

.fade-in-delay-3 {
  animation: fadeInUp 1s ease-out 1.5s forwards;
  opacity: 0;
}