/* ============================================================
   AzadiWish — Independence Day Greetings
   Mobile-first, tricolor theme, <1MB, pure CSS animations
   ============================================================ */

:root {
  --saffron: #FF9933;
  --white: #ffffff;
  --green: #138808;
  --navy: #000080;
  --ink: #1a1a2e;
  --muted: #5b5b6b;
  --card-radius: 22px;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.12);
  --shadow-lift: 0 18px 45px rgba(0, 0, 0, 0.22);
  --font: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, #fff7ee 0%, #f4f6f9 55%, #eef7ef 100%);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  padding-bottom: 70px; /* room for sticky bottom ad */
}

/* ---------- App shell (mobile-first, max width) ---------- */
.app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 14px 24px;
}

/* ---------- Ad slots ---------- */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px auto;
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed #d7d7e0;
  border-radius: 10px;
  color: #a7a7b4;
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
  overflow: hidden;
}
.ad-320x50 { width: 320px; max-width: 100%; height: 50px; }
.ad-300x250 { width: 300px; max-width: 100%; height: 250px; }

.ad-top { margin-top: 8px; }

.ad-sticky-bottom {
  position: fixed;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  z-index: 60;
  width: 320px;
  max-width: calc(100% - 20px);
  height: 50px;
  margin: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  box-shadow: 0 -4px 18px rgba(0,0,0,0.12);
}
.ad-sticky-bottom .ad-close {
  position: absolute;
  top: -9px; right: -9px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #ddd;
  color: #888;
  font-size: 13px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
}

/* ---------- Header ---------- */
.site-header {
  text-align: center;
  padding: 14px 0 6px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: .3px;
}
.brand .flag { font-size: 1.3rem; animation: wave 2.4s ease-in-out infinite; transform-origin: left center; }
.brand .tri { background: linear-gradient(90deg, var(--saffron) 33%, #333 33% 66%, var(--green) 66%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.tagline .hl { color: var(--saffron); font-weight: 800; }

@keyframes wave {
  0%,100% { transform: rotate(0deg); }
  25% { transform: rotate(9deg); }
  75% { transform: rotate(-6deg); }
}

/* ---------- Greeting Card / Canvas ---------- */
.card-wrap { position: relative; margin: 10px 0 4px; }

.greeting-card {
  position: relative;
  border-radius: var(--card-radius);
  padding: 26px 20px 30px;
  color: #fff;
  text-align: center;
  overflow: hidden;
  box-shadow: var(--shadow-lift);
  background:
    linear-gradient(160deg, var(--saffron) 0%, #ff8a3d 18%, #ffffff 42%, #ffffff 58%, #2fb84f 82%, var(--green) 100%);
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Ashoka chakra spinning behind */
.chakra {
  position: absolute;
  top: 50%; left: 50%;
  width: 150px; height: 150px;
  transform: translate(-50%, -50%);
  opacity: .10;
  animation: spin 22s linear infinite;
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.card-badge {
  display: inline-block;
  background: rgba(0,0,128,.9);
  color: #fff;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0,0,128,.3);
}

.card-year {
  color: var(--navy);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 2px;
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}

.card-name {
  color: var(--navy);
  font-weight: 800;
  font-size: clamp(1.6rem, 8vw, 2.4rem);
  line-height: 1.1;
  margin: 6px 0 4px;
  word-break: break-word;
  text-shadow: 0 2px 8px rgba(255,255,255,.5);
  animation: pop .6s cubic-bezier(.2,.9,.3,1.4);
}
@keyframes pop { 0% { transform: scale(.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.card-wish {
  color: #14213d;
  font-weight: 700;
  font-size: 1.05rem;
  margin: 4px 0 2px;
}
.card-sub {
  color: #2a2a3a;
  font-weight: 500;
  font-size: .84rem;
}

.card-quote {
  margin-top: 16px;
  background: rgba(255,255,255,.82);
  color: #14213d;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: .88rem;
  font-style: italic;
  font-weight: 500;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  max-width: 92%;
}
.card-quote .author { display: block; font-style: normal; font-weight: 700; font-size: .78rem; margin-top: 6px; color: var(--green); }

.card-flag-strip {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--saffron) 33%, #fff 33% 66%, var(--green) 66%);
}

.card-footer-brand {
  position: absolute;
  bottom: 12px; right: 14px;
  font-size: .62rem;
  font-weight: 600;
  color: rgba(0,0,128,.55);
  letter-spacing: .5px;
}

/* Countdown pill */
.countdown {
  text-align: center;
  margin: 6px 0 2px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--navy);
}
.countdown .num { color: var(--saffron); font-weight: 800; }

/* ---------- Form ---------- */
.creator-form {
  background: #fff;
  border-radius: 18px;
  padding: 18px 16px 20px;
  box-shadow: var(--shadow-soft);
  margin-top: 8px;
}
.field-label { font-size: .82rem; font-weight: 600; color: var(--ink); display: block; margin-bottom: 6px; }
.text-input {
  width: 100%;
  padding: 14px 14px;
  font-size: 1rem;
  font-family: var(--font);
  border: 2px solid #e6e6ee;
  border-radius: 12px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.text-input:focus { border-color: var(--saffron); box-shadow: 0 0 0 4px rgba(255,153,51,.15); }

.quote-select {
  width: 100%;
  padding: 12px 14px;
  font-size: .92rem;
  font-family: var(--font);
  border: 2px solid #e6e6ee;
  border-radius: 12px;
  background: #fff;
  outline: none;
  margin-top: 4px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.form-row { margin-top: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 18px;
  font-size: 1.02rem;
  font-weight: 700;
  font-family: var(--font);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-share {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37,211,102,.35);
  margin-top: 16px;
}
.btn-share:hover { filter: brightness(1.03); }
.btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 2px solid #e6e6ee;
  margin-top: 10px;
}
.btn-copy { background: linear-gradient(135deg, var(--saffron), #ff7a1a); color:#fff; margin-top:10px; }

.helper-note {
  text-align: center;
  font-size: .74rem;
  color: var(--muted);
  margin-top: 12px;
}

/* ---------- Section headings ---------- */
.section-title {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 22px 0 8px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before { content:""; width: 5px; height: 18px; border-radius: 4px; background: linear-gradient(var(--saffron), var(--green)); }

/* ---------- Info / Why we celebrate ---------- */
.info-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
  font-size: .9rem;
  color: #33333f;
}
.info-card p { margin-bottom: 8px; }
.info-card strong { color: var(--green); }

.slogan-banner {
  margin: 14px 0;
  text-align: center;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,153,51,.12), rgba(19,136,8,.12));
  border: 1px solid rgba(0,0,128,.08);
}
.slogan-banner .slogan {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy);
  font-style: italic;
}
.slogan-banner .slogan-sub { font-size:.78rem; color: var(--muted); margin-top:4px; }

/* ---------- Achievement toast ---------- */
.achievement {
  margin: 10px 0;
  text-align: center;
  background: linear-gradient(135deg, #fff4e0, #e9f7ea);
  border: 1px solid rgba(19,136,8,.2);
  border-radius: 14px;
  padding: 12px;
  font-size: .86rem;
  font-weight: 600;
  color: var(--green);
  display: none;
}
.achievement.show { display: block; animation: pop .5s ease; }

/* ---------- Share Interstitial Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,25,.72);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 340px;
  padding: 22px 18px;
  text-align: center;
  box-shadow: var(--shadow-lift);
}
.modal-title { font-weight: 700; font-size: 1rem; color: var(--ink); }
.modal-flag { font-size: 1.6rem; }
.spinner {
  width: 40px; height: 40px;
  margin: 14px auto;
  border: 4px solid #eee;
  border-top-color: var(--saffron);
  border-right-color: var(--green);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.modal-ad { margin: 16px auto 4px; }
.modal-sub { font-size:.76rem; color: var(--muted); }

/* ---------- Floating CTA (recipient page) ---------- */
.floating-cta {
  position: fixed;
  left: 50%;
  bottom: 66px;
  transform: translateX(-50%);
  z-index: 70;
  background: linear-gradient(135deg, var(--saffron), #ff7a1a);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  padding: 14px 22px;
  border-radius: 999px;
  border: none;
  box-shadow: 0 12px 30px rgba(255,122,26,.45);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  animation: floatPulse 2.2s ease-in-out infinite;
}
@keyframes floatPulse {
  0%,100% { transform: translateX(-50%) translateY(0); box-shadow: 0 12px 30px rgba(255,122,26,.45); }
  50% { transform: translateX(-50%) translateY(-5px); box-shadow: 0 18px 38px rgba(255,122,26,.55); }
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  font-size: .74rem;
  color: var(--muted);
  padding: 24px 0 10px;
}
.site-footer a { color: var(--green); text-decoration: none; font-weight: 600; }

/* ---------- Confetti canvas ---------- */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 600;
  z-index: 120;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Small screens tweak ---------- */
@media (max-width: 360px) {
  .greeting-card { min-height: 340px; padding: 20px 14px 26px; }
}
