:root {
    --primary: #28a745;
    --primary-light: #eef2ff;
    --secondary: #3f37c9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --user-bubble: #28a745;
    --bot-bubble: #f1f5f9;
    --input-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --sidebar-width: 280px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    line-height: 1.5;
    overflow: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    transform: translateX(-100%);
    position: fixed;
    z-index: 1000;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.new-chat-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.new-chat-btn:hover {
    background-color: #218838;
}

.close-sidebar {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-sidebar:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.chat-history {
    padding: 8px;
}

.chat-item {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: var(--transition);
}

.chat-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.chat-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
}
/* Chat history delete button styles */
.chat-item {
    position: relative;
    transition: all 0.2s ease;
}

.chat-item.deleting {
    background-color: #ffeeee !important;
}

.delete-history-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
}

/* HTML code block styles */
.html-code {
    margin-bottom: 20px;
}

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

.run-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.run-btn:hover {
    background: #218838;
}

.html-preview {
    margin-top: 8px;
    border: 1px dashed #ccc;
    padding: 8px;
    background: white;
    border-radius: 4px;
}

/* Make sure scrolling works during typing */
.chat-container {
    overflow-y: auto !important;
}
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.header {
    padding: 16px;
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 10;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    margin-right: 12px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}

.header-content {
    flex: 1;
}

.bot-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.bot-status {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    margin-top: 2px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    margin-right: 6px;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 160px;
    scroll-behavior: smooth;
}

.message-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

.user-message {
    align-self: flex-end;
    background-color: var(--user-bubble);
    color: white;
    border-bottom-right-radius: var(--radius-sm);
}

.bot-message {
    align-self: flex-start;
    background-color: var(--bot-bubble);
    color: var(--text-primary);
    border-bottom-left-radius: var(--radius-sm);
}

.code-container {
    position: relative;
    background-color: #1e1e1e;
    color: #d4d4d4;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin: 8px 0;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    color: #858585;
    font-size: 12px;
}

.copy-btn {
    background: none;
    border: none;
    color: #858585;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.copy-btn:hover {
    color: #d4d4d4;
}

.message-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    text-align: right;
}

.input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background-color: var(--card-bg);
    box-shadow: var(--shadow-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 20;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--input-bg);
    border-radius: var(--radius-lg);
    padding: 8px;
    box-shadow: var(--shadow-sm);
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
    min-height: 20px;
}

.chat-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.send-button:hover {
    background-color: var(--secondary);
}

.send-button:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
}

.cancel-btn-container {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.cancel-btn {
    background-color: #f8f9fa;
    color: #dc3545;
    border: 1px solid #dc3545;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.cancel-btn:hover {
    background-color: #dc3545;
    color: white;
}

.suggestions-container {
    position: fixed;
    bottom: 90px;
    left: 0;
    right: 0;
    padding: 0 16px 16px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    z-index: 15;
}

.suggestions-container::-webkit-scrollbar {
    display: none;
}

.suggestion-chip {
    display: inline-block;
    background-color: var(--card-bg);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 20px;
    margin-right: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.suggestion-chip:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

.typing-indicator {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--bot-bubble);
    border-radius: var(--radius-md);
    width: fit-content;
    margin-bottom: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    margin: 0 2px;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

.file-preview {
    max-width: 100%;
    margin-top: 8px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.file-icon {
    font-size: 20px;
}

.file-name {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-file {
    color: var(--text-secondary);
    cursor: pointer;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #28a745;
        --primary-light: #4338ca;
        --text-primary: #f8fafc;
        --text-secondary: #94a3b8;
        --bg-color: #0f172a;
        --card-bg: #1e293b;
        --bot-bubble: #334155;
        --input-bg: #1e293b;
        --sidebar-bg: #1e293b;
    }
    
    .code-container {
        background-color: #1e1e1e;
    }
    
    .action-btn:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .chat-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
    }
    
    .message {
        max-width: 90%;
    }
}