body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  text-align: center;
  background: url('photos/Copy of Invitation.png') no-repeat center center/cover;
  color: #333;
  overflow-x: hidden;
  animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.header {
  padding: 20px;
  position: relative;
  margin: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: slideDown 1s ease-out 0.5s both;
}

@keyframes slideDown {
  from { transform: translateY(-50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.logos {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 300px;
}

.logo-left, .logo-right {
  width: 100px;
  height: 100px;
}

h1 {
  color: brown;
  font-size: 40px;
  font-weight: 700;
  margin: 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
  to { text-shadow: 2px 2px 4px rgba(0,0,0,0.5), 0 0 10px rgba(165, 42, 42, 0.5); }
}

.subheading {
  margin-top: 10px;
}

.subheading p {
  margin: 5px 0;
  font-size: 18px;
  color: #555;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.upload-section {
  margin: 20px;
  padding: 20px;
}

.choose-label {
  display: inline-block;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.8);
  border: 2px dashed #ccc;
  border-radius: 5px;
  cursor: pointer;
  margin-right: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

button {
  margin: 10px;
  padding: 12px 25px;
  background: brown;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

button:hover {
  background: #5a2d0c;
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

@keyframes pulse {
  0% { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }
  50% { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 5px rgba(165, 42, 42, 0.1); }
  100% { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }
}

button:hover {
  background: #5a2d0c;
}

.preview {
  margin: 20px;
  padding: 20px;
}

.preview h2 {
  color: brown;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  padding: 20px;
}

.gallery img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  animation: fadeInUp 0.5s ease-out both;
}

.gallery img:hover {
  transform: scale(1.05);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Firecracker Effects */
.firecracker {
  position: absolute;
  width: 5px;
  height: 5px;
  background: red;
  border-radius: 50%;
  animation: burst 2s infinite;
}

@keyframes burst {
  0% { transform: scale(0); opacity: 1; }
  50% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}

/* Confetti Effects */
.confetti {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 10px;
  background: linear-gradient(45deg, red, yellow, blue, green);
  border-radius: 50%;
  animation: fall 3s linear infinite;
}

@keyframes fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* Gallery Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.3s ease-in;
}

.modal-content {
  background: white;
  margin: 5% auto;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 1000px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

.modal-content h2 {
  color: brown;
  text-align: center;
  margin-top: 0;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}

.close:hover,
.close:focus {
  color: brown;
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.modal-gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.3s;
}

.modal-gallery img:hover {
  transform: scale(1.05);
}

.download-link {
  position: relative;
  display: inline-block;
  width: 100%;
}

.download-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px;
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  border-radius: 0 0 10px 10px;
  opacity: 0;
  transition: opacity 0.3s;
}

.download-link:hover .download-overlay {
  opacity: 1;
}

/* Footer */
footer {
  margin-top: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-top: 2px solid brown;
  text-align: center;
  animation: slideUp 1s ease-out 2s both;
}

footer p {
  color: brown;
  font-weight: 600;
  margin: 0;
  font-size: 16px;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    padding: 10px;
    margin: 10px;
  }

  .logos {
    justify-content: center;
    gap: 20px;
  }

  .logo-left, .logo-right {
    width: 60px;
    height: 60px;
  }

  h1 {
    font-size: 24px;
    text-align: center;
  }

  .subheading p {
    font-size: 16px;
  }

  .upload-section {
    margin: 10px;
    padding: 10px;
  }

  .choose-label {
    padding: 8px 16px;
    font-size: 14px;
  }

  button {
    padding: 10px 20px;
    font-size: 14px;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .gallery img {
    height: 80px;
  }

  .modal-gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .modal-content {
    width: 95%;
    margin: 20% auto;
    padding: 15px;
  }

  .firecracker, .particle, .confetti {
    display: none; /* Hide effects on mobile for performance */
  }
}