/* 
=========================================================
JARVIS CINEMATIC CONTROL CENTER PROTOCOL 
=========================================================
Overview: Deep Depth, Holographic UI, Intelligence Visualization
*/

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Inter:wght@300;400;600&family=Fira+Code:wght@400;600&display=swap');

:root {
    /* Color System */
    --primary: #00E5FF;
    --primary-dim: rgba(0, 229, 255, 0.15);
    --primary-glow: rgba(0, 229, 255, 0.5);
    
    --secondary: #4FACFE;
    --accent: #8b5cf6;
    --accent-dim: rgba(139, 92, 246, 0.2);
    
    --alert: #FF3366;
    --success: #00FF66;
    --warning: #FFBB00;
    
    /* Dark Theme Base (Deep Navy / Black) */
    --bg-dark: #02040A;
    --bg-deep: #05080F;
    --bg-glass: rgba(5, 8, 15, 0.6);
    --bg-panel: rgba(10, 15, 25, 0.45);
    
    /* Borders & Lighting */
    --border-color: rgba(0, 229, 255, 0.15);
    --border-glow: rgba(0, 229, 255, 0.3);
    
    /* Typography */
    --text-main: #E2E8F0;
    --text-dim: #8BA1B8;
    --text-bright: #FFFFFF;
    
    --font-mono: 'Fira Code', monospace;
    --font-display: 'Orbitron', sans-serif;
    --font-ui: 'Inter', system-ui, sans-serif;
    
    --font-size-base: 15px;
    --radius-sm: 4px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --glass-blur: 16px;
}

/* Base & Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--bg-dark); }
body {
    font-family: var(--font-ui);
    font-size: var(--font-size-base);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ======================================================== */
/* IMMERSION FIX: BACKGROUND LAYER */
/* ======================================================== */
#bg-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.ambient-fog {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(0, 229, 255, 0.08) 0%, rgba(139, 92, 246, 0.03) 40%, transparent 80%);
}

.grid-overlay {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(0, 229, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridFloat 30s linear infinite;
    transform: perspective(1000px) rotateX(60deg) scale(3) translateY(-10%);
    transform-origin: top center;
    opacity: 0.7;
}

.data-lines {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px);
    background-size: 100% 4px;
    animation: scanlinesDown 10s linear infinite;
}

.vignette {
    position: absolute; inset: 0;
    background: radial-gradient(circle at center, transparent 30%, var(--bg-dark) 100%);
}

.grain-overlay {
    position: absolute; inset: 0; mix-blend-mode: overlay; opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

@keyframes gridFloat { 0% { background-position: 0 0; } 100% { background-position: 0 1000px; } }
@keyframes scanlinesDown { 0% { background-position: 0 0; } 100% { background-position: 0 100%; } }

/* ======================================================== */
/* GLOBAL LAYOUT ARCHITECTURE */
/* ======================================================== */
#app-container {
    display: flex; flex-direction: column;
    height: 100vh; width: 100vw;
    padding-top: 80px; /* Space for the fixed header */
    position: relative; z-index: 10;
}

.content-wrapper {
    display: flex; flex: 1;
    gap: 20px; padding: 20px;
    height: calc(100vh - 80px);
    overflow: hidden; /* Main and Sidebar scroll independently */
}

/* MAIN CONTENT AREA (Center - Z:100) */
.hud-main {
    flex: 1; display: flex; flex-direction: column; 
    gap: 20px; position: relative; z-index: 100;
    overflow-y: auto; scrollbar-width: none;
    padding-bottom: 20px;
}
.hud-main::-webkit-scrollbar { display: none; }

/* Dynamic Views System */
.page-view {
    display: flex; flex-direction: column; gap: 20px;
    opacity: 0; pointer-events: none; height: 0; overflow: hidden;
    transition: opacity 0.4s ease;
}
.page-view.active {
    opacity: 1; pointer-events: auto; height: auto; overflow: visible;
}

/* SIDE PANELS (Right - Z:900) */
.hud-sidebar {
    width: 360px; flex-shrink: 0;
    z-index: 900; overflow-y: auto; scrollbar-width: none;
    display: flex; flex-direction: column; gap: 20px;
    padding-bottom: 20px;
}
.hud-sidebar::-webkit-scrollbar { display: none; }

/* ======================================================== */
/* TOP COMMAND BAR (Header - Z:1000) */
/* ======================================================== */
.hud-top-bar {
    position: fixed; top: 0; left: 0; width: 100%; height: 80px;
    z-index: 1000;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 30px;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.8), inset 0 0 15px rgba(0, 229, 255, 0.05);
    backdrop-filter: blur(var(--glass-blur));
}
/* Sub-bar glow line */
.hud-top-bar::after {
    content: ''; position: absolute; bottom: 0; left: 10%; width: 80%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

.brand { display: flex; align-items: center; gap: 12px; }
.logo-icon { color: var(--primary); font-size: 1.8rem; filter: drop-shadow(0 0 12px var(--primary-glow)); }
.logo-text { font-family: var(--font-display); font-weight: 900; font-size: 1.4rem; letter-spacing: 0.3em; color: var(--text-bright); text-shadow: 0 0 15px var(--primary-glow); }
.version { font-family: var(--font-mono); font-size: 0.7rem; color: var(--primary); letter-spacing: 0.1em; padding: 2px 6px; border: 1px solid var(--primary-dim); border-radius: 4px; }

.top-command-area {
    flex: 1; max-width: 650px; margin: 0 40px;
    display: flex; align-items: center; gap: 12px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 30px;
    padding: 8px 20px; 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: inset 0 2px 15px rgba(0,0,0,0.7);
}
.top-command-area:focus-within {
    border-color: var(--primary); 
    box-shadow: inset 0 2px 15px rgba(0,0,0,0.8), 0 0 20px var(--primary-dim);
    transform: translateY(-1px);
}
.prompt-char { color: var(--primary); font-family: var(--font-mono); font-weight: 700; font-size: 1.3rem; text-shadow: 0 0 10px var(--primary-glow); }
.input-container { flex: 1; position: relative; }
#cmd-input {
    width: 100%; background: transparent; border: none;
    color: var(--text-bright); font-family: var(--font-ui); font-size: 1.05rem;
    padding: 8px 0; outline: none; letter-spacing: 0.05em;
}
#cmd-input::placeholder { color: rgba(255,255,255,0.2); font-style: italic; }

.icon-btn {
    background: transparent; border: 1px solid transparent; color: var(--text-dim);
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.icon-btn:hover { background: var(--primary-dim); color: var(--primary); border-color: var(--primary-glow); box-shadow: 0 0 15px var(--primary-dim); transform: scale(1.1); }
.icon-btn:active { transform: scale(0.9); }
.mic-btn.active { 
    color: var(--text-bright); border-color: var(--alert); background: rgba(255,51,102,0.2);
    box-shadow: 0 0 25px rgba(255,51,102,0.5); animation: pulseAlert 1.5s infinite; 
}

.system-status { display: flex; align-items: center; gap: 20px; }
.header-btn {
    background: transparent; border: 1px solid var(--border-color); color: var(--primary);
    padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; font-size: 1.2rem;
    transition: all 0.3s;
}
.header-btn:hover { background: var(--primary-dim); border-color: var(--primary); box-shadow: 0 0 20px var(--primary-dim); transform: translateY(-2px); }
.clock { font-family: var(--font-mono); font-size: 1.1rem; color: var(--text-bright); letter-spacing: 0.1em; }

/* Status Indicator (Online/Offline Pill) */
.status-indicator {
    font-family: var(--font-display); font-size: 0.65rem; font-weight: 700;
    letter-spacing: 0.2em; color: var(--text-dim); padding: 4px 10px;
    border: 1px solid rgba(255,255,255,0.1); border-radius: 20px;
    background: rgba(0,0,0,0.4); transition: all 0.5s ease;
}
.status-indicator.online {
    color: var(--success); border-color: rgba(0,255,102,0.3);
    background: rgba(0,255,102,0.05); box-shadow: 0 0 10px rgba(0,255,102,0.2);
    animation: pulseOnline 2s infinite;
}
@keyframes pulseOnline { 50% { box-shadow: 0 0 20px rgba(0,255,102,0.4); } }

/* Command Suggestions Dropdown */
#suggestions {
    position: absolute; top: 100%; left: 0; right: 0; margin-top: 8px;
    background: rgba(5, 8, 15, 0.98); border: 1px solid var(--primary-dim);
    border-radius: var(--radius-md); overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.9), 0 0 15px var(--primary-dim);
    backdrop-filter: blur(12px); z-index: 999;
}
#suggestions.hidden { display: none; }
.suggestion-item {
    padding: 10px 20px; font-family: var(--font-mono); font-size: 0.9rem; color: var(--text-dim);
    cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: all 0.15s; display: flex; align-items: center; gap: 12px;
}
.suggestion-item:hover, .suggestion-item.active {
    background: var(--primary-dim); color: var(--primary); padding-left: 28px;
}
.suggestion-item:last-child { border-bottom: none; }

/* ======================================================== */
/* CENTRAL AI CORE */
/* ======================================================== */
.ai-core-frame {
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    width: 100%; min-height: 550px;
    padding: 30px; position: relative;
}
.core-header {
    display: flex; justify-content: space-between; width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 15px;
    position: relative;
}
.core-header::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 50px; height: 1px; background: var(--primary); }

.core-title { font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 0.4em; color: var(--text-dim); }
.ai-state-indicator {
    font-family: var(--font-display); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.25em;
    color: var(--primary); text-shadow: 0 0 10px var(--primary-glow);
    padding: 6px 16px; border: 1px solid var(--primary-dim); border-radius: 4px;
    background: rgba(0,229,255,0.05); text-transform: uppercase;
    box-shadow: 0 0 15px rgba(0,229,255,0.1);
}
.ai-state-indicator.listening { color: var(--alert); border-color: rgba(255,51,102,0.4); background: rgba(255,51,102,0.1); text-shadow: 0 0 15px var(--alert); }
.ai-state-indicator.typing { color: var(--success); border-color: rgba(0,255,102,0.4); background: rgba(0,255,102,0.1); text-shadow: 0 0 15px var(--success); }

/* The Neural Core Canvas */
.visualizer-container { position: relative; width: 450px; height: 450px; display: flex; align-items: center; justify-content: center; margin: auto; }
#audio-visualizer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: screen; }

.core-footer { margin-top: auto; }
.status-text {
    font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.5em;
    color: rgba(255,255,255,0.4); text-align: center;
}

/* ======================================================== */
/* MODULAR CONTROL STACK */
/* ======================================================== */
.control-stack {
    display: flex; flex-direction: column; gap: 20px;
    overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
    perspective: 1200px;
}
.widget {
    background: var(--bg-panel);
    border-radius: var(--radius-md); padding: 24px;
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: 0 15px 40px rgba(0,0,0,0.6), inset 0 0 20px rgba(0,229,255,0.02);
    position: relative; overflow: hidden;
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
/* Holographic Hover effect */
.widget:hover {
    transform: translateY(-4px) scale(1.02) rotateX(2deg) rotateY(-2deg);
    border-color: rgba(0,229,255,0.3);
    background: rgba(15, 20, 35, 0.6);
    box-shadow: -10px 20px 40px rgba(0,0,0,0.8), inset 0 0 30px rgba(0,229,255,0.08), 0 0 15px rgba(0,229,255,0.15);
}
.widget::before {
    content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%;
    background: var(--primary); opacity: 0.6; box-shadow: 2px 0 15px var(--primary-glow);
}
.widget-title {
    font-family: var(--font-display); font-size: 0.65rem; letter-spacing: 0.2em;
    color: var(--text-dim); margin-bottom: 20px; text-transform: uppercase;
    display: flex; justify-content: space-between; align-items: center;
}

/* User Identity */
.profile-widget-content { display: flex; align-items: center; gap: 18px; }
.profile-avatar { position: relative; }
.avatar-glow {
    position: absolute; inset: -5px; border-radius: 50%;
    border: 1px dashed var(--primary); animation: arcSpin 15s linear infinite;
    box-shadow: inset 0 0 15px var(--primary-glow);
}
.avatar-icon { font-size: 2.4rem; color: var(--text-bright); position: relative; z-index: 1; filter: drop-shadow(0 2px 8px rgba(0,229,255,0.4)); }
.profile-info-mini { flex: 1; }
#widget-name { font-family: var(--font-display); font-size: 1rem; font-weight: 700; letter-spacing: 0.15em; color: var(--text-bright); text-shadow: 0 0 10px rgba(255,255,255,0.2); }
#widget-role { font-family: var(--font-mono); font-size: 0.75rem; color: var(--secondary); letter-spacing: 0.1em; margin-bottom: 10px; }
.trust-label { font-size: 0.65rem; color: var(--text-dim); letter-spacing: 0.1em; display: flex; justify-content: space-between; font-family: var(--font-mono); }
#widget-trust { color: var(--primary); font-weight: bold; }
.trust-bar { height: 4px; background: rgba(0,0,0,0.6); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.trust-fill { height: 100%; background: var(--primary); border-radius: 2px; box-shadow: 0 0 10px var(--primary); transition: width 1s ease-out; }

/* Env Data */
.weather-content { display: flex; align-items: center; gap: 20px; }
#weather-temp { font-family: var(--font-display); font-size: 3.2rem; font-weight: 300; color: var(--text-bright); text-shadow: 0 0 25px rgba(0,229,255,0.3); line-height: 1; }
.weather-meta { display: flex; flex-direction: column; gap: 6px; }
#weather-desc { font-family: var(--font-mono); font-size: 0.85rem; color: var(--secondary); letter-spacing: 0.1em; text-transform: uppercase; }
.weather-loc { font-size: 0.7rem; color: var(--text-dim); letter-spacing: 0.05em; font-family: var(--font-ui); }

/* Sys Load */
.bar-container { height: 6px; background: rgba(0,0,0,0.6); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--primary)); border-radius: 3px; transition: width 0.5s; box-shadow: 0 0 12px var(--primary-glow); }

/* ======================================================== */
/* IMMERSIVE TERMINAL */
/* ======================================================== */
.hud-footer {
    height: 260px; min-height: 120px; flex-shrink: 0;
    background: var(--bg-glass);
    border: 1px solid var(--border-color); border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0,0,0,0.7), inset 0 0 20px rgba(0,229,255,0.03);
    backdrop-filter: blur(var(--glass-blur));
    display: flex; flex-direction: column; position: relative; 
    transition: height 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}
.hud-footer.terminal-minimized { height: 46px !important; }
.hud-footer.terminal-maximized { height: 85vh !important; }
.hud-footer.resizing { transition: none; }

/* Terminal Scanlines Overlay */
.hud-footer::before {
    content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
    background: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 100% 3px;
}

#resize-handle {
    position: absolute; top: -5px; left: 0; right: 0; height: 12px;
    cursor: ns-resize; z-index: 20;
}
#resize-handle::after {
    content: ''; display: block; width: 80px; height: 4px;
    background: rgba(255,255,255,0.1); border-radius: 2px;
    margin: 4px auto 0; transition: background 0.2s;
}
#resize-handle:hover::after { background: var(--primary-dim); box-shadow: 0 0 10px var(--primary); }

.terminal-wrapper { display: flex; flex-direction: column; height: 100%; width: 100%; position: relative; z-index: 10; }
.terminal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 28px; font-family: var(--font-display); font-size: 0.75rem;
    color: var(--text-dim); letter-spacing: 0.2em;
    background: rgba(0,0,0,0.3); border-bottom: 1px solid rgba(255,255,255,0.05);
}
.window-controls { display: flex; gap: 10px; }
.win-btn {
    background: transparent; border: 1px solid rgba(255,255,255,0.1); color: var(--text-dim);
    width: 26px; height: 26px; font-size: 0.85rem; cursor: pointer; border-radius: 4px;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.win-btn:hover { background: rgba(0,229,255,0.1); color: var(--primary); border-color: var(--primary); }

/* Log Area */
.terminal-log {
    flex: 1; overflow-y: auto; padding: 20px 28px;
    font-size: 0.95rem; line-height: 1.8;
    scrollbar-width: thin; scrollbar-color: var(--primary-dim) transparent;
}
.terminal-log::-webkit-scrollbar { width: 6px; }
.terminal-log::-webkit-scrollbar-thumb { background: rgba(0,229,255,0.2); border-radius: 3px; }

.log-line { 
    padding: 6px 0; word-wrap: break-word; display: flex; gap: 12px; align-items: flex-start; 
    animation: fadeLineIn 0.3s ease-out forwards; opacity: 0; transform: translateY(5px);
}
@keyframes fadeLineIn { to { opacity: 1; transform: translateY(0); } }

.log-time { color: rgba(255,255,255,0.3); font-size: 0.85em; font-family: var(--font-mono); white-space: nowrap; margin-top: 3px; }
.log-type { padding: 2px 8px; border-radius: 3px; font-size: 0.75em; font-weight: 700; letter-spacing: 0.1em; font-family: var(--font-display); }
.log-type.sys-type { background: rgba(0, 229, 255, 0.1); color: var(--primary); border: 1px solid var(--primary-dim); }
.log-type.usr-type { background: rgba(139, 92, 246, 0.15); color: var(--accent); border: 1px solid var(--accent-dim); }
.log-type.err-type { background: rgba(255, 51, 102, 0.15); color: var(--alert); border: 1px solid rgba(255,51,102,0.3); }
.log-type.meta-type { background: rgba(255, 255, 255, 0.05); color: var(--text-dim); border: 1px solid rgba(255,255,255,0.1); }

.system-msg { color: var(--text-bright); text-shadow: 0 0 5px rgba(255,255,255,0.2); white-space: pre-wrap; font-family: var(--font-mono); width: 100%; overflow-x: auto; line-height: 1.5; }
.log-line.success-log .system-msg { color: var(--success); text-shadow: 0 0 10px rgba(0,255,102,0.4); }
.log-line.warn-log .system-msg { color: var(--warning); text-shadow: 0 0 10px rgba(255,187,0,0.4); }
.log-line.error-log .system-msg { color: var(--alert); text-shadow: 0 0 10px rgba(255,51,102,0.4); }

.user-msg { color: var(--secondary); font-style: normal; font-weight: 600; letter-spacing: 0.05em; }
.terminal-cursor { display: inline-block; width: 8px; height: 16px; background: var(--primary); margin-left: 6px; animation: blink 1s step-end infinite; vertical-align: middle; box-shadow: 0 0 10px var(--primary); }

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

/* ======================================================== */
/* FLOATING NOTIFICATIONS */
/* ======================================================== */
#notification-container {
    position: fixed; top: 30px; right: 30px; z-index: 10000;
    display: flex; flex-direction: column; gap: 15px; width: 340px;
    pointer-events: none;
}
.notification {
    background: rgba(5,8,15,0.85); border: 1px solid rgba(0,229,255,0.2);
    border-left: 5px solid var(--primary); border-radius: var(--radius-sm);
    padding: 18px 22px; backdrop-filter: blur(15px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.8), inset 0 0 15px rgba(0,229,255,0.05);
    animation: slideInRight 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto; cursor: pointer;
    transition: transform 0.2s;
}
.notification:hover { transform: translateX(-5px); border-color: var(--primary); box-shadow: 0 20px 45px rgba(0,0,0,0.9), 0 0 20px var(--primary-dim); }
.notification.fade-out { animation: fadeOutRight 0.4s ease forwards; }
.notif-title { font-family: var(--font-display); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.15em; color: var(--primary); margin-bottom: 6px; text-transform: uppercase; text-shadow: 0 0 8px var(--primary-glow); }
.notif-msg { font-size: 0.9rem; color: var(--text-bright); line-height: 1.5; font-family: var(--font-ui); }
@keyframes slideInRight { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOutRight { to { transform: translateX(120%); opacity: 0; margin-top: -90px; } }

/* ======================================================== */
/* GLOBALS & ANIMATIONS */
/* ======================================================== */
@keyframes arcSpin { to { transform: rotate(360deg); } }
@keyframes pulseAlert { 0% { box-shadow: 0 0 0 0 rgba(255,51,102,0.6); } 70% { box-shadow: 0 0 0 20px rgba(255,51,102,0); } 100% { box-shadow: 0 0 0 0 rgba(255,51,102,0); } }

::selection { background: var(--primary); color: #000; }
.shake { animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }

/* ======================================================== */
/* BIOMETRIC VAULT & OVERLAYS */
/* ======================================================== */
.overlay {
    position: fixed; inset: 0; z-index: 2000; /* As requested */
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(8px);
    opacity: 1; transition: opacity 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.overlay.hidden { opacity: 0; pointer-events: none; }
.overlay.hidden .auth-card { transform: scale(0.95) translateY(20px); opacity: 0; }

.auth-card {
    width: 480px; max-width: 90vw; padding: 60px 50px;
    background: linear-gradient(145deg, rgba(15, 20, 35, 0.7), rgba(5, 8, 15, 0.95));
    border: 1px solid rgba(0, 229, 255, 0.15); border-top: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 40px 100px rgba(0,0,0,1), inset 0 2px 30px rgba(0,229,255,0.05);
    text-align: center;
    transform: translateY(0) scale(1); transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative; overflow: hidden;
}
.auth-card::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at center, rgba(0,229,255,0.05) 0%, transparent 60%);
    pointer-events: none; animation: pulseLogo 4s infinite;
}
.auth-header .auth-logo { font-size: 3.8rem; color: var(--primary); filter: drop-shadow(0 0 25px var(--primary-glow)); margin-bottom: 20px; }
.auth-header h1 { font-family: var(--font-display); font-size: 2rem; font-weight: 900; letter-spacing: 0.3em; color: var(--text-bright); margin-bottom: 8px; text-shadow: 0 0 20px rgba(0,229,255,0.3); }
.auth-header p { font-family: var(--font-mono); font-size: 0.85rem; color: var(--primary); letter-spacing: 0.25em; text-transform: uppercase; }

.auth-visual { position: relative; width: 160px; height: 160px; margin: 45px auto; }
.auth-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; }
.auth-ring:nth-child(1) { border-top-color: var(--primary); border-bottom-color: var(--primary); animation: arcSpin 8s linear infinite; filter: drop-shadow(0 0 15px var(--primary-glow)); }
.auth-ring:nth-child(2) { inset: 15px; border-left-color: rgba(255,255,255,0.3); border-right-color: rgba(255,255,255,0.3); animation: arcSpin 5s linear infinite reverse; }
.auth-fingerprint { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 4rem; color: var(--primary); text-shadow: 0 0 30px var(--primary-glow); }

.auth-input-group { margin-bottom: 30px; text-align: left; position: relative; z-index: 10; }
.auth-input-group label { font-family: var(--font-display); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.2em; color: var(--text-dim); display: block; margin-bottom: 12px; }
#auth-code { 
    width: 100%; padding: 18px; background: rgba(0,0,0,0.6); 
    border: 1px solid rgba(0,229,255,0.2); border-radius: var(--radius-sm); 
    color: var(--text-bright); font-family: var(--font-mono); font-size: 1.4rem; 
    text-align: center; letter-spacing: 0.5em; outline: none; transition: all 0.3s; 
    box-shadow: inset 0 2px 15px rgba(0,0,0,0.8);
}
#auth-code:focus { border-color: var(--primary); box-shadow: inset 0 2px 15px rgba(0,0,0,0.8), 0 0 25px var(--primary-dim); background: rgba(0,229,255,0.05); }

.auth-btn { 
    width: 100%; padding: 18px; background: rgba(0,229,255,0.05); 
    border: 1px solid var(--primary); color: var(--primary); 
    font-family: var(--font-display); font-size: 1.1rem; font-weight: 900; 
    letter-spacing: 0.3em; cursor: pointer; border-radius: var(--radius-sm); 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; overflow: hidden; z-index: 10; 
}
.auth-btn:hover { background: var(--primary); color: var(--bg-dark); box-shadow: 0 0 40px var(--primary-glow); transform: translateY(-2px); }

/* ======================================================== */
/* INTERNAL MODAL WINDOWS (Profile Vault, Search, Text) */
/* ======================================================== */
.search-window {
    width: 650px; max-width: 95vw;
    background: linear-gradient(145deg, rgba(15, 20, 35, 0.8), rgba(5, 8, 15, 0.95));
    border: 1px solid rgba(0, 229, 255, 0.2); border-top: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px rgba(0,0,0,0.9), inset 0 2px 20px rgba(0,229,255,0.05);
    display: flex; flex-direction: column; overflow: hidden;
    transform: translateY(0) scale(1); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
}
.search-window.dragging { transition: none !important; opacity: 0.8; z-index: 5000; cursor: grabbing; }
.search-window.manually-positioned { transform: none !important; }
.overlay.hidden .search-window { transform: scale(0.95) translateY(20px); opacity: 0; }
.search-window.profile-advance { width: 750px; }

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 24px; background: rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: grab;
}
.modal-title { font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 0.3em; color: var(--primary); text-shadow: 0 0 10px var(--primary-glow); }
.modal-body { padding: 30px 40px; }
#search-frame { width: 100%; height: 60vh; min-height: 400px; border: none; border-radius: var(--radius-sm); background: #fff; }

/* Profile / Biometric Vault Internals */
.profile-section { margin-bottom: 24px; }
.profile-section.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.profile-field { display: flex; flex-direction: column; gap: 8px; }
.profile-field label { font-family: var(--font-display); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.15em; color: var(--text-dim); }
.profile-field input, .profile-field select {
    width: 100%; padding: 12px 16px; background: rgba(0,0,0,0.6);
    border: 1px solid rgba(0,229,255,0.15); border-radius: var(--radius-sm);
    color: var(--text-bright); font-family: var(--font-mono); font-size: 0.95rem; outline: none; transition: all 0.3s;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%2300E5FF' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 10px;
}
.profile-field input:focus, .profile-field select:focus {
    border-color: var(--primary); background: rgba(0,229,255,0.05); box-shadow: 0 0 15px var(--primary-dim);
}
.profile-sync-info { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); text-align: center; margin-bottom: 20px; }
.save-btn {
    width: 100%; padding: 16px; background: rgba(0,229,255,0.1);
    border: 1px solid var(--primary); color: var(--primary);
    font-family: var(--font-display); font-size: 1rem; font-weight: 700; letter-spacing: 0.25em;
    cursor: pointer; border-radius: var(--radius-sm); transition: all 0.3s;
}
.save-btn:hover { background: var(--primary); color: var(--bg-dark); box-shadow: 0 0 25px var(--primary-glow); }

/* Auth Login Footer Extras */
.auth-footer { display: flex; justify-content: space-between; margin-top: 30px; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 15px; }
.security-level, .encryption-type { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-dim); letter-spacing: 0.1em; }
.auth-status { font-family: var(--font-display); font-size: 0.75rem; letter-spacing: 0.2em; color: var(--alert); text-align: center; margin-top: 15px; min-height: 18px; text-shadow: 0 0 10px var(--alert); }
