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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    height: 100vh;
    background-color: #1e1e1e;
    color: #fff;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* File Explorer Sidebar */
.file-explorer {
    width: 250px;
    height: 100%;
    background-color: #252526;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 5;
}

.explorer-header {
    padding: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #252526;
    border-bottom: 1px solid #333;
}

.explorer-actions {
    display: flex;
    gap: 5px;
}

.explorer-action-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.explorer-action-btn:hover {
    background-color: #3c3c3c;
    color: #fff;
}

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

.file-item, .folder-item {
    padding: 4px 8px 4px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    border-radius: 0;
    position: relative;
}

.file-item:hover, .folder-item:hover {
    background-color: #2a2d2e;
}

.file-item.active {
    background-color: #37373d;
}

.folder-item {
    padding-left: 8px;
}

.folder-item.expanded .folder-icon::before {
    content: '▾';
}

.folder-item .folder-icon::before {
    content: '▸';
    display: inline-block;
    width: 12px;
    text-align: center;
}

.folder-contents {
    margin-left: 12px;
    display: none;
}

.folder-item.expanded .folder-contents {
    display: block;
}

.file-item i, .folder-item i {
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.file-item i.fa-file {
    color: #cecece;
}

.file-item i.fa-file-code {
    color: #4f9fe6;
}

.file-item i.fa-file-alt {
    color: #cecece;
}

.folder-item i.fa-folder {
    color: #dcb67a;
}

.folder-item i.fa-folder-open {
    color: #dcb67a;
}

.file-item .file-actions, .folder-item .folder-actions {
    position: absolute;
    right: 5px;
    display: none;
    gap: 4px;
}

.file-item:hover .file-actions, .folder-item:hover .folder-actions {
    display: flex;
}

.file-action-btn, .folder-action-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.file-action-btn:hover, .folder-action-btn:hover {
    background-color: #3c3c3c;
    color: #fff;
}

.empty-explorer-message {
    padding: 10px;
    color: #888;
    font-size: 12px;
    text-align: center;
    font-style: italic;
}

/* Editor Tabs */
.editor-tabs {
    display: flex;
    background-color: #2d2d2d;
    border-bottom: 1px solid #333;
    overflow-x: auto;
    white-space: nowrap;
    position: relative;
    height: 36px;
}

.tabs-container {
    display: flex;
    overflow-x: auto;
    flex: 1;
}

.editor-tab {
    padding: 0 15px;
    height: 36px;
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #2d2d2d;
    border-right: 1px solid #333;
    font-size: 13px;
    cursor: pointer;
    color: #ccc;
    position: relative;
    min-width: 100px;
    max-width: 200px;
}

.editor-tab.active {
    background-color: #1e1e1e;
    color: #fff;
}

.editor-tab:hover {
    background-color: #3c3c3c;
}

.editor-tab.active:hover {
    background-color: #1e1e1e;
}

.editor-tab .tab-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.tab-close-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    font-size: 12px;
}

.tab-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.tabs-actions {
    display: flex;
    align-items: center;
    padding: 0 5px;
    background-color: #2d2d2d;
    border-left: 1px solid #333;
}

.tab-action-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-action-btn:hover {
    background-color: #3c3c3c;
    color: #fff;
}

.editor-container {
    flex: 1;
    height: 100%;
    border-right: 1px solid #333;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    margin-right: 300px;
}

#monaco-editor {
    width: 100%;
    flex: 1;
}

.chat-container {
    width: 300px;
    display: flex;
    flex-direction: column;
    background-color: #252526;
    border-left: 1px solid #333;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 5;
}

.chat-container.hidden {
    display: none;
}

/* Editor Header */
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #252526;
    border-bottom: 1px solid #333;
    height: 50px;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-language {
    color: #ccc;
    font-size: 0.9rem;
    font-weight: 500;
}

.language-dropdown {
    background-color: #3c3c3c;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
}

.language-dropdown:hover {
    background-color: #454545;
}

.editor-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background-color: #3c3c3c;
    color: #fff;
}

.action-btn i {
    font-size: 16px;
}

/* Sidebar Toolbar */
.sidebar-toolbar {
    display: flex;
    border-bottom: 1px solid #333;
    background-color: #2d2d2d;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: #ccc;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn i {
    font-size: 16px;
}

.tab-btn.active {
    color: #fff;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #0078d4;
}

.tab-btn:hover {
    background-color: #3c3c3c;
}

/* Settings Panel */
.settings-panel {
    padding: 1rem;
    background-color: #2d2d2d;
    overflow-y: auto;
    height: 100%;
}

.settings-panel.hidden {
    display: none;
}

.settings-panel h3 {
    margin-bottom: 1rem;
    margin-top: 1rem;
    color: #fff;
    font-weight: 500;
    font-size: 16px;
}

.settings-panel h3:first-child {
    margin-top: 0;
}

.setting-item {
    margin-bottom: 1rem;
}

.setting-item label {
    display: block;
    margin-bottom: 0.5rem;
    color: #ccc;
    font-size: 14px;
}

.model-dropdown {
    width: 100%;
    padding: 0.5rem;
    background-color: #3c3c3c;
    border: 1px solid #454545;
    border-radius: 4px;
    color: #fff;
    margin-bottom: 0.8rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
}

/* Chat Panel */
#chat-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Chat History */
.chat-selector {
    border-bottom: 1px solid #333;
    background-color: #252526;
}

.chat-history-header {
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: #fff;
    border-bottom: 1px solid #333;
}

.chat-history-list {
    max-height: 200px;
    overflow-y: auto;
}

.chat-history-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.chat-history-item:hover {
    background-color: #3c3c3c;
}

.chat-history-item.active {
    background-color: #37373d;
    border-left: 2px solid #0078d4;
}

.chat-history-item-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.chat-history-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chat-history-item:hover .chat-history-item-actions {
    opacity: 1;
}

.chat-history-action {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.chat-history-action:hover {
    background-color: #454545;
    color: #fff;
}

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

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #1e1e1e;
}

.chat-message {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 8px;
    line-height: 1.5;
    animation: messageSlide 0.3s ease;
    font-family: 'Poppins', sans-serif;
    background-color: #2d2d2d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
}

.user-message {
    background-color: #2c4f7c;
}

.ai-message {
    background-color: #2d2d2d;
}

.system-message {
    background-color: #3c3c3c;
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 12px;
}

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

.chat-message p {
    margin: 0.5rem 0;
}

.chat-message a {
    color: #58a6ff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.chat-message a:hover {
    border-bottom-color: #58a6ff;
}

.chat-message strong {
    color: #e6edf3;
    font-weight: 600;
}

.chat-message em {
    color: #d2a8ff;
}

.chat-message ul, .chat-message ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.chat-message li {
    margin: 0.3rem 0;
}

.chat-message code:not(.code-block code) {
    background-color: #343434;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}

/* Improved Code Block Styling */
.code-block {
    position: relative;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    background-color: #252526;
    border-bottom: 1px solid #333;
}

.code-language {
    color: #888;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.code-block pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
}

.code-block code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.code-actions {
    display: flex;
    gap: 0.5rem;
}

.code-action-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 0.8rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.code-action-btn:hover {
    transform: translateY(-1px);
}

.code-action-btn svg {
    width: 14px;
    height: 14px;
}

.code-action-btn.copy-btn {
    background-color: #2ea043;
}

.code-action-btn.copy-btn:hover {
    background-color: #3fb950;
    box-shadow: 0 2px 4px rgba(46, 160, 67, 0.4);
}

.code-action-btn.implement-btn {
    background-color: #8957e5;
}

.code-action-btn.implement-btn:hover {
    background-color: #a371f7;
    box-shadow: 0 2px 4px rgba(137, 87, 229, 0.4);
}

/* Simplified thinking indicator */
.thinking {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    color: #ccc;
    background-color: #2d2d2d;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
}

/* Remove the thinking dots styling since we're not using it anymore */
.thinking-dots {
    display: none;
}

.thinking-dot {
    display: none;
}

.chat-input-container {
    padding: 1rem;
    border-top: 1px solid #333;
    background-color: #252526;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input-container.disabled {
    opacity: 0.7;
    pointer-events: none;
}

#chat-input {
    flex: 1;
    height: 80px;
    padding: 0.8rem;
    background-color: #3c3c3c;
    border: 1px solid #454545;
    border-radius: 8px;
    color: #fff;
    resize: none;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
}

#send-button {
    width: 40px;
    height: 40px;
    background-color: #0078d4;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-button:hover {
    background-color: #0086f0;
    transform: translateY(-1px);
}

#send-button i {
    font-size: 18px;
}

#sidebar-width {
    width: 100%;
    margin-top: 0.5rem;
}

/* API key management */
.api-keys-container {
    margin-top: 1rem;
}

.api-key-item {
    margin-bottom: 1rem;
}

.api-key-item label {
    display: block;
    margin-bottom: 0.5rem;
    color: #ccc;
    font-size: 14px;
}

.api-key-input-group {
    display: flex;
    gap: 0.5rem;
}

.api-key-input {
    flex: 1;
    padding: 0.8rem;
    background-color: #3c3c3c;
    border: 1px solid #454545;
    border-radius: 8px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
}

.toggle-visibility-btn {
    background-color: #3c3c3c;
    border: 1px solid #454545;
    border-radius: 8px;
    color: #ccc;
    cursor: pointer;
    padding: 0 0.8rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-visibility-btn:hover {
    background-color: #4c4c4c;
    color: #fff;
}

.save-keys-btn {
    width: 100%;
    padding: 0.7rem;
    background-color: #2ea043;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.save-keys-btn:hover {
    background-color: #3fb950;
    transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
    
    .container {
        height: 100vh;
        width: 100vw;
        overflow: hidden;
    }

    .chat-container {
        width: 100%;
    }

    .chat-container.hidden {
        transform: translateX(100%);
    }
    
    .editor-container {
        width: 100%;
    }
    
    #monaco-editor {
        width: 100%;
    }
    
    .chat-message {
        font-size: 13px;
        padding: 0.8rem;
    }
    
    .system-message {
        font-size: 11px;
    }
    
    .code-block code {
        font-size: 0.85rem;
    }
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-content {
    background-color: #252526;
    border-radius: 6px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-header {
    padding: 15px 20px;
    background-color: #1e1e1e;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    color: #ccc;
    font-size: 20px;
    cursor: pointer;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    background-color: #1e1e1e;
    border-top: 1px solid #333;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 8px 12px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    border-radius: 4px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cccccc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.primary-btn {
    background-color: #0078d4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.primary-btn:hover {
    background-color: #0086f0;
}

.cancel-btn {
    background-color: #3c3c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.cancel-btn:hover {
    background-color: #4c4c4c;
}

/* Folder tree select styles */
.folder-tree-select {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #2d2d2d;
}

.folder-option {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ccc;
}

.folder-option:hover {
    background-color: #3c3c3c;
}

.folder-option.active {
    background-color: #0078d4;
    color: white;
}

.folder-option i {
    color: #e9a84c;
}
