/* ============================================
   FEYA - Refined Elegant Background
   Sophisticated Night Sky Theme
   ============================================ */

:root {
    /* Base Color Palette */
    --feya-deep-blue: #0B1A2B;
    --feya-navy: #112240;
    --feya-slate: #1B3A5A;
    --feya-teal: #2ABFB3;
    --feya-teal-light: #5CD4C9;
    --feya-gold: #C9A962;
    --feya-gold-light: #DEC88A;

    /* Transparency Variants */
    --feya-teal-90: rgba(42, 191, 179, 0.9);
    --feya-teal-80: rgba(42, 191, 179, 0.8);
    --feya-teal-60: rgba(42, 191, 179, 0.6);
    --feya-teal-40: rgba(42, 191, 179, 0.4);
    --feya-teal-20: rgba(42, 191, 179, 0.2);
    --feya-teal-12: rgba(42, 191, 179, 0.12);
    --feya-teal-15: rgba(42, 191, 179, 0.15);

    --feya-gold-70: rgba(201, 169, 98, 0.7);
    --feya-gold-50: rgba(201, 169, 98, 0.5);
    --feya-gold-30: rgba(201, 169, 98, 0.3);
    --feya-gold-15: rgba(201, 169, 98, 0.15);
    --feya-gold-12: rgba(201, 169, 98, 0.12);
}

/* ============================================
   ELEGANT BACKGROUND CONTAINER
   ============================================ */
.magical-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(
        170deg,
        #0B1A2B 0%,
        #112240 30%,
        #1B3A5A 60%,
        #112240 80%,
        #0B1A2B 100%
    );
}

/* ============================================
   STARS - Subtle Twinkle
   ============================================ */
.stars-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.star {
    position: absolute;
    background: #FFFFFF;
    border-radius: 50%;
    animation: subtle-twinkle var(--duration, 4s) infinite ease-in-out;
    animation-delay: var(--delay, 0s);
}

@keyframes subtle-twinkle {
    0%, 100% {
        opacity: 0.2;
        transform: scale(0.9);
    }
    50% {
        opacity: 0.8;
        transform: scale(1);
    }
}

/* ============================================
   MOON - Elegant with Soft Halo
   ============================================ */
.moon-container {
    position: absolute;
    top: 8%;
    right: 15%;
    pointer-events: none;
}

.moon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(
        circle at 35% 35%,
        #FFFEF5 0%,
        #F5F0D0 40%,
        #D9CCAA 100%
    );
    box-shadow:
        0 0 40px rgba(255, 254, 245, 0.3),
        0 0 80px rgba(255, 254, 245, 0.15),
        0 0 120px rgba(255, 254, 245, 0.1);
    position: relative;
}

.moon-halo {
    position: absolute;
    top: -40px;
    left: -40px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255, 254, 245, 0.08) 0%,
        transparent 70%
    );
    pointer-events: none;
}

/* ============================================
   FIREFLIES - Elegant Float
   ============================================ */
.fireflies-container {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.firefly {
    position: absolute;
    border-radius: 50%;
    animation: firefly-float var(--duration, 20s) infinite ease-in-out;
    animation-delay: var(--delay, 0s);
}

.firefly-teal {
    background: var(--feya-teal-80);
    box-shadow:
        0 0 10px var(--feya-teal-60),
        0 0 20px var(--feya-teal-40);
}

.firefly-gold {
    background: var(--feya-gold-70);
    box-shadow:
        0 0 10px var(--feya-gold-50),
        0 0 20px var(--feya-gold-30);
}

@keyframes firefly-float {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0.3;
    }
    25% {
        transform: translate(var(--fx1, 30px), var(--fy1, -20px));
        opacity: 0.8;
    }
    50% {
        transform: translate(var(--fx2, -20px), var(--fy2, -40px));
        opacity: 0.5;
    }
    75% {
        transform: translate(var(--fx3, 40px), var(--fy3, -10px));
        opacity: 0.9;
    }
}

/* ============================================
   AURORA - Soft Drift
   ============================================ */
.aurora-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60%;
    overflow: hidden;
    pointer-events: none;
}

.aurora {
    position: absolute;
    width: 100%;
    height: 100%;
    filter: blur(100px);
    animation: aurora-drift var(--duration, 30s) infinite ease-in-out;
}

.aurora-teal {
    background: radial-gradient(
        ellipse 80% 50% at 30% 20%,
        var(--feya-teal-12) 0%,
        transparent 70%
    );
    opacity: 0.12;
}

.aurora-gold {
    background: radial-gradient(
        ellipse 60% 40% at 70% 30%,
        var(--feya-gold-12) 0%,
        transparent 70%
    );
    opacity: 0.12;
    animation-delay: -15s;
    animation-direction: reverse;
}

@keyframes aurora-drift {
    0%, 100% {
        transform: translateX(0) translateY(0) scale(1);
    }
    50% {
        transform: translateX(5%) translateY(3%) scale(1.1);
    }
}

/* ============================================
   MIST - Subtle Ground Layer
   ============================================ */
.mist-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    overflow: hidden;
    pointer-events: none;
}

.mist {
    position: absolute;
    bottom: 0;
    width: 200%;
    height: 100%;
}

.mist-teal {
    background: linear-gradient(
        0deg,
        var(--feya-teal-15) 0%,
        transparent 60%
    );
    animation: mist-flow 60s infinite linear;
}

.mist-gold {
    background: linear-gradient(
        0deg,
        var(--feya-gold-15) 0%,
        transparent 50%
    );
    animation: mist-flow 80s infinite linear reverse;
}

@keyframes mist-flow {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================
   HORIZON LINE - Subtle Glow
   ============================================ */
.horizon {
    position: absolute;
    bottom: 15%;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--feya-teal-20) 20%,
        var(--feya-teal-40) 50%,
        var(--feya-teal-20) 80%,
        transparent 100%
    );
    filter: blur(2px);
    pointer-events: none;
}

/* ============================================
   RESPONSIVE - Mobile Optimization
   ============================================ */
@media (max-width: 768px) {
    .moon-container {
        top: 5%;
        right: 8%;
    }

    .moon {
        width: 50px;
        height: 50px;
    }

    .moon-halo {
        width: 100px;
        height: 100px;
        top: -25px;
        left: -25px;
    }

    .aurora {
        filter: blur(60px);
    }
}

/* ============================================
   REDUCED MOTION - Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .star,
    .firefly,
    .aurora,
    .mist {
        animation: none !important;
    }

    .star {
        opacity: 0.5;
    }

    .firefly {
        opacity: 0.6;
    }

    .aurora {
        opacity: 0.1;
    }
}
