body {
    margin: 0;
    height: 100vh;
    display: flex;
    overflow: hidden;
    font-family: 'Segoe UI', sans-serif;
    background-color: #0a0e17;
    color: #fff;
}

.sidebar {
    width: 260px;
    background-color: #151c2f;
    padding: 1rem;
    border-right: 1px solid #2d3748;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    margin-top: 2.5rem;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.toggle-history {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #7b2cbf;
    border: none;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.toggle-history i {
    color: white;
    font-size: 24px;
}

.history {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history button {
    background-color: #1a1a2e;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    text-align: left;
    font-size: 14px;
    color: #e0e0e0;
}

.history button:hover {
    background-color: #2d3748;
}

.main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    margin-left: 0;
    width: 100%;
    transition: margin-left 0.3s ease;
}

.chat-container {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.input-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-area textarea {
    flex-grow: 1;
    resize: none;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid #2d3748;
    background-color: #151c2f;
    color: #fff;
}

.input-area button {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
}

.message {
    margin: 1rem 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.user-message {
    justify-content: flex-end;
}

.ai-message {
    justify-content: flex-start;
}

.avatar {
    font-weight: bold;
    padding: 10px;
    border-radius: 50%;
    color: white;
    min-width: 40px;
    text-align: center;
}

.user-avatar {
    background-color: #9567c4;
}

.ai-avatar {
    background-color: #663399;
}

.message-content {
    background: #151c2f;
    color: #e0e0e0;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    max-width: 75%;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    white-space: pre-wrap;
}

#sendBtn,
#newChatBtn {
    background-color: #7b2cbf;
    color: white;
}

.loading {
    font-style: italic;
    color: #999;
}

@media (min-width: 768px) {
    .main.with-sidebar {
        margin-left: 260px;
    }
}