/* Day/Night Transition Effect */

.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.transition-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Sky gradient background */
.sky-gradient {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: all 2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Night to Day transition */
.sky-gradient.night-to-day {
    background: linear-gradient(
        180deg,
        #0a0e27 0%,      /* Deep night */
        #1e3c72 20%,     /* Dark blue */
        #2a5298 40%,     /* Dawn blue */
        #7e8ba3 60%,     /* Morning gray */
        #f4a460 80%,     /* Sunrise orange */
        #87ceeb 100%     /* Day sky */
    );
    animation: sunriseGradient 3s ease-in-out;
}

/* Day to Night transition */
.sky-gradient.day-to-night {
    background: linear-gradient(
        180deg,
        #87ceeb 0%,      /* Day sky */
        #f4a460 20%,     /* Sunset orange */
        #ff6b6b 40%,     /* Sunset red */
        #4a5568 60%,     /* Dusk gray */
        #2d3748 80%,     /* Evening */
        #0a0e27 100%     /* Deep night */
    );
    animation: sunsetGradient 3s ease-in-out;
}

/* Sun/Moon */
.celestial-body {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    transition: all 3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sun {
    background: radial-gradient(circle, #fff3b0 0%, #ffeb3b 40%, #ffc107 100%);
    box-shadow: 
        0 0 60px 20px rgba(255, 235, 59, 0.5),
        0 0 100px 40px rgba(255, 235, 59, 0.3);
    left: 50%;
    transform: translateX(-50%);
}

.sun.rising {
    bottom: -100px;
    animation: sunRise 3s ease-in-out forwards;
}

.sun.setting {
    top: 20%;
    animation: sunSet 3s ease-in-out forwards;
}

.moon {
    background: radial-gradient(circle at 30% 30%, #f0f0f0 0%, #d0d0d0 100%);
    box-shadow: 
        0 0 40px 10px rgba(200, 200, 255, 0.3),
        0 0 80px 20px rgba(200, 200, 255, 0.2);
    left: 50%;
    transform: translateX(-50%);
    position: relative;
}

.moon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(100, 100, 150, 0.1) 100%);
}

.moon.rising {
    bottom: -100px;
    animation: moonRise 3s ease-in-out forwards;
}

.moon.setting {
    top: 20%;
    animation: moonSet 3s ease-in-out forwards;
}

/* Stars */
.stars-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

.star.small {
    width: 1px;
    height: 1px;
    box-shadow: 0 0 2px white;
}

.star.medium {
    width: 2px;
    height: 2px;
    box-shadow: 0 0 4px white;
}

.star.large {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 6px white;
}

.stars-container.fade-in .star {
    animation: starFadeIn 2s ease-in-out forwards;
}

.stars-container.fade-out .star {
    animation: starFadeOut 1s ease-in-out forwards;
}

/* Clouds */
.cloud {
    position: absolute;
    background: white;
    border-radius: 100px;
    opacity: 0;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 100px;
}

.cloud.day-cloud {
    width: 100px;
    height: 40px;
    opacity: 0.7;
}

.cloud.day-cloud::before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 10px;
}

.cloud.day-cloud::after {
    width: 60px;
    height: 40px;
    top: -15px;
    right: 10px;
}

.cloud.fade-in {
    animation: cloudFadeIn 2s ease-in-out forwards;
}

.cloud.fade-out {
    animation: cloudFadeOut 2s ease-in-out forwards;
}

/* Animations */
@keyframes sunriseGradient {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sunsetGradient {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sunRise {
    0% {
        bottom: -100px;
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
    100% {
        bottom: 60%;
        opacity: 1;
    }
}

@keyframes sunSet {
    0% {
        top: 20%;
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        top: 110%;
        opacity: 0;
    }
}

@keyframes moonRise {
    0% {
        bottom: -100px;
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
    100% {
        bottom: 60%;
        opacity: 1;
    }
}

@keyframes moonSet {
    0% {
        top: 20%;
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        top: 110%;
        opacity: 0;
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes starFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes starFadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes cloudFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 0.7;
        transform: translateX(0);
    }
}

@keyframes cloudFadeOut {
    0% {
        opacity: 0.7;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* Floating clouds animation */
.cloud.floating {
    animation: floatCloud 20s infinite linear;
}

@keyframes floatCloud {
    0% {
        transform: translateX(-150px);
    }
    100% {
        transform: translateX(calc(100vw + 150px));
    }
}

/* Aurora effect for night */
.aurora {
    position: absolute;
    width: 100%;
    height: 40%;
    top: 10%;
    opacity: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 255, 150, 0.1),
        rgba(0, 150, 255, 0.1),
        rgba(150, 0, 255, 0.1),
        transparent
    );
    filter: blur(40px);
    animation: auroraWave 10s infinite ease-in-out;
}

.aurora.active {
    opacity: 0.5;
}

@keyframes auroraWave {
    0%, 100% {
        transform: translateX(-10%) scaleX(1);
    }
    50% {
        transform: translateX(10%) scaleX(1.2);
    }
}

/* Shooting star */
.shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    opacity: 0;
}

.shooting-star::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, white, transparent);
    right: 2px;
    top: 0;
}

.shooting-star.active {
    animation: shootingStar 2s ease-out forwards;
}

@keyframes shootingStar {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(-45deg);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(300px, 300px) rotate(-45deg);
    }
}
