* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #000000;
    color: #ffffff;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: #0a0a0a;
    border-right: 1px solid #333333;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #333333;
}

.sidebar-header .new-chat-btn {
    width: 100%;
    background-color: #8b5cf6;
    border: 1px solid #8b5cf6;
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    transition: background-color 0.2s;
}

.sidebar-header .new-chat-btn:hover {
    background-color: #7c3aed;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.chat-history-item {
    padding: 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    group: hover;
}

.chat-history-item:hover {
    background-color: #1a1a1a;
}

.chat-history-item.active {
    background-color: #1a1a1a;
    border-left: 3px solid #8b5cf6;
}

.chat-title {
    font-size: 0.875rem;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.chat-date {
    font-size: 0.75rem;
    color: #888888;
    margin-top: 0.25rem;
}

.delete-history-btn {
    background: none;
    border: none;
    color: #888888;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
}

.chat-history-item:hover .delete-history-btn {
    opacity: 1;
}

.delete-history-btn:hover {
    background-color: #333333;
    color: #ffffff;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #333333;
}

.toggle-sidebar-btn {
    background: none;
    border: 1px solid #333333;
    color: #ffffff;
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.toggle-sidebar-btn:hover {
    background-color: #1a1a1a;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: none;
    margin: 0;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid #333333;
    background-color: #0a0a0a;
}

.chat-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.mobile-menu-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    display: none;
    transition: background-color 0.2s;
}

.mobile-menu-btn:hover {
    background-color: #333333;
}

.delete-chat-btn {
    background: none;
    border: 1px solid #333333;
    color: #ffffff;
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.delete-chat-btn:hover {
    background-color: #333333;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.message {
    margin-bottom: 1.5rem;
}

.message-content {
    display: flex;
    gap: 1rem;
    max-width: 100%;
    padding: 0 2rem;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.user-avatar {
    background-color: #8b5cf6;
    color: white;
}

.assistant-avatar {
    background-color: #a855f7;
    color: white;
}

.text {
    flex: 1;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.user-message {
    background-color: #0a0a0a;
}

.assistant-message {
    background-color: #111111;
}

.user-message .message-content,
.assistant-message .message-content {
    padding: 1.5rem 2rem;
}

.chat-input-container {
    padding: 1rem 2rem 2rem;
    background-color: #000000;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    background-color: #1a1a1a;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid #333333;
}

.input-wrapper:focus-within {
    border-color: #8b5cf6;
}

#messageInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
    max-height: 200px;
    min-height: 24px;
}

#messageInput::placeholder {
    color: #888888;
}

.send-btn {
    background-color: #8b5cf6;
    border: none;
    border-radius: 0.375rem;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.send-btn:hover:not(:disabled) {
    background-color: #7c3aed;
}

.send-btn:disabled {
    background-color: #333333;
    cursor: not-allowed;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #888888;
    font-style: italic;
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
}

.typing-dot {
    width: 4px;
    height: 4px;
    background-color: #8b5cf6;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: #333333;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background-color: #444444;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .chat-header {
        padding: 1rem;
    }
    
    .chat-header h1 {
        text-align: left;
        margin-left: 1rem;
    }
    
    .message-content {
        padding: 0 1rem;
    }
    
    .user-message .message-content,
    .assistant-message .message-content {
        padding: 1.5rem 1rem;
    }
    
    .chat-input-container {
        padding: 1rem;
    }
    

}



/* Sidebar scrollbar */
.chat-history::-webkit-scrollbar {
    width: 6px;
}

.chat-history::-webkit-scrollbar-track {
    background: transparent;
}

.chat-history::-webkit-scrollbar-thumb {
    background-color: #333333;
    border-radius: 3px;
}

.chat-history::-webkit-scrollbar-thumb:hover {
    background-color: #444444;
}