/* Satellite Animation
   A robotic eye-like device inspired by GLaDOS
   Desktop only - not shown on mobile devices
*/

.satellite-container {
    position: fixed;
    top: 0;
    transform: translateY(-100px); /* Hidden initially */
    z-index: 50; /* Lower than header (100) but above most content */
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none; /* Don't interfere with header elements */
    will-change: transform, left; /* Optimize for animations */
}

.satellite-container.active {
    transform: translateY(0); /* Fully visible */
}

.satellite-container.leaving {
    transform: translateY(-100px);
    transition: transform 0.6s cubic-bezier(0.6, -0.28, 0.735, 0.045);
}

/* Stem (the part that extends from the header) */
.satellite-stem {
    position: absolute;
    top: -50px; /* Longer to reach the header */
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 50px;
    background-color: var(--primary-color);
    box-shadow: 0 0 8px var(--glow-color);
}

/* Satellite head with eye */
.satellite-head {
    position: relative;
    top: 0;
    left: 0;
    transform-origin: center center;
    transition: transform 0.1s ease-out;
}

/* Outer eye casing */
.satellite-eye-outer {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #333;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 10px var(--glow-color);
    overflow: hidden;
}

/* Inner eye (iris) */
.satellite-eye-inner {
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-radius: 50%;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 8px var(--glow-color), inset 0 0 10px var(--glow-color);
    background-color: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pupil */
.satellite-pupil {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
    box-shadow: 0 0 15px var(--glow-color-intense);
    transition: width 0.2s, height 0.2s, box-shadow 0.2s;
}

/* Eye lids (top and bottom) */
.satellite-eye-lid {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    background-color: #222;
    border: 1px solid var(--primary-color);
    transition: height 0.3s;
    z-index: 2;
}

.satellite-eye-lid.top {
    top: 0;
    border-bottom: 1px solid var(--primary-color);
    border-radius: 40px 40px 0 0;
}

.satellite-eye-lid.bottom {
    bottom: 0;
    border-top: 1px solid var(--primary-color);
    border-radius: 0 0 40px 40px;
}

/* Blinking animation for eye */
.satellite-container.blink .satellite-eye-lid.top {
    height: 20px;
}

.satellite-container.blink .satellite-eye-lid.bottom {
    height: 20px;
}

/* Small antenna attached to the eye */
.satellite-antenna {
    position: absolute;
    top: -15px;
    right: -5px;
    width: 2px;
    height: 20px;
    background-color: var(--primary-color);
    box-shadow: 0 0 5px var(--glow-color);
    transform: rotate(-15deg);
}

/* Red blinking light at tip of antenna */
.satellite-red-light {
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: #ff0000;
    box-shadow: 0 0 8px #ff0000;
    animation: blink-red 1.5s infinite;
}

@keyframes blink-red {
    0%, 100% { 
        opacity: 1;
        box-shadow: 0 0 8px #ff0000, 0 0 12px rgba(255, 0, 0, 0.5);
    }
    50% { 
        opacity: 0.2;
        box-shadow: 0 0 0px #ff0000;
    }
}

/* Shake animation when appearing or moving */
@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    20% { transform: translateX(-3px) rotate(-2deg); }
    40% { transform: translateX(3px) rotate(2deg); }
    60% { transform: translateX(-2px) rotate(-1deg); }
    80% { transform: translateX(2px) rotate(1deg); }
}

.satellite-container.shake .satellite-head {
    animation: shake 0.5s ease-in-out;
}

/* Media query to hide on small screens */
@media (max-width: 768px) {
    .satellite-container {
        display: none;
    }
}