/* Clinical Futuristic Design System (Aetheris Anatomy Tokens) */

:root {
    --color-background: #131313;
    --color-void: #000000;
    --color-neural-blue: #007AFF; /* Primary Interactive */
    --color-cyan: #00F0FF;        /* Secondary Accent */
    --color-clinical-white: #FFFFFF;
    --color-text-primary: #E2E2E2;
    --color-text-secondary: #8B90A0;
    --color-border-glass: rgba(255, 255, 255, 0.1);
    --color-glass-bg: rgba(19, 19, 19, 0.7);
    --font-primary: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-sm: 4px;
    --radius-lg: 8px;
    --radius-full: 9999px;
    --transition-quart-out: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

body {
    background-color: var(--color-background);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

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

/* Hidden Camera Feed (for MediaPipe tracking) */
#video-feed {
    position: absolute;
    width: 160px;
    height: 120px;
    bottom: 20px;
    left: 20px;
    border: 1px solid var(--color-border-glass);
    border-radius: var(--radius-lg);
    z-index: 50;
    transform: scaleX(-1); /* Mirror camera */
    opacity: 0.8;
    background-color: #000;
}

/* HUD Overlay Controls */
.hud-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Enable pointer events only for interactive HUD components */
.interactive {
    pointer-events: auto;
}

/* Top Navigation Bar */
header {
    width: 100%;
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(19, 19, 19, 0.8) 0%, rgba(19, 19, 19, 0) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-title {
    font-family: var(--font-primary);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-neural-blue);
    text-shadow: 0 0 10px rgba(0, 122, 255, 0.3);
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--color-text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--color-neural-blue);
}

/* Glassmorphic Panel Base style */
.glass-panel {
    background-color: var(--color-glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border-glass);
    border-radius: var(--radius-lg);
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.02);
}

/* Sidebar Panel */
#sidebar-panel {
    position: absolute;
    top: 90px;
    right: 40px;
    bottom: 40px;
    width: 360px;
    padding: 24px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transform: translateX(420px); /* Initially off-screen */
    opacity: 0;
    transition: var(--transition-quart-out);
    pointer-events: auto;
}

#sidebar-panel.visible {
    transform: translateX(0);
    opacity: 1;
}

.panel-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 16px;
}

.panel-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--color-neural-blue);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.panel-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-clinical-white);
    margin-top: 4px;
}

.panel-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-primary);
}

.facts-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
}

.fact-card {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.fact-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.fact-value {
    font-size: 13px;
    color: var(--color-clinical-white);
}

.close-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--color-neural-blue);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-clinical-white);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    text-transform: uppercase;
}

.close-btn:hover {
    background-color: #005BC1;
}

.close-btn:active {
    transform: scale(0.98);
}

/* Diagnostic Dashboard Overlay */
.diagnostic-container {
    position: absolute;
    top: 90px;
    left: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.diagnostic-card {
    padding: 12px 16px;
    min-width: 180px;
}

.diagnostic-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--color-text-secondary);
    letter-spacing: 0.05em;
}

.diagnostic-value {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 500;
    color: var(--color-clinical-white);
    margin-top: 4px;
}

.diagnostic-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background-color: var(--color-text-secondary);
    margin-right: 6px;
}

.diagnostic-indicator.tracking-active {
    background-color: var(--color-cyan);
    box-shadow: 0 0 8px var(--color-cyan);
}

.diagnostic-indicator.idle-pulsing {
    animation: ready-pulse 1s infinite alternate;
}

/* Custom Reticle Overlay */
#ar-reticle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-text-secondary);
    opacity: 0.4;
    z-index: 30;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.reticle-dot {
    width: 4px;
    height: 4px;
    border-radius: var(--radius-full);
    background-color: var(--color-text-secondary);
    transition: background-color 0.2s ease;
}

/* Reticle States */
#ar-reticle.active {
    width: 40px;
    height: 40px;
    border-color: var(--color-neural-blue);
    opacity: 1.0;
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.4), inset 0 0 10px rgba(0, 122, 255, 0.2);
}

#ar-reticle.active .reticle-dot {
    background-color: var(--color-neural-blue);
}

#ar-reticle.ready-pulse {
    opacity: 0.8;
    border-color: var(--color-cyan);
    animation: ready-pulse 1.5s infinite ease-in-out;
}

#ar-reticle.ready-pulse .reticle-dot {
    background-color: var(--color-cyan);
}

/* Circular selection progress indicator */
.selection-ring {
    position: absolute;
    width: 52px;
    height: 52px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 29;
    display: none;
}

.selection-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.selection-ring circle {
    fill: none;
    stroke: var(--color-neural-blue);
    stroke-width: 3;
    stroke-dasharray: 125.6; /* 2 * PI * r (r=20) = 125.6 */
    stroke-dashoffset: 125.6;
    transition: stroke-dashoffset 0.1s linear;
}

/* Status Notifications banner */
#status-banner {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    z-index: 20;
    text-align: center;
}

/* Animations */
@keyframes ready-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1.0);
        box-shadow: 0 0 5px rgba(0, 240, 255, 0.2);
        opacity: 0.4;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15);
        box-shadow: 0 0 15px rgba(0, 240, 255, 0.5), inset 0 0 5px rgba(0, 240, 255, 0.2);
        opacity: 0.9;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.0);
        box-shadow: 0 0 5px rgba(0, 240, 255, 0.2);
        opacity: 0.4;
    }
}
