/* ===== PRELOADER STYLES ===== */
/* Base Styles */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        #050514 0%,
        #0a0a1f 25%,
        #0f0f2a 50%,
        #070712 100%
    );
    color: white;
    z-index: 9999;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease, visibility 1s ease;
}

.loading-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Stars Background */
.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
}

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

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

/* Space Scene Container */
.space-scene {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto;
    z-index: 10;
}

/* Orbit Ring */
.orbit {
    position: absolute;
    width: 280px;
    height: 280px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    animation: orbit-glow 3s infinite ease-in-out;
}

@keyframes orbit-glow {
    0%,
    100% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(57, 190, 255, 0.4);
    }
}

/* Moon Styles */
.moon-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.moon {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, #6dd5ed 0%, #2193b0 50%, #1e88e5 100%);
    border-radius: 50%;
    position: relative;
    overflow: visible;
    box-shadow: 0 0 50px rgba(109, 213, 237, 0.8),
        inset -20px -20px 0 rgba(0, 0, 0, 0.15);
    animation: moon-glow 4s infinite ease-in-out;
}

@keyframes moon-glow {
    0%,
    100% {
        box-shadow: 0 0 50px rgba(109, 213, 237, 0.8),
            inset -20px -20px 0 rgba(0, 0, 0, 0.15);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 70px rgba(109, 213, 237, 1),
            inset -20px -20px 0 rgba(0, 0, 0, 0.2);
        transform: scale(1.02);
    }
}

/* Moon Craters */
.crater {
    background: rgba(33, 147, 176, 0.7);
    border-radius: 50%;
    position: absolute;
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.4);
}

.crater1 {
    width: 25px;
    height: 25px;
    top: 30px;
    left: 85px;
}
.crater2 {
    width: 18px;
    height: 18px;
    bottom: 20px;
    left: 55px;
}
.crater3 {
    width: 22px;
    height: 22px;
    left: 20px;
    top: 70px;
}
.crater4 {
    width: 15px;
    height: 15px;
    left: 120px;
    top: 40px;
}
.crater5 {
    width: 20px;
    height: 20px;
    left: 40px;
    bottom: 10px;
}

/* Rocket Animation */
.rocket-path {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 280px;
    height: 280px;
    margin: -140px 0 0 -140px;
    animation: rotate 8s linear infinite;
    transform-origin: center;
    z-index: 10;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rocket {
    width: 22px;
    height: 45px;
    background: linear-gradient(to bottom, #ffffff 0%, #f0f0f0 100%);
    border-radius: 50% 50% 0 0;
    position: relative;
    left: -11px;
    top: 118px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 15;
}

.rocket:before {
    content: "";
    position: absolute;
    width: 50px;
    height: 18px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    border-radius: 50% 50% 0 0;
    right: -14px;
    bottom: 0;
    z-index: -1;
}

.window {
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #87ceeb 0%, #4682b4 100%);
    border: 2px solid white;
    border-radius: 50%;
    position: relative;
    top: 15px;
    left: 3px;
}

.flame {
    position: absolute;
    width: 8px;
    height: 15px;
    background: linear-gradient(to bottom, #ff9500, #ff6b00, #ff4500);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    animation: flame-flicker 0.3s infinite alternate;
}

@keyframes flame-flicker {
    0% {
        transform: translateX(-50%) scaleY(1) scaleX(1);
    }
    100% {
        transform: translateX(-50%) scaleY(1.2) scaleX(0.8);
    }
}

/* Landing Elements */
.landed-rocket {
    width: 22px;
    height: 45px;
    background: linear-gradient(to bottom, #ffffff 0%, #f0f0f0 100%);
    border-radius: 50% 50% 0 0;
    position: absolute;
    bottom: 176px;
    right: 82px;
    transform: rotate(-25deg);
    z-index: 15;
    opacity: 0;
    transition: all 1.2s ease;
}

.landed-window {
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #87ceeb 0%, #4682b4 100%);
    border: 2px solid white;
    border-radius: 50%;
    position: relative;
    top: 15px;
    left: 3px;
}

/* Astronaut */
.astronaut {
    width: 32px;
    height: 45px;
    position: absolute;
    bottom: 125px;
    right: 0;
    z-index: 15;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1.2s ease;
}

.astronaut-body {
    width: 20px;
    height: 28px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%);
    border-radius: 12px 12px 6px 6px;
    position: relative;
}

.astronaut-helmet {
    width: 24px;
    height: 24px;
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #f0f0f0 100%);
    border-radius: 50%;
    position: absolute;
    top: -18px;
    left: -2px;
}

.astronaut-visor {
    width: 16px;
    height: 10px;
    background: linear-gradient(135deg, #87ceeb 0%, #4682b4 100%);
    border-radius: 8px 8px 0 0;
    position: absolute;
    top: 6px;
    left: 4px;
}

/* Flag */
.flag-pole {
    width: 3px;
    height: 40px;
    background: linear-gradient(to bottom, #e0e0e0, #999999);
    position: absolute;
    top: -20px;
    left: 25px;
}

.flag {
    width: 24px;
    height: 15px;
    background: linear-gradient(135deg, #ff4757 0%, #ff3838 100%);
    position: absolute;
    top: -20px;
    left: 28px;
    border-radius: 0 4px 4px 0;
    animation: flag-wave 2.5s infinite ease-in-out;
}

@keyframes flag-wave {
    0%,
    100% {
        transform: rotateY(0deg) rotateX(0deg);
    }
    50% {
        transform: rotateY(20deg) rotateX(5deg);
    }
}

/* Loading Progress */
.loading-text {
    position: absolute;
    bottom: 15%;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 20px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.progress-bar {
    width: 250px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin: 15px auto;
    overflow: hidden;
}

.progress {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #4fc3f7 0%, #29b6f6 50%, #0288d1 100%);
    border-radius: 10px;
    transition: width 0.4s ease;
    animation: progress-glow 2s infinite ease-in-out;
}

@keyframes progress-glow {
    0%,
    100% {
        box-shadow: 0 0 10px rgba(57, 190, 255, 0.6);
    }
    50% {
        box-shadow: 0 0 20px rgba(57, 190, 255, 0.9);
    }
}

/* Completion States */
.loading-complete .orbit {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.2);
}

.loading-complete .rocket-path {
    animation: none;
    opacity: 0;
    transform: scale(0.8);
}

.loading-complete .landed-rocket {
    opacity: 1;
    transform: rotate(0deg);
}

.loading-complete .astronaut {
    opacity: 1;
    transform: translateY(0);
}

/* Planets */
.planets {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

.planet {
    position: absolute;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.jupiter {
    width: 70px;
    height: 70px;
    background: radial-gradient(circle at 30% 30%, #ffd93d 0%, #f39c12 100%);
    top: 15%;
    left: 10%;
}

.saturn {
    width: 55px;
    height: 55px;
    background: radial-gradient(circle at 40% 40%, #f8e58c 0%, #f39c12 100%);
    top: 70%;
    right: 15%;
}

.mars {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle at 30% 30%, #ff8a80 0%, #e74c3c 100%);
    top: 25%;
    right: 20%;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-25px) rotate(3deg);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .space-scene {
        width: 300px;
        height: 300px;
    }

    .moon {
        width: 140px;
        height: 140px;
    }

    .loading-text {
        font-size: 16px;
    }
}
