:root {
    --bg-dark: #0f1115;
    --bg-panel: #1a1d24;
    --primary: #4f46e5;
    --primary-hover: #6366f1;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #2d3748;
}

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    overflow: hidden;
}

.chat-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: var(--bg-panel);
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(15, 17, 21, 0.95);
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.logo-box {
    background: linear-gradient(135deg, #4f46e5, #ec4899);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
}

.header-text h1 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.header-text .status {
    font-size: 11px;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-text .status::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

#new-chat-btn {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#new-chat-btn:hover {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 10px;
}

.message {
    display: flex;
    gap: 10px;
    max-width: 90%;
    animation: fadeIn 0.3s ease forwards;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-message {
    align-self: flex-start;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border);
    font-size: 14px;
    flex-shrink: 0;
}

.user-message .avatar {
    background: var(--primary);
    color: white;
}

.bubble {
    background: #232730;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.user-message .bubble {
    background: var(--primary);
    color: white;
}

.chat-input-wrapper {
    padding: 1rem;
    background: rgba(15, 17, 21, 0.95);
    border-top: 1px solid var(--border);
}

.input-box {
    display: flex;
    background: #232730;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.input-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

#user-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 14px 16px;
    color: var(--text-main);
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

#send-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 0 16px;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.3s ease;
}

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

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

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

pre {
    background: #0d1117;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12px;
    margin-top: 8px;
    border: 1px solid #30363d;
}

code {
    font-family: 'Courier New', monospace;
    color: #e6edf3;
}

.plan-section {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}

.executing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #f59e0b;
    margin-top: 10px;
    background: rgba(245, 158, 11, 0.1);
    padding: 6px 10px;
    border-radius: 6px;
}

.executing-indicator.success {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.executing-indicator.error {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.executing-indicator i.spinning {
    animation: spin 1.5s linear infinite;
}

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