/* ═══════════════════════════════════════════════════════════════
   EID MUBARAK GREETING OVERLAY — Sara Learning Global
   ═══════════════════════════════════════════════════════════════
   Temporary festive enhancement. To remove after Eid:
   1. Delete this file (css/eid-greeting.css)
   2. Delete js/eid-greeting.js
   3. Remove the marked blocks in index.html
   ═══════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─────────────────────────────────────────── */
:root {
    --eid-bg: #0a1628;
    --eid-bg-secondary: #0f1f36;
    --eid-gold: #c9a94e;
    --eid-gold-light: #d4b95e;
    --eid-gold-glow: rgba(201, 169, 78, 0.25);
    --eid-white: #ffffff;
    --eid-white-soft: rgba(255, 255, 255, 0.85);
    --eid-white-muted: rgba(255, 255, 255, 0.5);
    --eid-blue-glow: rgba(37, 99, 235, 0.12);
    --eid-transition: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Overlay Container ─────────────────────────────────────── */
#eid-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: var(--eid-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.6s var(--eid-transition),
                opacity 0.6s var(--eid-transition);
    will-change: transform, opacity;
}

/* Ambient background glow — pulsing warmth */
#eid-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 40%, var(--eid-gold-glow) 0%, transparent 70%),
        radial-gradient(ellipse 40% 60% at 30% 70%, var(--eid-blue-glow) 0%, transparent 60%),
        radial-gradient(ellipse 35% 45% at 75% 60%, rgba(201, 169, 78, 0.08) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
    animation: eidAmbientPulse 6s ease-in-out infinite;
}

@keyframes eidAmbientPulse {
    0%, 100% { opacity: 0.7; }
    50%      { opacity: 1; }
}

/* Subtle grain texture overlay */
#eid-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* Body scroll lock when overlay is active */
body.eid-overlay-active {
    overflow: hidden !important;
}

/* ─── Decorative Stars ──────────────────────────────────────── */
.eid-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.eid-star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--eid-white);
    border-radius: 50%;
    opacity: 0;
    animation: eidStarTwinkle 3s ease-in-out infinite;
}

.eid-star:nth-child(1)  { top: 8%;  left: 12%; animation-delay: 0s; }
.eid-star:nth-child(2)  { top: 15%; left: 85%; animation-delay: 0.5s; width: 2px; height: 2px; }
.eid-star:nth-child(3)  { top: 22%; left: 40%; animation-delay: 1.2s; }
.eid-star:nth-child(4)  { top: 10%; left: 65%; animation-delay: 0.8s; width: 4px; height: 4px; }
.eid-star:nth-child(5)  { top: 30%; left: 20%; animation-delay: 1.8s; width: 2px; height: 2px; }
.eid-star:nth-child(6)  { top: 5%;  left: 50%; animation-delay: 2.2s; }
.eid-star:nth-child(7)  { top: 18%; left: 72%; animation-delay: 0.3s; width: 2px; height: 2px; }
.eid-star:nth-child(8)  { top: 35%; left: 90%; animation-delay: 1.5s; }
.eid-star:nth-child(9)  { top: 12%; left: 30%; animation-delay: 2.5s; width: 4px; height: 4px; }
.eid-star:nth-child(10) { top: 25%; left: 55%; animation-delay: 0.7s; width: 2px; height: 2px; }
.eid-star:nth-child(11) { top: 6%;  left: 78%; animation-delay: 1.9s; }
.eid-star:nth-child(12) { top: 28%; left: 8%;  animation-delay: 2.8s; width: 2px; height: 2px; }

@keyframes eidStarTwinkle {
    0%, 100% { opacity: 0.1;  transform: scale(1); }
    40%      { opacity: 0.8;  transform: scale(1.4); }
    60%      { opacity: 0.6;  transform: scale(1.2); }
}

/* ─── Floating Golden Particles ─────────────────────────────── */
.eid-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.eid-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--eid-gold);
    border-radius: 50%;
    opacity: 0;
    animation: eidParticleFloat 12s ease-in-out infinite;
}

.eid-particle:nth-child(1)  { left: 5%;  animation-delay: 0s;   animation-duration: 14s; width: 2px; height: 2px; }
.eid-particle:nth-child(2)  { left: 12%; animation-delay: 1.5s; animation-duration: 11s; }
.eid-particle:nth-child(3)  { left: 20%; animation-delay: 3s;   animation-duration: 13s; width: 2px; height: 2px; }
.eid-particle:nth-child(4)  { left: 28%; animation-delay: 0.5s; animation-duration: 10s; }
.eid-particle:nth-child(5)  { left: 35%; animation-delay: 4s;   animation-duration: 15s; width: 4px; height: 4px; }
.eid-particle:nth-child(6)  { left: 42%; animation-delay: 2s;   animation-duration: 12s; width: 2px; height: 2px; }
.eid-particle:nth-child(7)  { left: 50%; animation-delay: 5s;   animation-duration: 11s; }
.eid-particle:nth-child(8)  { left: 58%; animation-delay: 1s;   animation-duration: 14s; width: 2px; height: 2px; }
.eid-particle:nth-child(9)  { left: 65%; animation-delay: 3.5s; animation-duration: 13s; }
.eid-particle:nth-child(10) { left: 72%; animation-delay: 0.8s; animation-duration: 10s; width: 4px; height: 4px; }
.eid-particle:nth-child(11) { left: 78%; animation-delay: 2.5s; animation-duration: 15s; width: 2px; height: 2px; }
.eid-particle:nth-child(12) { left: 84%; animation-delay: 4.5s; animation-duration: 12s; }
.eid-particle:nth-child(13) { left: 90%; animation-delay: 1.2s; animation-duration: 11s; width: 2px; height: 2px; }
.eid-particle:nth-child(14) { left: 95%; animation-delay: 3.8s; animation-duration: 14s; }
.eid-particle:nth-child(15) { left: 8%;  animation-delay: 6s;   animation-duration: 13s; width: 2px; height: 2px; }
.eid-particle:nth-child(16) { left: 48%; animation-delay: 7s;   animation-duration: 12s; }
.eid-particle:nth-child(17) { left: 62%; animation-delay: 5.5s; animation-duration: 14s; width: 2px; height: 2px; }
.eid-particle:nth-child(18) { left: 32%; animation-delay: 6.5s; animation-duration: 11s; }

@keyframes eidParticleFloat {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    5% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.3;
        transform: translateY(40vh) translateX(20px);
    }
    95% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-10vh) translateX(-10px);
        opacity: 0;
    }
}

/* ─── Crescent Moon ─────────────────────────────────────────── */
.eid-moon {
    position: absolute;
    top: 5%;
    right: 10%;
    z-index: 1;
    opacity: 0;
    animation: eidMoonReveal 2s cubic-bezier(0.23, 1, 0.32, 1) 0.3s forwards;
}

.eid-moon svg {
    width: 150px;
    height: 150px;
    filter: drop-shadow(0 0 30px rgba(201, 169, 78, 0.3))
            drop-shadow(0 0 60px rgba(201, 169, 78, 0.12));
    animation: eidMoonGlow 4s ease-in-out infinite 2.3s;
}

@keyframes eidMoonReveal {
    0% {
        opacity: 0;
        transform: translateY(-30px) rotate(-15deg) scale(0.8);
    }
    60% {
        opacity: 1;
        transform: translateY(4px) rotate(2deg) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }
}

@keyframes eidMoonGlow {
    0%, 100% {
        filter: drop-shadow(0 0 40px rgba(201, 169, 78, 0.35))
                drop-shadow(0 0 80px rgba(201, 169, 78, 0.15));
    }
    50% {
        filter: drop-shadow(0 0 55px rgba(201, 169, 78, 0.5))
                drop-shadow(0 0 100px rgba(201, 169, 78, 0.25));
    }
}

/* ─── Lanterns ──────────────────────────────────────────────── */
.eid-lantern {
    position: absolute;
    z-index: 1;
    opacity: 0;
}

.eid-lantern svg {
    filter: drop-shadow(0 0 15px var(--eid-gold-glow))
            drop-shadow(0 8px 24px rgba(0, 0, 0, 0.3));
    position: relative;
    z-index: 1;
}

/* Visible warm glow behind each lantern */
.eid-lantern::after {
    content: '';
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 80px;
    background: radial-gradient(
        ellipse at center,
        rgba(212, 175, 55, 0.25) 0%,
        rgba(201, 169, 78, 0.12) 35%,
        rgba(201, 169, 78, 0.04) 60%,
        transparent 80%
    );
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    animation: eidLanternGlowPulse 3s ease-in-out infinite;
}

@keyframes eidLanternGlowPulse {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50%      { opacity: 1;   transform: translateX(-50%) scale(1.15); }
}

.eid-lantern--left {
    top: 5%;
    left: 10%;
    animation: eidLanternSwingLeft 5s ease-in-out infinite,
               eidLanternDrop 1.4s cubic-bezier(0.23, 1, 0.32, 1) 0.4s forwards;
    transform-origin: top center;
}

.eid-lantern--right {
    top: 4%;
    right: 12%;
    animation: eidLanternSwingRight 5.5s ease-in-out infinite,
               eidLanternDrop 1.4s cubic-bezier(0.23, 1, 0.32, 1) 0.7s forwards;
    transform-origin: top center;
}

.eid-lantern--left-inner {
    top: 12%;
    left: 22%;
    animation: eidLanternSwingLeft 4.5s ease-in-out infinite,
               eidLanternDrop 1.4s cubic-bezier(0.23, 1, 0.32, 1) 0.9s forwards;
    transform-origin: top center;
}

.eid-lantern--right-inner {
    top: 10%;
    right: 24%;
    animation: eidLanternSwingRight 4.8s ease-in-out infinite,
               eidLanternDrop 1.4s cubic-bezier(0.23, 1, 0.32, 1) 1.1s forwards;
    transform-origin: top center;
}

/* Smaller glow for inner lanterns */
.eid-lantern--left-inner::after,
.eid-lantern--right-inner::after {
    width: 45px;
    height: 60px;
}

/* Lanterns drop in from above with a gentle bounce */
@keyframes eidLanternDrop {
    0%   { opacity: 0; transform: translateY(-60px) rotate(0deg); }
    50%  { opacity: 0.8; transform: translateY(8px) rotate(2deg); }
    70%  { transform: translateY(-3px) rotate(-1deg); }
    100% { opacity: 0.75; transform: translateY(0) rotate(0deg); }
}

@keyframes eidLanternSwingLeft {
    0%, 100% { transform: rotate(-2.5deg); }
    50%      { transform: rotate(2.5deg); }
}

@keyframes eidLanternSwingRight {
    0%, 100% { transform: rotate(2.5deg); }
    50%      { transform: rotate(-2.5deg); }
}

/* Lantern inner glow pulse */
.eid-lantern svg ellipse[fill*="Glow"],
.eid-lantern svg ellipse[opacity="0.1"] {
    animation: eidLanternInnerGlow 3s ease-in-out infinite;
}

@keyframes eidLanternInnerGlow {
    0%, 100% { opacity: 0.1; }
    50%      { opacity: 0.25; }
}

/* ─── Greeting Content ──────────────────────────────────────── */
.eid-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 24px;
    max-width: 700px;
}

/* Soft glow behind content */
.eid-content::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 300px;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse, rgba(201, 169, 78, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    animation: eidContentGlow 5s ease-in-out infinite;
}

@keyframes eidContentGlow {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.1); }
}

/* Decorative divider above title */
.eid-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
    opacity: 0;
    animation: eidFadeInUp 1s cubic-bezier(0.23, 1, 0.32, 1) 0.5s forwards;
}

.eid-divider-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--eid-gold), transparent);
}

.eid-divider-star {
    color: var(--eid-gold);
    font-size: 10px;
    opacity: 0.8;
    animation: eidDividerStarSpin 8s linear infinite;
}

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

/* Main heading */
.eid-title {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(2.8rem, 7vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 28px;
    background: linear-gradient(135deg, var(--eid-gold-light) 0%, var(--eid-gold) 30%, #e8d48b 50%, var(--eid-gold) 70%, var(--eid-gold-light) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    animation: eidTitleReveal 1s cubic-bezier(0.23, 1, 0.32, 1) 0.8s forwards,
               eidTitleShimmer 4s ease-in-out infinite 1.8s;
    text-shadow: none;
}

@keyframes eidTitleReveal {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        letter-spacing: 0.05em;
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        letter-spacing: -0.02em;
    }
}

@keyframes eidTitleShimmer {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* Blessing message */
.eid-message {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 400;
    line-height: 1.8;
    color: var(--eid-white-soft);
    margin-bottom: 20px;
    opacity: 0;
    animation: eidFadeInUp 1s cubic-bezier(0.23, 1, 0.32, 1) 1.2s forwards;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

/* Attribution */
.eid-attribution {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--eid-white-muted);
    letter-spacing: 0.03em;
    opacity: 0;
    animation: eidFadeInUp 1s cubic-bezier(0.23, 1, 0.32, 1) 1.5s forwards;
}

.eid-attribution span {
    color: var(--eid-gold);
    font-weight: 600;
}

/* Divider below text */
.eid-divider-bottom {
    margin-top: 32px;
    margin-bottom: 0;
    animation-delay: 1.7s;
}

@keyframes eidFadeInUp {
    0% {
        opacity: 0;
        transform: translateY(28px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Scroll Indicator ──────────────────────────────────────── */
.eid-scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0;
    animation: eidScrollHintIn 1s cubic-bezier(0.23, 1, 0.32, 1) 2.2s forwards;
}

@keyframes eidScrollHintIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.eid-scroll-hint-text {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--eid-white-muted);
}

.eid-scroll-hint-icon {
    width: 28px;
    height: 44px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
}

.eid-scroll-hint-dot {
    width: 4px;
    height: 8px;
    background: var(--eid-gold);
    border-radius: 2px;
    animation: eidScrollDot 1.8s ease-in-out infinite;
}

@keyframes eidScrollDot {
    0%        { opacity: 1; transform: translateY(0); }
    50%       { opacity: 0.3; transform: translateY(14px); }
    100%      { opacity: 1; transform: translateY(0); }
}

.eid-scroll-hint-chevrons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.eid-scroll-hint-chevrons svg {
    width: 16px;
    height: 10px;
    color: var(--eid-white-muted);
    animation: eidChevronBounce 1.8s ease-in-out infinite;
}

.eid-scroll-hint-chevrons svg:nth-child(2) {
    animation-delay: 0.15s;
    opacity: 0.5;
}

@keyframes eidChevronBounce {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50%      { transform: translateY(4px); opacity: 1; }
}

/* ─── Overlay Dismissal States ──────────────────────────────── */
#eid-overlay.eid-dismissing {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

#eid-overlay.eid-dismissed {
    display: none !important;
}

/* ─── Responsive Design ─────────────────────────────────────── */

/* Tablet */
@media (max-width: 768px) {
    .eid-moon {
        top: 4%;
        right: 5%;
    }

    .eid-moon svg {
        width: 110px;
        height: 110px;
    }

    .eid-lantern--left       { left: 5%; }
    .eid-lantern--right      { right: 5%; }
    .eid-lantern--left-inner { left: 16%; }
    .eid-lantern--right-inner{ right: 16%; }

    .eid-lantern svg {
        transform: scale(0.8);
    }

    .eid-divider-line {
        width: 40px;
    }

    .eid-scroll-hint {
        bottom: 30px;
    }

    .eid-content::before {
        width: 350px;
        height: 220px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .eid-moon {
        top: 3%;
        right: 3%;
    }

    .eid-moon svg {
        width: 85px;
        height: 85px;
    }

    .eid-lantern--left-inner,
    .eid-lantern--right-inner {
        display: none;
    }

    .eid-lantern svg {
        transform: scale(0.65);
    }

    .eid-content {
        padding: 0 20px;
    }

    .eid-title {
        margin-bottom: 20px;
    }

    .eid-message {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .eid-scroll-hint {
        bottom: 24px;
    }

    .eid-scroll-hint-text {
        font-size: 10px;
    }

    .eid-content::before {
        width: 280px;
        height: 180px;
    }
}

/* ─── Accessibility: Reduced Motion ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .eid-star,
    .eid-particle {
        animation: none;
        opacity: 0.4;
    }

    .eid-moon {
        animation: none;
        opacity: 1;
    }

    .eid-moon svg {
        animation: none;
    }

    .eid-lantern {
        animation: none;
        opacity: 0.7;
    }

    .eid-title,
    .eid-message,
    .eid-attribution,
    .eid-divider,
    .eid-scroll-hint {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .eid-scroll-hint {
        transform: translateX(-50%);
    }

    .eid-divider-star {
        animation: none;
    }

    .eid-content::before {
        animation: none;
    }

    #eid-overlay::before {
        animation: none;
    }

    .eid-scroll-hint-dot {
        animation: none;
    }

    .eid-scroll-hint-chevrons svg {
        animation: none;
        opacity: 0.6;
    }

    #eid-overlay.eid-dismissing {
        transition: opacity 0.3s ease;
        transform: none;
        opacity: 0;
    }
}
