:root {
    --primary: #8b5cf6;
    --accent: #06b6d4;
    --surface: #020617;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --error: #ef4444;
    --success: #10b981;
    --glass-blur: blur(12px);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at top left, #1e1b4b, #020617);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

.app-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    background: rgba(0, 0, 0, 0.4);
    border-right: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.pulse {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--primary);
    animation: pulse 2s infinite;
}

h2 {
    font-family: 'JetBrains Mono';
    font-size: 1rem;
    letter-spacing: 2px;
}

h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.nav-group {
    margin-bottom: 35px;
}

.monitor-tile {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.tile-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    margin-bottom: 8px;
}

.progress-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 8px 12px;
    background: var(--glass);
    border-radius: 8px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    align-self: center;
}

.dot.green {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.config-item {
    margin-bottom: 15px;
}

label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}

input,
select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 10px 14px;
    border-radius: 8px;
    color: white;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--primary);
}

.sidebar-footer {
    margin-top: auto;
}

.btn-ghost {
    width: 100%;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-ghost:hover {
    background: rgba(255, 0, 0, 0.1);
    color: var(--error);
    border-color: var(--error);
}

/* Workspace */
.workspace {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.workspace-header {
    padding: 20px 40px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}

h1 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge {
    font-size: 0.65rem;
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 99px;
    text-transform: uppercase;
}

.chat-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.msg {
    max-width: 85%;
    animation: fadeIn 0.4s ease-out;
}

.msg.user {
    align-self: flex-end;
}

.msg.assistant {
    align-self: flex-start;
}

.msg.system {
    align-self: center;
    max-width: 90%;
}

.bubble {
    padding: 16px 20px;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 1rem;
}

.msg.user .bubble {
    background: var(--primary);
    border-top-right-radius: 2px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.msg.assistant .bubble {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-top-left-radius: 2px;
}

.msg.system .bubble {
    background: transparent;
    border: 1px dashed var(--glass-border);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* Markdown Styles in Chat */
.content pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
    overflow-x: auto;
}

.content code {
    font-family: 'JetBrains Mono';
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 4px;
    border-radius: 4px;
}

/* Input Area */
.workspace-footer {
    padding: 30px 40px;
    background: linear-gradient(to top, var(--surface), transparent);
}

.input-bubble {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: var(--glass-blur);
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    padding: 10px 0;
    max-height: 200px;
}

#send-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

#send-btn:disabled {
    background: var(--glass-border);
    cursor: not-allowed;
}

#send-btn:hover:not(:disabled) {
    transform: scale(1.05) rotate(-15deg);
    filter: brightness(1.2);
}

/* GDPR */
.gdpr-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    border: 1px solid var(--primary);
    padding: 15px 30px;
    border-radius: 12px;
    z-index: 2000;
    display: flex;
    gap: 30px;
    align-items: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.hidden {
    display: none !important;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing Dots */
.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

@media (max-width: 900px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }
}