:root {
    --bg-color: #050510;
    --primary-color: #00f3ff;
    --secondary-color: #7000ff;
    --text-color: #e0e0ff;
    --glass-bg: rgba(10, 10, 30, 0.6);
    --glass-border: rgba(0, 243, 255, 0.3);
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow: hidden; /* Prevent scrollbars from 3D canvas */
    height: 100vh;
    width: 100vw;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through to canvas where needed */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
    background: radial-gradient(circle at center, transparent 0%, rgba(5, 5, 16, 0.8) 120%);
}

/* Enable pointer events on interactive UI elements */
header, .hero-content, .hud-elements {
    pointer-events: auto;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    /* decorative corner */
    clip-path: polygon(0 0, 100% 0, 100% 70%, 95% 100%, 0 100%);
}

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.highlight {
    color: var(--primary-color);
}

nav {
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 1px;
    opacity: 0.7;
    transition: all 0.3s ease;
    position: relative;
}

nav a.active, nav a:hover {
    opacity: 1;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

nav a:hover::after, nav a.active::after {
    width: 100%;
}

.login-btn {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 15px var(--primary-color);
}

/* Hero Content */
.hero-content {
    align-self: flex-start;
    margin-top: 10vh;
    margin-left: 5vw;
    max-width: 500px;
}

.sub-header {
    font-family: var(--font-heading);
    color: var(--secondary-color);
    font-size: 1rem;
    letter-spacing: 4px;
    margin-bottom: 1rem;
}

h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.glitch-text {
    position: relative;
    color: var(--primary-color);
}

/* Simple glitch effect using text-shadow */
@keyframes glitch {
    0% { text-shadow: 2px 2px 0px #ff00ff, -2px -2px 0px #00ffff; }
    25% { text-shadow: -2px 2px 0px #ff00ff, 2px -2px 0px #00ffff; }
    50% { text-shadow: 2px -2px 0px #ff00ff, -2px 2px 0px #00ffff; }
    75% { text-shadow: -2px -2px 0px #ff00ff, 2px 2px 0px #00ffff; }
    100% { text-shadow: 2px 2px 0px #ff00ff, -2px -2px 0px #00ffff; }
}
.glitch-text:hover {
    animation: glitch 0.3s infinite;
}

.hero-desc {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.8;
    border-left: 3px solid var(--primary-color);
    padding-left: 1rem;
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.1) 0%, transparent 100%);
}

.cta-group {
    display: flex;
    gap: 1rem;
}

button {
    font-family: var(--font-heading);
    padding: 1rem 2rem;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    transition: all 0.3s ease;
}

.primary-btn {
    background: var(--primary-color);
    color: #000;
    font-weight: 700;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px var(--primary-color);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* HUD Elements */
.hud-elements {
    position: absolute; /* To sit on top of everything */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hud-corner {
    position: absolute;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
}

/* .top-left moved below to coordinate with bottom panel */

.bottom-right {
    bottom: 2rem;
    right: 2rem;
    border-right: 3px solid var(--primary-color);
    text-align: right;
}

.hud-label {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.hud-value {
    font-family: var(--font-heading);
    font-size: 0.6rem; /* Smaller than label (0.7rem) */
}

.hud-bar {
    width: 150px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0.5rem 0;
    margin-left: auto;
}

.hud-bar .fill {
    height: 100%;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.blinking {
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* PC (Default) Panel Styles - ORIGINAL but Compact Spacing */
.left-panel {
    position: absolute;
    top: 250px; /* Below the coordinates panel */
    left: 2rem;
    bottom: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem; /* Reduced from 1rem */
    pointer-events: auto;
}

.panel-item {
    display: flex;
    justify-content: space-between;
    width: 200px;
    padding: 0.25rem; /* Reduced from 0.5rem */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.05) 0%, transparent 100%);
    font-family: var(--font-heading);
    transition: all 0.3s;
}

/* Original Coordinates Position */
.top-left {
    top: 150px;
    left: 2rem;
    border-left: 3px solid var(--primary-color);
    padding: 1rem; /* Restore padding if needed, assumed default */
}

.panel-item span:first-child {
    font-size: 0.8rem;
    color: var(--primary-color);
}

.panel-item span:last-child {
    font-size: 0.6rem;
    opacity: 0.9;
}

.panel-item:hover {
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.2) 0%, transparent 100%);
    border-left: 2px solid var(--primary-color);
    padding-left: 1rem;
}

/* Mobile / Responsive Styles */
@media (max-width: 768px) {
    #ui-layer {
        justify-content: flex-start; /* Keep content at top */
    }

    /* Header adjustments */
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        clip-path: none;
        border-radius: 0;
        border-bottom: 1px solid var(--glass-border);
    }
    
    header .logo {
        font-size: 1.2rem;
    }

    nav {
        gap: 1rem;
        font-size: 0.8rem;
    }
    
    nav a {
        font-size: 0.8rem;
    }

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

    /* Hero adjustments */
    .hero-content {
        margin-top: 20px; /* Reduced since header takes space, flex-start stacks them */
        margin-left: 1rem;
        width: 90%;
    }
    
    h1 {
        font-size: 2rem;
    }

    .hero-desc {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    /* HUD adjustments */
    
    .top-left {
        top: auto;
        bottom: 5rem; /* Shift down corresponding to panel shift */
        left: 1rem;
        border-left: 2px solid var(--primary-color);
        padding: 0.25rem;
    }

    .left-panel {
        top: auto;
        bottom: 1rem; /* Lowered from 2rem */
        left: 1rem;
        gap: 0.2rem; /* Tighter gap */
    }

    .panel-item {
        width: 130px;
        padding: 0.15rem; /* Compact padding */
    }
    
    .panel-item span:first-child {
        font-size: 0.6rem;
    }

    .panel-item span:last-child {
        font-size: 0.45rem;
    }

    .bottom-right {
        bottom: 1rem; /* Lowered from 2rem */
        right: 1rem;
        padding: 0.5rem;
        transform: scale(0.8);
        transform-origin: bottom right;
    }
    
    .hud-bar {
        width: 80px;
    }

    /* Coordinate adjustment specifically */
    .hud-corner.top-left {
        top: auto;
        bottom: 5rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    nav {
        display: none; /* Hide nav links on very small screens */
    }
    
    .hero-content {
        margin-top: 100px;
        text-align: center;
        margin-left: 0;
        padding: 0 1rem;
    }
    
    .hero-desc {
        text-align: left;
    }
    
    .bottom-right {
        /* Simplify or hide if too cluttered? Keep for now */
        transform: scale(0.8);
        transform-origin: bottom right;
    }
}
