/* HUD Styles */
#flight-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
    font-family: 'Rajdhani', sans-serif;
    color: rgba(100, 200, 255, 0.9);
    transition: opacity 0.5s ease;
}

#flight-hud.hidden {
    opacity: 0;
}

.hud-top {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 20px;
}

/* Compass Styles */
#compass-container {
    position: absolute;
    bottom: 100px;
    /* Above the HUD stats */
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 600px;
    height: 60px;
    /* background: rgba(0, 10, 30, 0.3); */
    border-top: 2px solid rgba(100, 200, 255, 0.5);
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, black 20%, black 80%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, black 20%, black 80%, transparent);
}

.compass-line {
    position: absolute;
    top: 0;
    left: 50%;
    height: 10px;
    width: 2px;
    background: #fff;
    transform: translateX(-50%);
    z-index: 5;
}

.compass-markers {
    position: relative;
    width: 100%;
    height: 100%;
}

.compass-marker {
    position: absolute;
    top: 15px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: left 0.1s linear;
}

.marker-icon {
    font-size: 16px;
    margin-bottom: 2px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.marker-label {
    font-size: 10px;
    color: rgba(100, 200, 255, 0.8);
    text-transform: uppercase;
    white-space: nowrap;
}

.compass-readout {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: rgba(100, 200, 255, 0.5);
    display: none;
    /* Optional: show heading degrees */
}

.hud-stat {
    background: rgba(0, 10, 30, 0.5);
    border: 1px solid rgba(100, 200, 255, 0.3);
    padding: 10px 20px;
    border-radius: 4px;
    text-align: center;
    backdrop-filter: blur(4px);
    min-width: 120px;
}

.hud-label {
    display: block;
    font-size: 0.8em;
    letter-spacing: 2px;
    color: rgba(100, 200, 255, 0.6);
    margin-bottom: 5px;
}

.hud-value {
    display: block;
    font-size: 1.5em;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(100, 200, 255, 0.5);
}

.hud-center {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
}

#hud-action {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 15px 30px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

#hud-action.hidden {
    opacity: 0;
    transform: scale(0.9);
}

.key-hint {
    background: #fff;
    color: #000;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 0 10px white;
}

.action-text {
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
}

.hud-bottom {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 50px;
    margin-bottom: 30px;
}

/* Add font import if not exists */

/* HUD Hints */
.hud-hint {
    position: fixed;
    right: 40px;
    bottom: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 5, 15, 0.7);
    backdrop-filter: blur(20px);
    padding: 12px 24px;
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 12px;
    z-index: 100;
    pointer-events: none;
    transition: opacity 0.5s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.hint-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hint-divider {
    width: 1px;
    height: 30px;
    background: rgba(100, 200, 255, 0.2);
}

/* GitHub Button */
#github-button {
    right: 180px !important;
    bottom: 40px !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: flex !important;
    position: fixed !important;
    overflow: visible;
    transition: all 0.3s ease;
    padding: 12px 20px !important;
}

#github-button:hover {
    transform: scale(1.1);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

#github-button .hint-text {
    font-size: 1.5em;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

/* Shooting Star Animation */
#github-button::before {
    content: '⭐';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.8em;
    opacity: 0;
    animation: shootingStar 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shootingStar {
    0% {
        opacity: 0;
        transform: translate(40px, -40px) scale(0.5);
    }
    10% {
        opacity: 1;
    }
    20% {
        opacity: 0.8;
        transform: translate(0, 0) scale(1);
    }
    30% {
        opacity: 0;
        transform: translate(-20px, 20px) scale(0.3);
    }
    100% {
        opacity: 0;
        transform: translate(-20px, 20px) scale(0.3);
    }
}

#mode-hint {
    bottom: 40px;
}

#orbit-controls-hint {
    bottom: 112px;
}

.hint-key {
    background: #fff;
    color: #000;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8em;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.hint-text {
    font-size: 0.75em;
    letter-spacing: 1px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
}

.hint-text b {
    color: #4fd0e7;
    margin-right: 4px;
}

/* Visibility Control */
#mode-hint {
    opacity: 1;
}

@media (max-width: 768px) {
    .hud-hint:not(#github-button) {
        display: none;
    }
    
    #github-button {
        right: 20px !important;
        bottom: 20px !important;
    }
}