:root {
    --bg-color: #0f111a;
    --sidebar-bg: rgba(20, 24, 36, 0.7);
    --panel-bg: rgba(30, 35, 50, 0.6);
    --border-color: rgba(255, 255, 255, 0.1);
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #10b981;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.15), transparent 25%);
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
}

.logo {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo h2 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.logo h2 span {
    color: var(--primary-color);
}

.user-info {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logout-btn {
    color: #ef4444;
    text-decoration: none;
    transition: 0.2s;
}
.logout-btn:hover { color: #dc2626; }

.main-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.main-menu ul {
    list-style: none;
}

.main-menu li {
    padding: 12px 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

.main-menu li:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}

.main-menu li.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-right: 3px solid var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.tab-pane {
    display: none;
    height: 100%;
    flex-direction: column;
}

.tab-pane.active {
    display: flex;
}

/* Page Headers */
.page-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h2 { font-weight: 500; }

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}
.btn-primary:hover { background: var(--primary-hover); }

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.alert.warning {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 15px;
    margin: 20px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Chat Tab Specifics */
.chat-header {
    padding: 15px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(20, 24, 36, 0.4);
}

.badge {
    background: var(--panel-bg);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-right: 10px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}
.project-badge { border-color: rgba(99, 102, 241, 0.3); color: #818cf8; }
.agent-badge { border-color: rgba(16, 185, 129, 0.3); color: #34d399; }

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.message {
    display: flex;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.message.user { flex-direction: row-reverse; }
.message.system { justify-content: center; opacity: 0.7; font-size: 0.9rem; }

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.message.ai .avatar { background: var(--primary-color); color: white; }
.message.user .avatar { background: var(--panel-bg); border: 1px solid var(--border-color); }
.message.system .avatar { background: transparent; }

.content {
    background: var(--panel-bg);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    line-height: 1.6;
    width: fit-content;
    max-width: calc(100% - 50px);
}

.message.user .content {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.input-area {
    padding: 20px 24px;
    background: var(--sidebar-bg);
    border-top: 1px solid var(--border-color);
}

.input-wrapper {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: flex-end;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 5px;
    transition: 0.3s;
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 12px;
    resize: none;
    outline: none;
    font-size: 0.95rem;
    max-height: 150px;
    overflow-y: auto;
}

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

#send-btn:hover { background: var(--primary-hover); }

/* Markdown Styles */
.content pre {
    background: #1e1e1e !important;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    overflow-x: auto;
    border: 1px solid #333;
}
.content p { margin-bottom: 10px; }
.content p:last-child { margin-bottom: 0; }
.content ul, .content ol { margin-left: 20px; margin-bottom: 10px; }
