:root {
    --neon-cyan: #00f2ff;
    --neon-glow: rgba(0, 242, 255, 0.6);
    --neon-err: #ff3e3e;
    --neon-warn: #f4ea2b;
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.1);
    --dark-bg: #010103;
}

body,
html {
    height: 100%;
    margin: 0;
    background-color: var(--dark-bg);
    color: #e0faff;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
}

/* --- BACKGROUND ATMOSPHERE --- */
.hologram-stage {
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(1, 1, 3, 0.7), rgba(1, 1, 3, 0.7)),
        url('https://images.unsplash.com/photo-1550751827-4bd374c3f58b?auto=format&fit=crop&q=80&w=2070');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -2;
}

.neural-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--glass-border) 1px, transparent 1px),
        linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.15;
    transform: perspective(1000px) rotateX(65deg) translateY(-100px);
    z-index: -1;
    pointer-events: none;
}

/* --- MAINFRAME CONSOLE --- */
.aegis-mainframe {
    height: 85vh;
    width: 95%;
    max-width: 900px;
    margin: 0 auto;
    background: var(--glass-bg);
    backdrop-filter: blur(45px);
    border: 1px solid var(--glass-border);
    border-radius: 35px;
    overflow: hidden;
    box-shadow: 0 0 80px rgba(0, 242, 255, 0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(0.95);
    opacity: 0;
}

/* --- HEADER --- */
.console-header {
    padding: 15px 25px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(1, 1, 3, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 120px;
    position: relative;
    z-index: 20;
}

.brand-unit {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.brand-unit h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 8px;
    margin: 0;
    color: #fff;
    text-transform: uppercase;
}

.status-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: var(--neon-cyan);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.8;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--neon-cyan);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--neon-cyan);
    transition: all 0.3s ease;
}

.pulse-dot.error {
    background: var(--neon-err);
    box-shadow: 0 0 12px var(--neon-err);
}

.pulse-dot.warn {
    background: var(--neon-warn);
    box-shadow: 0 0 12px var(--neon-warn);
}

/* LOGO WRAPPER (Top Right) */
.header-face-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid var(--glass-border);
    padding-left: 20px;
}

.custom-logo-placeholder {
    width: 80px;
    height: 80px;
    border: 1px dashed var(--neon-cyan);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--neon-cyan);
    text-align: center;
}

/* --- DATA STREAM WITH BACKGROUND VIDEO --- */
#data-stream {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    scroll-behavior: smooth;
    position: relative;
}

.chat-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.chat-video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.25;
}

.chat-video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(1, 1, 3, 0.4), rgba(1, 1, 3, 0.6));
    z-index: 1;
}

.messages-container {
    position: relative;
    z-index: 2;
}

.message-row {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
}

.message-row.ai {
    align-items: flex-start;
}

.message-row.user {
    align-items: flex-end;
}

.bubble {
    max-width: 80%;
    padding: 15px 20px;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai .bubble {
    background: rgba(0, 242, 255, 0.03);
    color: #b2f8ff;
    border-top-left-radius: 2px;
    border-left: 3px solid var(--neon-cyan);
}

.user .bubble {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-top-right-radius: 2px;
    border-right: 3px solid #fff;
}

.sender-tag {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 1px;
    margin-bottom: 5px;
    opacity: 0.7;
}

.emotion-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    margin-left: 8px;
    text-transform: uppercase;
    color: var(--neon-cyan);
}

/* --- INPUT DECK --- */
.input-deck {
    padding: 30px 40px;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 10;
}

.uplink-field {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid var(--glass-border) !important;
    color: white !important;
    border-radius: 15px !important;
    padding: 15px 25px !important;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.transmit-btn {
    background: var(--neon-cyan);
    color: black;
    border: none;
    border-radius: 12px;
    width: 55px;
    height: 55px;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.2);
}

.transmit-btn:hover:not(:disabled) {
    box-shadow: 0 0 30px var(--neon-cyan);
    transform: translateY(-2px) scale(1.05);
    background: #fff;
}

.transmit-btn:disabled {
    opacity: 0.5;
    background: #444;
    cursor: not-allowed;
}

/* --- SYNC LOADER --- */
.bit-loader {
    display: flex;
    gap: 6px;
    padding: 10px;
}

.bit {
    width: 5px;
    height: 5px;
    background: var(--neon-cyan);
    border-radius: 50%;
    animation: bitJump 1.4s infinite ease-in-out both;
}

.bit:nth-child(2) {
    animation-delay: 0.2s;
}

.bit:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bitJump {

    0%,
    80%,
    100% {
        transform: scale(0.5);
        opacity: 0.3;
    }

    40% {
        transform: scale(1.4);
        opacity: 1;
    }
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 255, 0.2);
    border-radius: 10px;
}
/* Button base */
.transmit-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #00f7ff;
    border: none;
    transition: 0.3s;
}

/* Hover effect */
.transmit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px #00f7ff;
}

/* Mic special glow */
.mic-btn {
    background: #00e0ff;
}

/* Input alignment fix */
.uplink-field {
    height: 48px;
    border-radius: 12px;
}