:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --assistant-bg: #f7f7f8;
    --user-bg: #ffffff;
    --border-color: #dedede;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --assistant-bg: #2a2a2a;
    --user-bg: #1a1a1a;
    --border-color: #404040;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    color: var(--text-color);
}

.message {
    padding: 1rem;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.message.assistant {
    background: var(--assistant-bg);
}

.message.user {
    background: var(--user-bg);
}

.role-badge {
    font-size: 0.8rem;
    font-weight: bold;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--text-color);
    color: var(--bg-color);
    margin-right: 0.5rem;
}

.timestamp {
    font-size: 0.8rem;
    color: #666;
}

.message-content {
    margin-top: 0.5rem;
}

pre {
    background: #000000 !important;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

code {
    font-family: 'Consolas', monospace;
}

#chat-title {
    padding: 1rem;
    margin: 0;
}

.controls {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--text-color);
    z-index: 1000;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.file-input {
    display: none;
}

.file-label {
    padding: 0.5rem 1rem;
    border: 2px solid currentColor;
    border-radius: 20px;
    cursor: pointer;
}

.conversation-select {
    flex-grow: 1;
    max-width: 500px;
}

#chat-container {
    margin-top: 5rem;
}

.select2-container {
    color: black;
}

.theme-toggle {
    padding: 0.5rem 1rem;
    border: 2px solid currentColor;
    border-radius: 20px;
    background: none;
    cursor: pointer;
    color: var(--text-color);
}

.theme-toggle:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

#messages {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.message-content pre {
    background: #000000 !important;
    color: #fff !important;
}

.message-content code {
    background: #000000;
    color: #fff;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.instructions {
    max-width: 1200px;
    margin: 6rem auto 2rem;
    padding: 1rem;
    background: var(--assistant-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.instructions h2 {
    margin-top: 0;
}

.instructions ol {
    padding-left: 1.5rem;
}

.instructions a {
    color: var(--text-color);
}

.layout {
    display: flex;
    margin-top: 4rem;
}

.sidebar {
    width: 300px;
    border-right: 1px solid var(--border-color);
    height: calc(100vh - 4rem);
    position: fixed;
    overflow-y: auto;
    background: var(--bg-color);
    padding: 1rem;
}

.conversation-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.conversation-item {
    padding: 0.75rem;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.conversation-item:hover {
    background: var(--assistant-bg);
}

.conversation-item.active {
    background: var(--assistant-bg);
}

.main-content {
    margin-left: 300px;
    flex: 1;
    padding: 1rem;
}

.search-box {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
}

.menu-toggle {
    display: none;
    padding: 8px 12px;
    font-size: 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
}

.close-sidebar {
    display: none;
    padding: 8px;
    font-size: 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .close-sidebar {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 80%;
        max-width: 300px;
        z-index: 1000;
        transition: left 0.3s ease;
        background: var(--background-color);
        padding: 1rem;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .layout {
        grid-template-columns: 1fr;
    }
}
