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

body {
    background: #0d0d0d;
    color: #e0e0e0;
    font-family: system-ui, -apple-system, sans-serif;
    height: 100vh;
    overflow: hidden;
}

.app {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 280px;
    background: #141414;
    border-right: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #2a2a2a;
}

.sidebar-header h2 {
    color: #b388ff;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

#newChatBtn {
    background: #b388ff;
    color: #0d0d0d;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
}

#newChatBtn:hover {
    background: #9f6ee0;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.chat-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    color: #ccc;
    font-size: 0.9rem;
}

.chat-item:hover {
    background: #1a1a1a;
}

.chat-item.active {
    background: #2a1a3a;
    color: #fff;
    border-left: 3px solid #b388ff;
}

.chat-item .delete-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    display: none;
}

.chat-item:hover .delete-btn {
    display: block;
}

.chat-item .delete-btn:hover {
    color: #ff4444;
    background: #2a1a1a;
}

.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #2a2a2a;
    font-size: 0.7rem;
    color: #555;
    text-align: center;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0d0d0d;
}

.chat-header {
    padding: 1rem 2rem;
    border-bottom: 1px solid #1a1a1a;
}

.chat-header h3 {
    color: #e0e0e0;
    font-weight: 400;
    font-size: 1rem;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.message {
    margin-bottom: 1rem;
    max-width: 80%;
}

.message.user {
    margin-left: auto;
    text-align: right;
}

.message.user p {
    background: #1a1a2a;
    padding: 0.75rem 1rem;
    border-radius: 12px 12px 4px 12px;
    display: inline-block;
    color: #e0e0e0;
}

.message.bot p {
    background: #141414;
    padding: 0.75rem 1rem;
    border-radius: 12px 12px 12px 4px;
    display: inline-block;
    color: #e0e0e0;
}

.input-area {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-top: 1px solid #1a1a1a;
    background: #0d0d0d;
}

#messageInput {
    flex: 1;
    padding: 0.75rem 1rem;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #e0e0e0;
    outline: none;
}

#messageInput:focus {
    border-color: #b388ff;
}

#sendBtn {
    background: #b388ff;
    color: #0d0d0d;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

#sendBtn:hover {
    background: #9f6ee0;
}

@media (max-width: 640px) {
    .sidebar {
        width: 200px;
    }
    .messages {
        padding: 1rem;
    }
    .input-area {
        padding: 1rem;
    }
}
