/* Game UI Styles - Matching portfolio glassmorphism theme */

/* HUD (Heads-Up Display) */
.game-hud {
    position: fixed;
    top: 80px;
    left: 20px;
    z-index: 10000;
    font-family: 'Space Grotesk', monospace;
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
    animation: fadeIn 0.3s ease;
}

.game-hud .glass-card-dark {
    min-width: 300px;
}

.hud-title {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

/* Speed Display */
.hud-speed {
    text-align: center;
    padding: 0.5rem;
    background: rgba(57, 255, 20, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(57, 255, 20, 0.2);
}

#hud-speed-value {
    font-size: 1.5rem;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

/* Interaction Prompt */
.hud-interact {
    text-align: center;
    padding: 0.75rem;
    background: rgba(0, 243, 255, 0.1);
    border: 2px solid rgba(0, 243, 255, 0.4);
    border-radius: 8px;
    margin: 0.5rem 0;
    animation: pulseGlow 2s ease-in-out infinite;
}

.pulse-animation {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 243, 255, 0.6);
    }
}

.key-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: rgba(57, 255, 20, 0.2);
    border: 1px solid rgba(57, 255, 20, 0.4);
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    margin: 0 0.2rem;
}

.hud-floor,
.hud-project {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.hud-floor span,
.hud-project span {
    color: #fff;
    font-weight: 600;
}

.hud-controls {
    border-top: 1px solid rgba(57, 255, 20, 0.2);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

/* Project Modal */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.project-modal.show {
    opacity: 1;
    pointer-events: all;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100001;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(57, 255, 20, 0.5);
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(57, 255, 20, 0.3), inset 0 0 30px rgba(57, 255, 20, 0.05);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    z-index: 100002;
}

.project-modal.show .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    z-index: 10;
}

.modal-close-btn:hover {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.4);
}

/* Loading Screen */
.game-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a2e 100%);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(57, 255, 20, 0.2);
    border-top-color: var(--neon-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Touch Controls for Mobile */
.touch-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 250px;
    display: none;
    justify-content: space-between;
    align-items: flex-end;
    padding: 20px;
    pointer-events: none;
    z-index: 10000;
}

/* Mobile Exit Button (Top Left) */
.mobile-exit-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 75, 75, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 75, 75, 0.4);
    border-radius: 50%;
    color: #ff4b4b;
    font-size: 1.3rem;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    z-index: 10001;
    box-shadow: 0 0 15px rgba(255, 75, 75, 0.3);
}

.mobile-exit-btn:active,
.mobile-exit-btn.active {
    background: rgba(255, 75, 75, 0.4);
    border-color: #ff4b4b;
    box-shadow: 0 0 30px rgba(255, 75, 75, 0.6);
    transform: scale(0.95);
}

/* Show exit button on mobile */
@media (max-width: 768px) {
    .mobile-exit-btn {
        display: flex;
    }
}

.touch-dpad,
.touch-actions {
    pointer-events: all;
}

.touch-dpad {
    display: grid;
    grid-template-rows: auto auto auto;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 5px;
    width: 160px;
}

.touch-middle-row {
    display: contents;
}

.touch-btn {
    width: 50px;
    height: 50px;
    background: rgba(57, 255, 20, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(57, 255, 20, 0.3);
    border-radius: 8px;
    color: var(--neon-green);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.touch-btn:active,
.touch-btn.active {
    background: rgba(57, 255, 20, 0.3);
    border-color: var(--neon-green);
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.4);
    transform: scale(0.95);
}

.touch-up {
    grid-column: 2;
    grid-row: 1;
}

.touch-down {
    grid-column: 2;
    grid-row: 3;
}

.touch-left {
    grid-column: 1;
    grid-row: 2;
}

.touch-right {
    grid-column: 3;
    grid-row: 2;
}

/* Action Buttons */
.touch-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.touch-vertical-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.touch-ascend,
.touch-descend {
    width: 70px;
    height: 55px;
    font-size: 1.3rem;
    background: rgba(57, 255, 20, 0.2);
}

.touch-ascend:active,
.touch-ascend.active {
    background: rgba(57, 255, 20, 0.35);
    border-color: var(--neon-green);
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.5);
}

.touch-descend:active,
.touch-descend.active {
    background: rgba(57, 255, 20, 0.35);
    border-color: var(--neon-green);
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.5);
}

/* Mobile Interaction Prompt */
.mobile-interact-prompt {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(0, 243, 255, 0.5);
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.4), inset 0 0 30px rgba(0, 243, 255, 0.1);
    animation: slideUp 0.3s ease, pulseGlow 2s ease-in-out infinite;
    min-width: 280px;
    max-width: 90vw;
    pointer-events: all;
    -webkit-tap-highlight-color: transparent;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.mobile-prompt-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.mobile-prompt-icon {
    font-size: 2rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.6);
}

.mobile-prompt-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.mobile-prompt-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.mobile-prompt-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.mobile-interact-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    background: rgba(0, 243, 255, 0.2);
    border: 2px solid rgba(0, 243, 255, 0.4);
    color: var(--neon-cyan);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-interact-btn:active,
.mobile-interact-btn.active {
    background: rgba(0, 243, 255, 0.4);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.6);
    transform: scale(0.95);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .game-hud {
        top: 60px;
        left: 10px;
    }

    .game-hud .glass-card-dark {
        min-width: 200px;
        padding: 0.75rem !important;
        font-size: 0.85rem;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
        max-height: 85vh;
    }

    .modal-close-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .touch-controls {
        display: flex;
    }
}

@media (max-width: 480px) {
    .touch-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    .touch-center {
        width: 35px;
        height: 35px;
    }

    .touch-dpad {
        width: 125px;
    }

    .touch-ascend,
    .touch-descend {
        width: 60px;
        height: 50px;
        font-size: 1.1rem;
    }

    .mobile-interact-prompt {
        min-width: 250px;
        padding: 1.25rem;
    }

    .mobile-prompt-title {
        font-size: 1rem;
    }

    .mobile-prompt-subtitle {
        font-size: 0.8rem;
    }

    .mobile-interact-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(57, 255, 20, 0.3);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(57, 255, 20, 0.5);
}
