/* General App Body & Layout */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
}

/* Main Chat Layout */
.chat-container {
    display: flex;
    height: calc(100vh - 120px); /* Adjusted for header/footer */
    width: 100%;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
}

/* Sidebar Styles */
.chat-sidebar {
    width: 280px;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    flex-shrink: 0;
}

.new-chat-form {
    display: flex;
    margin-bottom: 1rem;
}

.new-chat-form input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem 0 0 0.375rem;
    font-size: 0.9rem;
}

.new-chat-form button {
    padding: 0.75rem 1rem;
    background-color: #0d6efd;
    color: #fff;
    border: 1px solid #0d6efd;
    border-radius: 0 0.375rem 0.375rem 0;
    cursor: pointer;
}

.conversation-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
}

.conversation-list a {
    display: block;
    padding: 0.75rem 1rem;
    color: #495057;
    text-decoration: none;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
}

.conversation-list a:hover {
    background-color: #e9ecef;
}

.conversation-list a.active {
    background-color: #0d6efd;
    color: #fff;
}

/* Main Content Area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

/* Chat Header */
.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

/* Message Area */
.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.message {
    margin-bottom: 1rem;
    display: flex;
}

.message-content {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    line-height: 1.5;
}

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

.message.user .message-content {
    background-color: #0d6efd;
    color: #fff;
}

.message.ai .message-content {
    background-color: #e9ecef;
    color: #343a40;
}

.message-author {
    font-weight: bold;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

/* Message Input Form */
.chat-form-container {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.chat-form {
    display: flex;
}

.chat-form textarea {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    font-size: 1rem;
    resize: none;
}

.chat-form button {
    margin-left: 1rem;
    padding: 0.75rem 1.5rem;
    background-color: #0d6efd;
    color: #fff;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
}

/* Empty State for Chat */
.no-conversation-selected {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #6c757d;
}
