/* Basic Setup */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #000;
    color: white;
    margin: 0;
    transition: background-color 0.4s ease, color 0.4s ease;
    height: 100vh;
    overflow: hidden; /* Prevents scrollbars from the animations */
}

/* Space Theme */
.space-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.stars {
    background-image: radial-gradient(white 1px, transparent 1px);
    background-size: 20px 20px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: moveStars 50s linear infinite;
    z-index: -2;
}

@keyframes moveStars {
    from { transform: translateY(0); }
    to { transform: translateY(-1000px); }
}

.astronaut {
    width: 150px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float 6s ease-in-out infinite;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    50% { transform: translate(-50%, -60%) rotate(10deg); }
}

.content {
    position: relative; /* Establish stacking context */
    z-index: 1;
}

/* Typography */
.error-code {
    font-size: 160px;
    font-weight: 700;
    margin: 0;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.error-message {
    font-size: 24px;
    margin-bottom: 30px;
}

.countdown-message {
    font-size: 14px;
    color: #ccc;
    margin-top: 30px;
}

/* Buttons */
.buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.spaceship-button {
    background-color: #ff4500; /* A nice orange for contrast */
}

/* Mouse Follower */
.mouse-follower {
    position: fixed;
    width: 20px;
    height: 20px;
    background-color: #fff;
    border-radius: 50%;
    pointer-events: none; /* So it doesn't block clicks on other elements */
    z-index: 2; /* Above stars and astronaut, but below modals if any */
    box-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #007bff;
    /* A simple transition for smooth movement */
    transition: transform 0.1s ease-out;
    /* Start off-screen or hidden */
    transform: translate(-100%, -100%);
}

/* Theme Toggle Button */
.theme-toggle-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 100;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.theme-toggle-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Light Mode Styles */
body.light-mode {
    background-color: #f0f2f5;
    color: #333;
}

body.light-mode .error-code {
    color: #1d2129;
}

body.light-mode .countdown-message {
    color: #666;
}

body.light-mode .stars,
body.light-mode .mouse-follower {
    display: none; /* Hide space elements in light mode */
}

/* Responsive Design */
@media (max-width: 600px) {
    .error-code {
        font-size: 100px;
    }

    .error-message {
        font-size: 18px;
    }

    .button {
        width: 80%;
    }

    .astronaut {
        width: 100px;
    }
}
