:root {
    --primary-color: #00f7ff;
    --secondary-color: #0055ff;
    --bg-color: #000000; /* True Black for Mirror */
    --text-color: #e0f7ff;
    --hud-border: 1px solid rgba(0, 247, 255, 0.15); /* Subtler border */
    --glass: rgba(0, 0, 0, 0); /* Ultra clear */
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Rajdhani', sans-serif;
    height: 100vh;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Background Grid Effect - Reduced Opacity for Mirror */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(rgba(0, 247, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 247, 255, 0.01) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
}

.overlay::after {
    display: none; /* Remove vignetting for cleaner blacks */
}

/* Header / Top HUD */
.header {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    border-bottom: var(--hud-border);
    background: transparent; /* Transparent for float effect */
    box-shadow: none;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.arc-reactor-icon {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--primary-color), inset 0 0 10px var(--primary-color);
    animation: pulse 2s infinite;
    position: relative;
}

.arc-reactor-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 1px solid white;
    border-radius: 50%;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    letter-spacing: 4px;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--secondary-color);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    letter-spacing: 2px;
}

.status-dot {
    width: 10px;
    height: 10px;
    background-color: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-color);
    animation: blink 1s infinite alternate;
}

/* Main Content: 3 Columns HUD */
.chat-container {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
    padding: 20px 40px;
    height: calc(100vh - 160px); 
}

/* Left Panel: System Monitor */
.system-panel {
    border: var(--hud-border);
    background: transparent; /* Clear */
    border-radius: 10px; 
    clip-path: polygon(0 0, 100% 0, 100% 85%, 85% 100%, 0 100%);
    padding: 20px;
}

.panel-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    color: var(--secondary-color);
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
}

.hud-circle-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.hud-spinny-thing {
    width: 150px;
    height: 150px;
    border: 1px dashed var(--primary-color);
    border-radius: 50%;
    animation: rotate 10s linear infinite;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hud-inner-circle {
    width: 100px;
    height: 100px;
    border: 2px solid var(--secondary-color);
    border-top: 2px solid transparent;
    border-bottom: 2px solid transparent;
    border-radius: 50%;
    animation: rotate-rev 5s linear infinite;
}

/* Middle Panel: Chat */
.chat-window {
    border: var(--hud-border);
    background: transparent;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border-radius: 4px;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

.chat-history::-webkit-scrollbar {
    width: 5px;
}
.chat-history::-webkit-scrollbar-thumb {
    background: var(--primary-color);
}

.message {
    max-width: 80%;
    padding: 12px 18px;
    font-size: 16px;
    line-height: 1.5;
    position: relative;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(2px); /* Slight blur for readability */
}

.message-content {
    position: relative;
    z-index: 2;
}

.user-message {
    align-self: flex-end;
    background: rgba(0, 85, 255, 0.05); /* Very low opacity */
    border-right: 2px solid var(--secondary-color);
    text-align: right;
}

.ai-message {
    align-self: flex-start;
    background: rgba(0, 247, 255, 0.02);
    border-left: 2px solid var(--primary-color);
}

/* Right Panel: Audio Vis */
.audio-panel {
    border: var(--hud-border);
    background: transparent; 
    border-radius: 10px;
    clip-path: polygon(15% 0, 100% 0, 100% 100%, 0 100%, 0 15%);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#audio-visualizer {
    display: flex;
    gap: 5px;
    height: 100px;
    align-items: center;
}

.bar {
    width: 8px;
    background: var(--primary-color);
    height: 10px;
    transition: height 0.1s ease;
    box-shadow: 0 0 10px var(--primary-color);
}

/* Footer / Input */
.input-area {
    height: 80px;
    padding: 0 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to top, rgba(0,20,40,0.9), transparent);
}

.input-wrapper {
    width: 100%;
    max-width: 800px;
    height: 50px;
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--primary-color);
    background: rgba(0,0,0,0.6);
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
}

#user-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-family: 'Rajdhani', sans-serif;
    font-size: 18px;
    padding: 0 20px;
    outline: none;
    letter-spacing: 1px;
    text-transform: uppercase;
}

#user-input::placeholder {
    color: rgba(0, 247, 255, 0.3);
}

button {
    background: transparent;
    border: none;
    color: var(--primary-color);
    padding: 0 15px;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.2s;
}

button:hover {
    color: white;
    text-shadow: 0 0 10px var(--primary-color);
    transform: scale(1.1);
}

.mic-active {
    color: red !important;
    animation: pulse 0.5s infinite;
}

/* Animations */
@keyframes rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes rotate-rev { 0% { transform: rotate(0deg); } 100% { transform: rotate(-360deg); } }
@keyframes pulse { 0% { opacity: 0.6; } 100% { opacity: 1; } }
@keyframes blink { 0% { opacity: 0.3; } 100% { opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-container {
        grid-template-columns: 1fr;
        padding: 10px;
    }
    .system-panel, .audio-panel {
        display: none;
    }
}
