/* Festival wishes (Admin > Festival Wishes): greeting card / ribbon / corner card with an animated
   canvas effect. Markup is built by Scripts/festival-wish.js; data from Views/Shared/_FestivalWish.cshtml. */

/* ---------- festival colour themes ---------- */
.fw-themed { --fw-bg: linear-gradient(140deg, #312e81, #4f46e5 50%, #db2777); --fw-ink: #fff; --fw-sub: rgba(255, 255, 255, .9); --fw-accent: #fde68a; --fw-btn-bg: var(--fw-accent); --fw-btn-ink: #1e1b4b; --fw-title: linear-gradient(90deg, #fde68a, #fff 50%, #fde68a); }
.fw-themed[data-theme="diwali"] { --fw-bg: linear-gradient(145deg, #3f0a0a 0%, #7c2d12 45%, #b45309 100%); --fw-accent: #fbbf24; --fw-btn-ink: #3f0a0a; --fw-title: linear-gradient(90deg, #fbbf24, #fff7ed 50%, #fbbf24); }
.fw-themed[data-theme="holi"] { --fw-bg: linear-gradient(135deg, #be185d 0%, #7c3aed 55%, #f59e0b 100%); --fw-accent: #fde047; --fw-btn-ink: #581c87; --fw-title: linear-gradient(90deg, #fde047, #fff 35%, #a7f3d0 65%, #fde047); }
.fw-themed[data-theme="eid"] { --fw-bg: linear-gradient(150deg, #022c22 0%, #065f46 55%, #047857 100%); --fw-accent: #fcd34d; --fw-btn-ink: #022c22; --fw-title: linear-gradient(90deg, #fcd34d, #fffbeb 50%, #fcd34d); }
.fw-themed[data-theme="christmas"] { --fw-bg: linear-gradient(150deg, #7f1d1d 0%, #b91c1c 55%, #166534 100%); --fw-accent: #fde68a; --fw-btn-ink: #7f1d1d; }
.fw-themed[data-theme="newyear"] { --fw-bg: linear-gradient(150deg, #0f172a 0%, #312e81 60%, #6d28d9 100%); --fw-accent: #fbbf24; --fw-btn-ink: #0f172a; --fw-title: linear-gradient(90deg, #fbbf24, #fff 50%, #f472b6); }
.fw-themed[data-theme="independence"], .fw-themed[data-theme="republic"] {
    --fw-bg: linear-gradient(180deg, #ffedd5 0%, #fff7ed 22%, #ffffff 45%, #ffffff 62%, #f0fdf4 80%, #dcfce7 100%);
    --fw-ink: #1e3a8a; --fw-sub: #334155; --fw-accent: #ea580c; --fw-btn-bg: #138808; --fw-btn-ink: #fff;
    --fw-title: linear-gradient(90deg, #ea580c 0%, #ea580c 30%, #1e3a8a 45%, #1e3a8a 55%, #138808 70%, #138808 100%);
}
.fw-themed[data-theme="ganesh"] { --fw-bg: linear-gradient(150deg, #9a3412 0%, #ea580c 55%, #f59e0b 100%); --fw-accent: #fef08a; --fw-btn-ink: #7c2d12; }
.fw-themed[data-theme="navratri"] { --fw-bg: linear-gradient(140deg, #86198f 0%, #db2777 55%, #f97316 100%); --fw-accent: #fde047; --fw-btn-ink: #701a75; }
.fw-themed[data-theme="dussehra"] { --fw-bg: linear-gradient(150deg, #7c2d12 0%, #dc2626 60%, #f97316 100%); --fw-accent: #fde68a; --fw-btn-ink: #7c2d12; }
.fw-themed[data-theme="raksha"] { --fw-bg: linear-gradient(140deg, #9d174d 0%, #db2777 55%, #f472b6 100%); --fw-accent: #fde68a; --fw-btn-ink: #831843; }
.fw-themed[data-theme="sankranti"] { --fw-bg: linear-gradient(170deg, #0c4a6e 0%, #0284c7 55%, #f59e0b 100%); --fw-accent: #fde68a; --fw-btn-ink: #0c4a6e; }
.fw-themed[data-theme="janmashtami"] { --fw-bg: linear-gradient(150deg, #172554 0%, #1d4ed8 55%, #0891b2 100%); --fw-accent: #facc15; --fw-btn-ink: #172554; }
.fw-themed[data-theme="chhath"] { --fw-bg: linear-gradient(170deg, #7c2d12 0%, #ea580c 50%, #fbbf24 100%); --fw-accent: #fff7ed; --fw-btn-ink: #7c2d12; }

/* ---------- shared pieces ---------- */
.fw-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; display: block; }
.fw-x {
    position: absolute; top: 12px; right: 12px; z-index: 3;
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .45);
    background: rgba(255, 255, 255, .16); color: var(--fw-ink); font-size: 20px; line-height: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; transition: transform .2s, background-color .2s;
}
.fw-themed[data-theme="independence"] .fw-x, .fw-themed[data-theme="republic"] .fw-x { border-color: rgba(30, 58, 138, .25); background: rgba(30, 58, 138, .06); }
.fw-x:hover, .fw-x:focus-visible { transform: rotate(90deg); background: rgba(255, 255, 255, .3); outline: none; }
.fw-x:focus-visible { box-shadow: 0 0 0 3px var(--fw-accent); }
.fw-title {
    margin: 0; font-family: 'Montserrat', 'Montserrat Fallback', 'Inter', 'Segoe UI', Arial, sans-serif; font-weight: 800; letter-spacing: -.3px; line-height: 1.15;
    background: var(--fw-title); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: fwShimmer 4s linear infinite;
}
.fw-msg { margin: 0; color: var(--fw-sub); line-height: 1.55; overflow-wrap: anywhere; }
.fw-sign { margin: 0; color: var(--fw-accent); font-weight: 700; font-style: italic; }
.fw-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; font-weight: 800; text-decoration: none;
    background: var(--fw-btn-bg); color: var(--fw-btn-ink); box-shadow: 0 8px 20px rgba(0, 0, 0, .25); transition: transform .15s, box-shadow .15s;
}
.fw-btn:hover, .fw-btn:focus-visible { transform: translateY(-2px); color: var(--fw-btn-ink); text-decoration: none; box-shadow: 0 12px 26px rgba(0, 0, 0, .3); outline: none; }
.fw-btn:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--fw-btn-bg); }
.fw-icon { display: inline-flex; align-items: center; justify-content: center; line-height: 1; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.fw-icon svg { width: 62%; height: auto; display: block; border-radius: 3px; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }

/* ---------- 1. greeting card in the middle (popup) ---------- */
.fw-overlay {
    position: fixed; inset: 0; z-index: 1000000; display: grid; place-items: center; padding: 16px;
    background: radial-gradient(circle at 50% 40%, rgba(30, 20, 60, .45), rgba(10, 6, 25, .78));
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    animation: fwFadeIn .35s ease both;
}
.fw-card {
    position: relative; z-index: 2; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto;
    padding: 34px 26px 26px; border-radius: 26px; text-align: center; color: var(--fw-ink); background: var(--fw-bg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .14) inset;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}
.fw-card::before {   /* soft festive pattern */
    content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: .5;
    background: radial-gradient(circle at 15% 12%, rgba(255, 255, 255, .22), transparent 32%), radial-gradient(circle at 88% 85%, rgba(255, 255, 255, .16), transparent 35%),
                repeating-radial-gradient(circle at 50% -10%, rgba(255, 255, 255, .07) 0 2px, transparent 2px 22px);
}
.fw-card::after {   /* light sweep */
    content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .22), transparent); transform: skewX(-18deg);
    animation: fwSweep 5s ease-in-out 1.2s infinite;
}
.fw-card > * { position: relative; z-index: 1; }
.fw-card .fw-x { position: absolute; }
.fw-card .fw-media { margin: 0 auto 16px; }
.fw-card .fw-icon {
    width: 104px; height: 104px; border-radius: 50%; font-size: 56px; position: relative;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .35), rgba(255, 255, 255, .08)); border: 2px solid rgba(255, 255, 255, .4);
    box-shadow: 0 0 0 8px rgba(255, 255, 255, .08), 0 0 40px var(--fw-accent);
    animation: fwFloat 3.2s ease-in-out infinite;
}
.fw-themed[data-theme="independence"] .fw-card .fw-icon, .fw-themed[data-theme="republic"] .fw-card .fw-icon { border-color: rgba(30, 58, 138, .2); box-shadow: 0 0 0 8px rgba(255, 153, 51, .12), 0 0 34px rgba(19, 136, 8, .35); }
.fw-card .fw-img { display: block; max-width: 100%; max-height: 220px; margin: 0 auto; border-radius: 18px; object-fit: cover; box-shadow: 0 14px 30px rgba(0, 0, 0, .35); border: 3px solid rgba(255, 255, 255, .5); }
.fw-card .fw-title { font-size: clamp(1.6rem, 5vw, 2.15rem); }
.fw-card .fw-msg { margin-top: 12px; font-size: 1rem; }
.fw-card .fw-sign { margin-top: 12px; font-size: .95rem; }
.fw-card .fw-btn { margin-top: 18px; height: 44px; padding: 0 24px; font-size: .95rem; }
/* contents appear one after another once the card has landed */
.fw-card .fw-media, .fw-card .fw-title, .fw-card .fw-msg, .fw-card .fw-sign, .fw-card .fw-btn { animation-name: fwRise; animation-duration: .6s; animation-fill-mode: both; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
.fw-card .fw-media { animation-delay: .35s; }
.fw-card .fw-title { animation: fwRise .6s cubic-bezier(.2, .8, .2, 1) .5s both, fwShimmer 4s linear 1.1s infinite; }
.fw-card .fw-msg { animation-delay: .65s; }
.fw-card .fw-sign { animation-delay: .8s; }
.fw-card .fw-btn { animation-delay: .95s; }
.fw-card .fw-media .fw-icon { animation: fwFloat 3.2s ease-in-out 1s infinite; }

/* ---------- 2. ribbon at the bottom ---------- */
.fw-ribbon {
    position: fixed; left: 0; right: 0; bottom: 14px; margin: 0 auto; z-index: 100040;
    width: min(780px, calc(100vw - 24px)); min-height: 64px; padding: 10px 52px 10px 12px; border-radius: 18px; overflow: hidden;
    display: flex; align-items: center; gap: 12px; color: var(--fw-ink); background: var(--fw-bg);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .3); font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}
.fw-ribbon > *:not(.fw-canvas) { position: relative; z-index: 1; }
.fw-ribbon .fw-x { position: absolute; top: 50%; right: 10px; margin-top: -16px; width: 32px; height: 32px; font-size: 18px; }
.fw-ribbon .fw-media { flex: 0 0 auto; }
.fw-ribbon .fw-icon { width: 46px; height: 46px; border-radius: 50%; font-size: 26px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); animation: fwFloat 3s ease-in-out infinite; }
.fw-ribbon .fw-img { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; display: block; border: 2px solid rgba(255, 255, 255, .5); }
.fw-ribbon .fw-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fw-ribbon .fw-title { font-size: 1.12rem; }
.fw-ribbon .fw-msg { font-size: .84rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fw-ribbon .fw-sign { display: none; }
.fw-ribbon .fw-btn { flex: 0 0 auto; height: 36px; padding: 0 16px; font-size: .84rem; }

/* ---------- 3. small card in the corner ---------- */
.fw-corner {
    position: fixed; left: 16px; bottom: 16px; z-index: 100040; width: 300px; overflow: hidden;
    padding: 20px 18px 18px; border-radius: 20px; text-align: center; color: var(--fw-ink); background: var(--fw-bg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35); font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}
.fw-corner > *:not(.fw-canvas) { position: relative; z-index: 1; }
.fw-corner .fw-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; font-size: 16px; }
.fw-corner .fw-media { margin: 0 auto 10px; }
.fw-corner .fw-icon { width: 62px; height: 62px; border-radius: 50%; font-size: 34px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); box-shadow: 0 0 26px var(--fw-accent); animation: fwFloat 3s ease-in-out infinite; }
.fw-corner .fw-img { display: block; width: 100%; max-height: 140px; object-fit: cover; border-radius: 14px; }
.fw-corner .fw-title { font-size: 1.3rem; }
.fw-corner .fw-msg { margin-top: 6px; font-size: .84rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.fw-corner .fw-sign { margin-top: 6px; font-size: .8rem; }
.fw-corner .fw-btn { margin-top: 12px; height: 36px; padding: 0 16px; font-size: .84rem; }

@media (max-width: 767px) {
    .fw-ribbon { bottom: 72px; padding-right: 46px; }        /* above the phone bottom menu */
    .fw-ribbon .fw-btn { display: none; }
    .fw-ribbon .fw-text { cursor: default; }
    .fw-corner { left: 12px; right: 12px; width: auto; bottom: 72px; }
    .fw-card { padding: 30px 20px 22px; }
}

/* ---------- entrance transitions (admin picks one) ---------- */
.fw-in-zoom { animation: fwZoom .8s cubic-bezier(.2, .9, .3, 1.1) both; }
.fw-in-slide { animation: fwSlide .75s cubic-bezier(.2, .9, .3, 1) both; }
.fw-in-flip { animation: fwFlip .9s cubic-bezier(.2, .8, .3, 1) both; }
.fw-in-bounce { animation: fwBounce 1s cubic-bezier(.3, .7, .4, 1) both; }
.fw-in-swing { transform-origin: top center; animation: fwSwing 1s ease-out both; }
.fw-in-unfold { animation: fwUnfold .85s cubic-bezier(.6, 0, .3, 1) both; }
.fw-in-fade { animation: fwFadeIn .7s ease both; }
.fw-out { animation: fwOut .35s ease forwards !important; }
.fw-overlay.fw-out { animation: fwFadeOut .4s ease forwards !important; }

@keyframes fwZoom { 0% { opacity: 0; transform: scale(.35) rotate(-8deg); } 60% { opacity: 1; transform: scale(1.06) rotate(1.5deg); } 100% { opacity: 1; transform: none; } }
@keyframes fwSlide { 0% { opacity: 0; transform: translateY(90px); } 100% { opacity: 1; transform: none; } }
@keyframes fwFlip { 0% { opacity: 0; transform: perspective(900px) rotateY(-100deg); } 60% { opacity: 1; transform: perspective(900px) rotateY(14deg); } 100% { opacity: 1; transform: perspective(900px) rotateY(0); } }
@keyframes fwBounce { 0% { opacity: 0; transform: translateY(-110vh); } 55% { opacity: 1; transform: translateY(26px); } 72% { transform: translateY(-12px); } 86% { transform: translateY(5px); } 100% { opacity: 1; transform: none; } }
@keyframes fwSwing { 0% { opacity: 0; transform: perspective(900px) rotateX(-95deg); } 55% { opacity: 1; transform: perspective(900px) rotateX(20deg); } 75% { transform: perspective(900px) rotateX(-9deg); } 90% { transform: perspective(900px) rotateX(4deg); } 100% { opacity: 1; transform: perspective(900px) rotateX(0); } }
@keyframes fwUnfold { 0% { opacity: 0; transform: scale(.02, .02); } 40% { opacity: 1; transform: scale(1, .03); } 100% { opacity: 1; transform: none; } }
@keyframes fwFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fwFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes fwOut { to { opacity: 0; transform: scale(.9) translateY(10px); } }
@keyframes fwRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fwFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes fwShimmer { from { background-position: 0% 0; } to { background-position: -200% 0; } }
@keyframes fwSweep { 0%, 70% { left: -60%; } 100% { left: 130%; } }

@media (prefers-reduced-motion: reduce) {
    .fw-overlay, .fw-card, .fw-ribbon, .fw-corner, .fw-card *, .fw-ribbon *, .fw-corner * { animation: fwFadeIn .3s ease both !important; }
    .fw-card::after { display: none; }
    .fw-canvas { display: none; }
}
