/* ===============================================
   Popup Styles
   - Desktop app promotion
   - Festive popups (Diwali, Navaratri)
   - Countdown timers
   =============================================== */

/* Desktop app popup styles */
#popupOverlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  transition: opacity 300ms ease-out, visibility 300ms ease-out;
  opacity: 0;
  visibility: hidden;
}

#popupModal {
  background-color: rgb(17, 24, 39);
  color: white;
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  max-width: 28rem;
  width: 100%;
  margin: 1rem;
  transition: all 300ms ease-out;
  transform: scale(0.95);
  opacity: 0;
}

#closePopup {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: rgb(107, 114, 128);
  font-size: 1.875rem;
  transition: color 200ms;
  background: none;
  border: none;
  cursor: pointer;
}

#closePopup:hover {
  color: white;
}

#timerOverlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: black;
  color: white;
  visibility: hidden;
  opacity: 0;
  transition: opacity 300ms;
}

/* Diwali Popup Styles */
.diwali-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.diwali-popup-content {
  background: linear-gradient(135deg, #2c1810 0%, #1a0f0a 100%);
  padding: 40px;
  border-radius: 20px;
  position: relative;
  max-width: 500px;
  text-align: center;
  border: 2px solid #ff9933;
  box-shadow:
    0 0 50px rgba(255, 153, 51, 0.3),
    0 0 100px rgba(255, 153, 51, 0.15),
    inset 0 0 30px rgba(255, 153, 51, 0.2);
  animation: glowPulse 2s infinite alternate;
}

@keyframes glowPulse {
  0% {
    box-shadow: 0 0 50px rgba(255, 153, 51, 0.3), 0 0 100px rgba(255, 153, 51, 0.15), inset 0 0 30px rgba(255, 153, 51, 0.2);
  }
  100% {
    box-shadow: 0 0 80px rgba(255, 153, 51, 0.5), 0 0 120px rgba(255, 153, 51, 0.25), inset 0 0 40px rgba(255, 153, 51, 0.3);
  }
}

.close-diwali-popup {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #ff9933;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1;
}

.close-diwali-popup:hover {
  transform: scale(1.2);
  color: #ffb366;
}

.diwali-title {
  color: #ff9933;
  font-size: 36px;
  margin: 20px 0;
  text-shadow: 0 0 10px rgba(255, 153, 51, 0.5);
  font-family: 'Poppins', sans-serif;
  animation: titleGlow 2s infinite alternate;
}

@keyframes titleGlow {
  0% {
    text-shadow: 0 0 10px rgba(255, 153, 51, 0.5);
  }
  100% {
    text-shadow: 0 0 20px rgba(255, 153, 51, 0.8);
  }
}

.diwali-message {
  color: #ffb366;
  font-size: 18px;
  margin: 20px 0;
  line-height: 1.6;
  font-family: 'Poppins', sans-serif;
}

.diya-container {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto;
}

.diya-svg {
  width: 100px;
  height: 100px;
  margin: 0 auto;
  filter: drop-shadow(0 0 10px rgba(255, 153, 51, 0.3));
}

.diya-svg svg {
  width: 100%;
  height: 100%;
}

.flame {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 30px;
  background: linear-gradient(to bottom,
      rgba(255, 213, 0, 0.8) 0%,
      rgba(255, 153, 51, 0.6) 50%,
      rgba(255, 153, 51, 0.4) 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flicker 1s infinite alternate;
  filter: blur(2px);
}

@keyframes flicker {
  0%,
  100% {
    transform: translateX(-50%) scaleY(1);
    opacity: 1;
  }
  50% {
    transform: translateX(-50%) scaleY(1.1);
    opacity: 0.9;
  }
}

.diwali-decoration {
  width: 100%;
  height: 40px;
  margin: 20px 0;
  opacity: 0.8;
  animation: patternFloat 3s infinite alternate;
}

.diwali-decoration svg {
  width: 100%;
  height: 100%;
}

#rangoli circle {
  animation: rangoliGlow 2s infinite alternate;
}

@keyframes rangoliGlow {
  0% {
    fill: #ff9933;
  }
  100% {
    fill: #ffb366;
  }
}

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

.diwali-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  color: #ffb366;
  font-family: 'Poppins', sans-serif;
}

.diwali-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  animation: logoSpin 4s infinite alternate;
}

@keyframes logoSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Firework Effects */
.firework {
  position: absolute;
  pointer-events: none;
}

.firework::before {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  animation: firework 2s infinite;
}

.firework:nth-child(1)::before {
  background: #ff9933;
  top: 20%;
  left: 20%;
}

.firework:nth-child(2)::before {
  background: #ffb366;
  top: 40%;
  right: 20%;
  animation-delay: 0.5s;
}

.firework:nth-child(3)::before {
  background: #ff7f00;
  bottom: 20%;
  left: 50%;
  animation-delay: 1s;
}

@keyframes firework {
  0% {
    transform: translate(0, 0);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)));
    opacity: 0;
  }
}

/* Festive popup styles */
#festive-popup-overlay,
#blessing-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9998;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

#festive-popup,
#blessing-popup {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 2px solid #ffd700;
  border-radius: 20px;
  padding: 50px;
  max-width: 600px;
  width: 90%;
  text-align: center;
  color: white;
  animation: zoomIn 0.5s ease-out;
}

#blessing-popup {
  background: linear-gradient(135deg, #2d1b4e 0%, #1a0a2e 100%);
  border-color: #9370db;
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes zoomOut {
  to {
    opacity: 0;
    transform: scale(0.5);
  }
}

#festive-popup h2 {
  font-size: 2.5rem;
  color: #ffd700;
  margin-bottom: 20px;
  font-family: 'Lobster', cursive;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

#festive-popup p {
  font-size: 1.1rem;
  color: #e0e0e0;
  line-height: 1.8;
  margin: 20px 0;
  font-family: 'Poppins', sans-serif;
}

#countdown-timer,
#stopwatch {
  font-size: 2rem;
  color: #00ff00;
  font-weight: bold;
  margin: 20px 0;
  font-family: 'Courier New', monospace;
  background: rgba(0, 255, 0, 0.1);
  padding: 10px;
  border-radius: 8px;
}

.popup-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
  flex-wrap: wrap;
}

.popup-btn {
  padding: 10px 30px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
}

.popup-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

#blessing-popup h3 {
  font-size: 1.8rem;
  color: #9370db;
  margin: 15px 0;
  font-family: 'Lobster', cursive;
}

#blessing-popup p {
  font-size: 1rem;
  color: #d0d0d0;
}

#close-popup-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: #ffd700;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

#close-popup-btn:hover {
  transform: rotate(90deg);
}

.flower-petal {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #ff69b4;
  border-radius: 50%;
  opacity: 0.7;
  animation: fall 3s infinite;
}

@keyframes fall {
  0% {
    top: -20px;
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}
