:root {
    --bg-deep: #050510;
    --accent-cyan: #00f3ff;
    --accent-purple: #bc13fe;
    --text-main: #e0e0f0;
    --glass-bg: rgba(15, 15, 35, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-cyan: 0 0 15px rgba(0, 243, 255, 0.3);
    --shadow-purple: 0 0 15px rgba(188, 19, 254, 0.3);
}

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

body, html {
    height: 100%;
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
}

/* Animated Grid Background */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background-image: 
        linear-gradient(var(--glass-border) 1px, transparent 1px),
        linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg) translateY(-50%);
    animation: grid-move 20s linear infinite;
    z-index: -1;
    opacity: 0.3;
}

@keyframes grid-move {
    0% { transform: perspective(500px) rotateX(60deg) translateY(-50%); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(0%); }
}

/* Layout Grid */
.hud-container {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    grid-template-rows: 60px 1fr 100px;
    height: 100vh;
    gap: 20px;
    padding: 20px;
    background: radial-gradient(circle at center, rgba(18, 18, 45, 0.4) 0%, transparent 70%);
}

/* Glass Panel Base */
.panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    opacity: 0.5;
}

/* Header */
header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(5, 5, 16, 0.8);
    backdrop-filter: blur(5px);
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Sidebar Elements */
.sidebar-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin-bottom: 15px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-title::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--accent-cyan);
}

.stat-row {
    margin-bottom: 20px;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.stat-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.stat-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    width: 0%;
    transition: width 1s ease;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

/* AI Core Centerpiece */
.ai-core-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    height: 120px;
}

.ai-core {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
    box-shadow: 0 0 30px var(--accent-cyan);
    position: relative;
    animation: pulse 2s infinite ease-in-out;
    opacity: 0.8;
}

.ai-core.thinking {
    animation: thinking-pulse 0.5s infinite ease-in-out;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
    box-shadow: 0 0 50px var(--accent-purple);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 0.9; }
}

@keyframes thinking-pulse {
    0%, 100% { transform: scale(1.1); filter: hue-rotate(0deg); }
    50% { transform: scale(1.3); filter: hue-rotate(45deg); }
}

/* Main Chat */
.main-chat {
    grid-column: 2;
    padding: 0;
    display: flex;
    flex-direction: column;
}

#chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-family: 'Fira Code', monospace;
    scrollbar-width: none;
}

#chat-history::-webkit-scrollbar { display: none; }

.message {
    max-width: 85%;
    padding: 15px 20px;
    border-radius: 4px;
    line-height: 1.6;
    position: relative;
    font-size: 0.95rem;
}

.user-message {
    align-self: flex-end;
    background: rgba(188, 19, 254, 0.1);
    border-right: 3px solid var(--accent-purple);
    text-align: right;
}

.ai-message {
    align-self: flex-start;
    background: rgba(0, 243, 255, 0.05);
    border-left: 3px solid var(--accent-cyan);
}

.message-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
    opacity: 0.5;
}

/* Module List */
.module-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4db6ac;
    box-shadow: 0 0 5px #4db6ac;
}

/* Input Area */
.input-panel {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

#user-input {
    flex: 1;
    background: transparent;
    border: 1px solid var(--glass-border);
    padding: 15px 25px;
    border-radius: 30px;
    color: white;
    font-family: 'Fira Code', monospace;
    outline: none;
    transition: all 0.3s;
}

#user-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: var(--shadow-cyan);
}

/* Footer Info */
.footer-info {
    grid-row: 3;
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    opacity: 0.4;
    letter-spacing: 3px;
    text-transform: uppercase;
}
