/* === Antigravity Preloader (Realistic Space Hamster) === */
#antigravity-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #1a2a4a 0%, #050A15 100%);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

#antigravity-preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* === Stars Background === */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background: transparent;
}

.stars::after {
    content: " ";
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 2px;
    background: transparent;
    box-shadow:
        10vw 10vh #FFF, 20vw 80vh #FFF, 50vw 50vh #FFF, 80vw 20vh #FFF, 90vw 90vh #FFF,
        40vw 30vh #FFF, 15vw 45vh rgba(255, 255, 255, 0.8), 65vw 15vh rgba(255, 255, 255, 0.8),
        85vw 65vh rgba(255, 255, 255, 0.8), 35vw 85vh rgba(255, 255, 255, 0.8),
        5vw 95vh #FFF, 95vw 5vh #FFF, 45vw 75vh #FFF, 75vw 45vh #FFF, 25vw 25vh #FFF,
        12vw 68vh rgba(255, 255, 255, 0.6), 88vw 32vh rgba(255, 255, 255, 0.6), 55vw 12vh rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: twinkle 4s infinite alternate;
}


/* === Hamster Scene === */
.hamster-scene {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(0.6);
    /* Scale down slightly */
}

/* The Wheel */
.wheel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 12px solid #5D7285;
    border-radius: 50%;
    box-sizing: border-box;
    animation: rotateWheel 2s linear infinite;
    z-index: 1;
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(0, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

/* Wheel Spokes/Markers */
.wheel::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90%;
    height: 4px;
    background: #445566;
    transform: translate(-50%, -50%) rotate(0deg);
}

.wheel::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90%;
    height: 4px;
    background: #445566;
    transform: translate(-50%, -50%) rotate(90deg);
}

/* The Hamster Container - Positioned at bottom of wheel */
.hamster {
    position: absolute;
    bottom: 35px;
    /* Sit on the wheel rim */
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 100px;
    z-index: 10;
}

/* Hamster Mechanics */
.hamster-body {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #F8C3A8;
    /* Warm peach */
    border-radius: 50% 60% 40% 40% / 60% 70% 40% 40%;
    transform-origin: bottom center;
    animation: hamsterBodyRun 0.4s ease-in-out infinite alternate;
    box-shadow: inset -10px -10px 20px rgba(0, 0, 0, 0.1);
    /* Shading */
}

/* Belly Patch */
.hamster-body::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 20%;
    width: 60%;
    height: 40%;
    background: #FFE8DC;
    border-radius: 50%;
    opacity: 0.8;
}

.hamster-head {
    position: absolute;
    top: -10px;
    /* Slight overlap */
    right: -20px;
    width: 70px;
    height: 70px;
    background: #F8C3A8;
    border-radius: 45% 55% 50% 50%;
    z-index: 5;
    animation: hamsterHeadBob 0.4s ease-in-out infinite alternate;
}

.hamster-ear {
    position: absolute;
    top: -5px;
    right: 35px;
    width: 20px;
    height: 22px;
    background: #F8C3A8;
    border-radius: 50% 50% 0 0;
    border: 3px solid #E5AA8F;
    border-bottom: none;
}

.hamster-ear.right {
    right: 5px;
}

.hamster-eye {
    position: absolute;
    top: 25px;
    right: 20px;
    width: 10px;
    height: 10px;
    background: #2C3E50;
    border-radius: 50%;
}

.hamster-eye::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
}

.hamster-eye.left {
    right: 45px;
}

/* Nose/Whiskers */
.hamster-head::after {
    content: '';
    /* Nose */
    position: absolute;
    top: 35px;
    right: 25px;
    width: 8px;
    height: 6px;
    background: #FF9B9B;
    border-radius: 50%;
}

.hamster-limb {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #F8C3A8;
    border-radius: 50%;
    z-index: 6;
}

/* Limb Animations */
.hamster-limb.fr {
    right: 10px;
    bottom: -5px;
    animation: runFront 0.4s linear infinite;
}

.hamster-limb.fl {
    right: 30px;
    bottom: -5px;
    animation: runFront 0.4s linear infinite reverse;
    background: #E5AA8F;
    z-index: 4;
}

.hamster-limb.br {
    left: 20px;
    bottom: -5px;
    animation: runBack 0.4s linear infinite;
}

.hamster-limb.bl {
    left: 40px;
    bottom: -5px;
    animation: runBack 0.4s linear infinite reverse;
    background: #E5AA8F;
    z-index: 4;
}

/* Space Helmet w/ Glare */
.space-helmet {
    position: absolute;
    top: -30px;
    right: -35px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.4), rgba(135, 206, 250, 0.1) 60%);
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 0 15px rgba(0, 255, 255, 0.2),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    z-index: 20;
    overflow: hidden;
    animation: helmetBob 0.4s ease-in-out infinite alternate;
}

.space-helmet::before {
    /* Reflection */
    content: '';
    position: absolute;
    top: 15%;
    right: 15%;
    width: 25%;
    height: 15%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    transform: rotate(-45deg);
    filter: blur(2px);
}

/* === Text === */
.text {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 4px;
    color: #FFFFFF;
    text-shadow: 0 0 20px #00BFFF;
    margin-top: 0px;
    z-index: 3;
}

.subtext {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #88CCFF;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* === Aero-Cyber Futuristic Theme Additions === */

:root {
    --neon-cyan: #00f3ff;
    --neon-purple: #bc13fe;
    --neon-blue: #0066ff;
    --deep-space: #050a15;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
}

/* Utility Animations */
@keyframes neon-pulse {
    0% {
        box-shadow: 0 0 5px var(--neon-cyan), 0 0 10px var(--neon-cyan);
    }

    50% {
        box-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan), 0 0 30px var(--neon-cyan);
    }

    100% {
        box-shadow: 0 0 5px var(--neon-cyan), 0 0 10px var(--neon-cyan);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.futuristic-body {
    background-color: var(--deep-space);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(188, 19, 254, 0.05) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 243, 255, 0.05) 0%, transparent 25%);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

.neon-text-cyan {
    color: #fff;
    text-shadow:
        0 0 5px var(--neon-cyan),
        0 0 10px var(--neon-cyan),
        0 0 20px var(--neon-cyan);
}

.neon-text-purple {
    color: #fff;
    text-shadow:
        0 0 5px var(--neon-purple),
        0 0 10px var(--neon-purple),
        0 0 20px var(--neon-purple);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 243, 255, 0.1);
    border-color: rgba(0, 243, 255, 0.3);
}

.btn-cyber {
    position: relative;
    padding: 12px 30px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--neon-cyan);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-cyber::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.4), transparent);
    transition: 0.5s;
}

.btn-cyber:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 20px var(--neon-cyan);
}

.btn-cyber:hover::before {
    left: 100%;
}

/* === Animations === */
@keyframes twinkle {
    0% {
        opacity: 0.3;
    }

    100% {
        opacity: 1;
    }
}

@keyframes rotateWheel {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes hamsterBodyRun {
    from {
        transform: scaleY(1) translateY(0);
    }

    to {
        transform: scaleY(0.95) translateY(2px);
    }
}

@keyframes hamsterHeadBob {
    from {
        transform: translateY(0) rotate(0deg);
    }

    to {
        transform: translateY(3px) rotate(2deg);
    }
}

@keyframes helmetBob {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(3px);
    }
}

@keyframes runFront {
    0% {
        transform: translate(10px, -5px);
    }

    25% {
        transform: translate(5px, 0px);
    }

    50% {
        transform: translate(-15px, 5px);
    }

    75% {
        transform: translate(-5px, -5px);
    }

    100% {
        transform: translate(10px, -5px);
    }
}

@keyframes runBack {
    0% {
        transform: translate(-15px, 5px);
    }

    50% {
        transform: translate(10px, -5px);
    }

    100% {
        transform: translate(-15px, 5px);
    }
}

@keyframes pulseText {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(0.98);
    }
}

/* === Flight Journal Table (Cyber Aesthetic) === */
.flight-list-container {
    background: rgba(5, 10, 21, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.flight-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    /* Spacing between rows */
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
}

.flight-table thead tr {
    background: transparent;
}

.flight-table th {
    text-align: left;
    padding: 12px 15px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--neon-cyan);
    border-bottom: 2px solid rgba(0, 243, 255, 0.2);
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.3);
}

.flight-table tbody tr {
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.flight-table tbody tr:hover {
    background: rgba(0, 243, 255, 0.08);
    /* slight cyan tint */
    transform: translateX(4px);
    box-shadow: -2px 0 10px rgba(0, 243, 255, 0.1);
}

.flight-table td {
    padding: 12px 15px;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
}

.flight-table td:first-child {
    border-radius: 6px 0 0 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.flight-table td:last-child {
    border-radius: 0 6px 6px 0;
}

/* Data Column Highlighting */
.flight-data-heavy {
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
}

/* Action Buttons */
.btn-action-icon {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin: 0 2px;
}

.btn-action-icon:hover {
    color: #fff;
    border-color: #fff;
    transform: scale(1.1);
}

.btn-action-view:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 8px var(--neon-cyan);
}

.btn-action-delete:hover {
    border-color: #ef4444;
    color: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

/* === Cyber Confirmation Modal === */
.cyber-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 5, 10, 0.85);
    /* Deep dark overlay */
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cyber-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cyber-modal-content {
    background: rgba(10, 20, 30, 0.9);
    border: 1px solid var(--neon-cyan);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.2), inset 0 0 20px rgba(0, 243, 255, 0.1);
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cyber-modal-overlay.active .cyber-modal-content {
    transform: scale(1);
}

.cyber-modal-title {
    font-family: 'Montserrat', sans-serif;
    color: var(--neon-cyan);
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cyber-modal-text {
    color: #ddd;
    font-size: 0.95rem;
    margin-bottom: 25px;
    line-height: 1.5;
}

.cyber-modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.cyber-btn {
    padding: 10px 20px;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.cyber-btn-cancel {
    background: transparent;
    border-color: #666;
    color: #aaa;
}

.cyber-btn-cancel:hover {
    border-color: #fff;
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.cyber-btn-confirm {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

/* === 3D Flight Player UI (Ayvri Style) === */

.telemetry-hud {
    position: absolute;
    top: 80px;
    /* Below navbar/logo area */
    left: 20px;
    background: rgba(5, 10, 20, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 50;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    min-width: 140px;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.hud-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hud-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: #88ccff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.hud-value {
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--neon-cyan);
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.4);
}

.hud-unit {
    font-size: 0.8rem;
    color: #aaa;
    margin-left: 2px;
}

/* Playback Bar */
.playback-bar {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    max-width: 90%;
    background: rgba(5, 10, 20, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--neon-cyan);
    border-radius: 30px;
    /* Pill shape */
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 50;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.15);
}

.playback-btn {
    background: transparent;
    border: none;
    color: var(--neon-cyan);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.playback-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.playback-btn.small {
    font-size: 1rem;
    width: 30px;
    height: 30px;
}

.slider-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-display {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #fff;
    min-width: 60px;
    text-align: center;
}

.time-slider {
    flex-grow: 1;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
}

.time-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--neon-cyan);
    margin-top: -6px;
    box-shadow: 0 0 10px var(--neon-cyan);
    transition: transform 0.1s;
}

.time-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #aaa;
}

#speedDisplay {
    color: #fff;
    font-weight: bold;
    min-width: 25px;
    text-align: center;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .telemetry-hud {
        top: 60px;
        left: 10px;
        padding: 10px;
        min-width: 100px;
    }

    .hud-label {
        font-size: 0.6rem;
    }

    .hud-value {
        font-size: 1.1rem;
    }

    .playback-bar {
        width: 95%;
        bottom: 20px;
        padding: 8px 15px;
        border-radius: 20px;
    }

    .playback-btn {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    .time-display {
        display: none;
        /* Hide time on very small screens to save space */
    }
}

/* === 3D Toggle & Play Button Positioning === */
#view3dBtn {
    position: absolute;
    top: 3px;
    /* Below Mapbox controls */
    right: 0px;
    width: 38px;
    height: 39px;
    background: rgba(255, 255, 255, 1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    /* Square with slight radius to match Mapbox */
    color: #333;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    z-index: 50;
    /* Above map */
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#view3dBtn:hover {
    background: #f0f0f0;
}

#view3dBtn.active {
    background: var(--neon-cyan);
    color: black;
    box-shadow: 0 0 10px var(--neon-cyan);
    border-color: var(--neon-cyan);
}

/* Mobile check */
@media (max-width: 768px) {
    #view3dBtn {
        top: 8px;
        right: 0px;
    }
}