:root {
    --bg-dark: #08080c;
    --pane-bg: rgba(16, 16, 26, 0.35);
    --border-color: rgba(212, 175, 55, 0.15);
    --accent-color: #D4AF37;
    --accent-hover: #FFD700;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --chat-user-bg: rgba(212, 175, 55, 0.08);
    --chat-bot-bg: rgba(20, 20, 30, 0.5);
    --glass-blur: blur(24px);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    position: relative;
}

h1, h2, h3, .brand {
    font-family: 'Cinzel', serif;
}

.background-animation {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.05), transparent 60%),
                radial-gradient(circle at 80% 20%, rgba(75, 0, 130, 0.15), transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(13, 30, 80, 0.15), transparent 50%);
    animation: rotateGradient 60s linear infinite;
    z-index: -1;
}

@keyframes rotateGradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    backdrop-filter: var(--glass-blur);
    background: rgba(15, 17, 26, 0.7);
}

/* Activity Bar */
.activity-bar {
    width: 75px;
    background: rgba(0, 0, 0, 0.3);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    z-index: 10;
}

.brand {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 30px;
}

.pulse-glow {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { filter: drop-shadow(0 0 2px var(--accent-color)); }
    50% { filter: drop-shadow(0 0 15px #FFFAF0) drop-shadow(0 0 6px var(--accent-color)); }
    100% { filter: drop-shadow(0 0 2px var(--accent-color)); }
}

.tool-icons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
}

.bottom-icons {
    margin-top: auto;
}

.tool-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 60px;
    height: 50px;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.tool-btn i {
    font-size: 1.1rem;
}

.tool-btn span {
    font-size: 0.6rem;
    font-weight: 600;
    opacity: 0.8;
}

.tool-btn:hover {
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.1);
}

/* Panes */
.pane {
    display: flex;
    flex-direction: column;
    background: var(--pane-bg);
    border-right: 1px solid var(--border-color);
    overflow: hidden;
}

.chat-pane { flex: 1; min-width: 300px; }
.workspace-pane { flex: 2; display: flex; flex-direction: row; min-width: 400px; }
.tasks-pane { width: 300px; min-width: 250px; background: rgba(0, 0, 0, 0.2); }

.pane-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
}

.pane-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-color);
}

/* Chat History */
.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--text-secondary) transparent;
}

.message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: fadeIn 0.3s ease;
}

.message.user .msg-timestamp { text-align: right; }
.message.assistant .msg-timestamp { text-align: left; }

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

.message.user { align-self: flex-end; }
.message.assistant { align-self: flex-start; }

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.6;
    font-size: 0.95rem;
    white-space: pre-wrap;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.message.user .message-content {
    background: var(--chat-user-bg);
    color: var(--accent-color);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: var(--chat-bot-bg);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.chat-input-container {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    background: rgba(0,0,0,0.15);
}

#chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    transition: border-color 0.3s;
}

#chat-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

#send-button {
    background: var(--accent-color);
    color: var(--bg-dark);
    border: none;
    border-radius: 12px;
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#send-button:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

/* Resizer */
.resizer {
    width: 4px;
    background: var(--border-color);
    cursor: col-resize;
    transition: background 0.2s;
}
.resizer:hover { background: var(--accent-color); }

/* Workspace Pane */
.workspace-sidebar {
    width: 250px;
    min-width: 150px;
    max-width: 600px;
    resize: horizontal;
    overflow-x: auto;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.1);
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 15px 0;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    background: rgba(212, 175, 55, 0.05);
}

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.file-tree-container {
    flex: 1;
    overflow: auto;
    padding: 10px;
}

.file-list {
    list-style: none;
    min-width: max-content;
}

.file-list li {
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.file-list li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.file-list li.active {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-color);
    border-left: 3px solid var(--accent-color);
}

/* Folder Tree */
.folder {
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
}

.folder:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.folder-children {
    list-style: none;
    margin-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    display: none;
}

.folder.open + .folder-children {
    display: block;
}

.file-list li.file-item {
    margin-left: 15px;
}

.workspace-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.2);
}

.editor-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
}

.editor-header h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.glass-btn {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.glass-btn:hover {
    background: var(--accent-color);
    color: var(--bg-dark);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.editor-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.empty-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    opacity: 0.5;
    gap: 15px;
}

#editor-textarea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Fira Code', monospace;
    resize: none;
    outline: none;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Tasks Pane */
.tasks-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.task-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    transition: transform 0.2s;
}

.task-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.task-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.task-name { font-weight: 600; font-size: 0.95rem; }

.task-status {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
}

.task-status.running { background: rgba(212, 175, 55, 0.2); color: var(--accent-color); }
.task-status.waiting { background: rgba(255, 170, 0, 0.2); color: #ffaa00; }

.task-details { font-size: 0.85rem; color: var(--text-secondary); }

/* Database Tables Viewer */
.db-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-family: 'Inter', sans-serif;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    overflow: hidden;
}
.db-table th, .db-table td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
}
.db-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-color);
    font-weight: 600;
}
.db-schema-header {
    margin-top: 25px;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }
