/* General Body Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main Chat Layout */
.chat-container {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    background-color: #fff;
}

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

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

.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;
    background-color: #fff;
    color: #495057;
}

.new-chat-form input:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.new-chat-form button {
    padding: 0.75rem 1rem;
    background-color: #007bff;
    color: #fff;
    border: 1px solid #007bff;
    border-radius: 0 0.375rem 0.375rem 0;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: background-color 0.2s;
}

.new-chat-form button:hover {
    background-color: #0056b3;
}

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

.conversation-list a {
    display: block;
    padding: 0.85rem 1.25rem;
    color: #495057;
    text-decoration: none;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.2s, color 0.2s;
}

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

.conversation-list a.active {
    background-color: #007bff;
    color: #fff;
    font-weight: 500;
}

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

/* Chat Header */
.chat-header {
    padding: 1rem 2rem;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #343a40;
}

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

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

.message-content {
    max-width: 75%;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    line-height: 1.6;
    position: relative;
}

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

.message.user .message-content {
    background-color: #007bff;
    color: #fff;
    border-radius: 0.75rem 0.75rem 0 0.75rem;
}

.message.ai .message-content {
    background-color: #e9ecef;
    color: #343a40;
    border-radius: 0.75rem 0.75rem 0.75rem 0;
}

.message-author {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.message.user .message-author {
    color: rgba(255, 255, 255, 0.8);
}

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

.chat-form {
    display: flex;
    align-items: stretch;
}

.chat-form textarea {
    flex: 1;
    padding: 1rem;
    background-color: #fff;
    color: #495057;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
    min-height: 50px;
    max-height: 200px;
    transition: border-color 0.2s;
}

.chat-form textarea:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.chat-form button {
    margin-left: 1rem;
    padding: 0.75rem 1.5rem;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-form button:hover {
    background-color: #0056b3;
}

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

.no-conversation-selected h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #343a40;
}
