/* =============================================
   DIWALI GREETING (home page only)
   To remove: delete the include + $extra_css line in index.php.
   ============================================= */

/* ---- Slim ribbon under the header ---- */
.dw-ribbon {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #7a1f00, #c2410c, #e8a020, #c2410c, #7a1f00);
  background-size: 200% 100%;
  animation: dwShimmer 8s linear infinite;
  color: #fff;
  text-align: center;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  z-index: 1;
}
.dw-ribbon .dw-hi { font-family: 'Oswald', sans-serif; letter-spacing: 1px; }
.dw-ribbon .dw-diya-mini { display: inline-block; animation: dwBob 2s ease-in-out infinite; }
.dw-ribbon .dw-diya-mini:last-child { animation-delay: 1s; }

/* ---- Popup ---- */
.dw-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(circle at 50% 40%, rgba(40, 14, 0, 0.82), rgba(5, 8, 18, 0.94));
  opacity: 0;
  transition: opacity 0.5s ease;
}
.dw-overlay.dw-open { display: flex; }
.dw-overlay.dw-show { opacity: 1; }

.dw-card {
  position: relative;
  width: min(440px, 100%);
  text-align: center;
  padding: 36px 28px 30px;
  border-radius: 20px;
  background: linear-gradient(160deg, #1b0b05 0%, #0a1628 70%);
  border: 1px solid rgba(232, 160, 32, 0.55);
  box-shadow: 0 0 60px rgba(232, 160, 32, 0.28), 0 25px 70px rgba(0, 0, 0, 0.6);
  transform: translateY(24px) scale(0.92);
  transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  overflow: hidden;
}
.dw-overlay.dw-show .dw-card { transform: none; }

.dw-glow {
  position: absolute;
  left: 50%; top: 70px;
  width: 260px; height: 260px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 190, 60, 0.35), transparent 65%);
  animation: dwPulse 3s ease-in-out infinite;
  pointer-events: none;
}

.dw-diya { position: relative; width: 120px; height: 96px; margin: 0 auto 6px; }
.dw-diya svg { width: 100%; height: 100%; overflow: visible; }
.dw-flame {
  transform-origin: 60px 58px;
  animation: dwFlicker 1.1s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px #ffb02e) drop-shadow(0 0 18px rgba(255, 140, 0, 0.8));
}

.dw-hindi {
  position: relative;
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #f5c842;
  text-shadow: 0 0 18px rgba(245, 200, 66, 0.55);
  font-family: 'Nirmala UI', 'Noto Sans Devanagari', 'Mangal', sans-serif;
}
.dw-title {
  position: relative;
  margin: 2px 0 12px;
  font-family: 'Oswald', sans-serif;
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(90deg, #ffd56a, #fff, #ffb02e, #fff, #ffd56a);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: dwShimmer 4s linear infinite;
}
.dw-msg {
  position: relative;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
  line-height: 1.65;
  margin: 0 auto 22px;
  max-width: 340px;
}
.dw-msg strong { color: #f5c842; }

.dw-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border: 0;
  border-radius: 40px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: #0a1628;
  background: linear-gradient(135deg, #e8a020, #f5c842);
  box-shadow: 0 6px 22px rgba(232, 160, 32, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dw-btn:hover, .dw-btn:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(232, 160, 32, 0.6); outline: none; }

.dw-close {
  position: absolute;
  top: 10px; right: 12px;
  width: 34px; height: 34px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
}
.dw-close:hover, .dw-close:focus-visible { background: rgba(255, 255, 255, 0.2); outline: none; }

/* ---- Sparkles (spans created by diwali.js) ---- */
.dw-sparks { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.dw-spark {
  position: absolute;
  bottom: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6c8 0%, #ffb02e 55%, transparent 72%);
  opacity: 0;
  animation: dwRise linear infinite;
}
.dw-card > *:not(.dw-sparks):not(.dw-glow):not(.dw-close) { position: relative; z-index: 1; }

/* ---- Crackers (fireworks) ---- */
#dw-fw {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10001;          /* above the popup so rockets burst over it */
  pointer-events: none;
  display: none;
}
#dw-fw.dw-on { display: block; }

.dw-crackers {
  position: fixed;
  left: 20px;
  bottom: 24px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 0;
  border-radius: 40px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: #fff;
  background: linear-gradient(135deg, #c2410c, #e8a020);
  box-shadow: 0 6px 22px rgba(194, 65, 12, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dw-crackers:hover, .dw-crackers:focus-visible { transform: translateY(-2px) scale(1.04); box-shadow: 0 10px 28px rgba(194, 65, 12, 0.65); outline: none; }

@keyframes dwShimmer { to { background-position: 200% 0; } }
@keyframes dwBob { 50% { transform: translateY(-3px); } }
@keyframes dwPulse { 50% { opacity: 0.55; transform: translate(-50%, -50%) scale(1.15); } }
@keyframes dwFlicker {
  0%   { transform: scale(1, 1) rotate(-2deg); }
  50%  { transform: scale(0.94, 1.08) rotate(2deg); }
  100% { transform: scale(1.05, 0.96) rotate(-1deg); }
}
@keyframes dwRise {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  15%  { opacity: 0.95; }
  100% { transform: translateY(-520px) translateX(var(--dx, 0)) scale(1); opacity: 0; }
}

@media (max-width: 480px) {
  .dw-crackers { left: 12px; bottom: 16px; padding: 9px 14px; font-size: 0.75rem; }
  .dw-hindi { font-size: 1.7rem; }
  .dw-title { font-size: 1.8rem; }
  .dw-ribbon { font-size: 0.78rem; padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .dw-ribbon, .dw-glow, .dw-flame, .dw-title, .dw-spark,
  .dw-ribbon .dw-diya-mini { animation: none !important; }
  .dw-overlay, .dw-card { transition: none !important; }
  .dw-spark { display: none; }
}
