:root {
    --shell-yellow: #fbce07;
    --shell-red: #dd1d21;
    --glass-bg: rgba(15, 15, 15, 0.65);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
}

/* Make sure the canvas stays at bottom layer */
.a-canvas {
    z-index: 1 !important;
}

/* UI Layer Container - Must allow pointer-events on children but pass through on itself */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to A-Frame canvas */
    z-index: 10;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Header */
.glass-header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto; /* Re-enable clicks on UI */
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.current-location {
    text-align: center;
}

.current-location h2 {
    color: var(--shell-yellow);
    font-size: 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.current-location p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.area-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: var(--shell-red);
    border-color: var(--shell-red);
    box-shadow: 0 4px 15px rgba(221, 29, 33, 0.4);
}

/* Info Modal */
.glass-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 16px;
    width: 400px;
    max-width: 90%;
    pointer-events: auto;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 16px 64px rgba(0,0,0,0.5);
    z-index: 20;
}

.glass-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

#close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

#close-modal:hover {
    color: var(--shell-red);
}

#modal-title {
    color: var(--shell-yellow);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

#modal-desc {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 1rem;
}

/* Loading Overlay */
.glass-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: auto;
    transition: opacity 1s ease, visibility 1s ease;
}

.glass-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.glass-overlay h2 {
    color: var(--shell-yellow);
    margin-top: 2rem;
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.1);
    border-left-color: var(--shell-red);
    border-top-color: var(--shell-yellow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .glass-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    .area-nav {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        justify-content: flex-start;
    }
}
