.chat-card {
    height: calc(91vh - 100px);
    display: flex;
    flex-direction: column;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: var(--card-bg);
}

.message-container {
    display: flex;
    margin-bottom: 1rem;
    align-items: flex-end;
}

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

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

.message-avatar {
    margin-right: 0.5rem;
}

.message-avatar img {
    width: 2rem;
    height: 2rem;
    border: 2px solid var(--border-color);
}

.message {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    max-width: 75%;
    word-break: break-word;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message-sent {
    background-color: var(--accent-color);
    color: white;
    border-top-right-radius: 0.25rem;
}

.message-received {
    background-color: var(--hover-bg);
    color: var(--bs-body-color);
    border-top-left-radius: 0.25rem;
}

.message-time {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    text-align: right;
}

.message-status {
    margin-left: 0.25rem;
}

.message-status.read {
    color: var(--accent-light);
}

.message-status.sent {
    color: rgba(255, 255, 255, 0.7);
}

/* Conversation List Styles */
.unread-conversation {
    background-color: var(--unread-bg);
    border-left: 4px solid var(--accent-color);
}

/* Empty State Styles */
.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
}

.chat-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

/* Message Input Styles */
.chat-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--card-header);
}

/* New container for the entire input area */
.message-input-container {
    display: flex;
    position: relative;
    align-items: center; /* Change from flex-end to center */
}

/* Container for the textarea */
.textarea-container {
    flex-grow: 1;
    position: relative;
}

/* Container for the send button */
.send-button-container {
    margin-left: 0.5rem;
    display: flex;
    align-items: flex-end;
}

/* Textarea styling */
.chat-footer .form-control {
    border-radius: 1.5rem;
    padding: 0.75rem 1.2rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    resize: none;
    max-height: 150px;
    overflow-y: auto;
    width: 100%;
    overflow-y: hidden; /* Hide scrollbar when not needed */
}

.chat-footer .form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(93, 63, 211, 0.25);
}

/* Button styling */
.chat-footer .btn {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.chat-footer .btn:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: scale(1.05);
}

/* Chat Badge Styles */
.chat-badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
    font-size: 0.75rem;
    background-color: var(--accent-color);
}

/* Card Header Styling */
.chat-card .card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--card-header);
}

/* User Search Results */
.user-search-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: var(--card-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.user-search-item:hover {
    background-color: var(--hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.user-search-item img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
    border: 2px solid var(--border-color);
}

/* Chat Animations */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-container {
    animation: messageSlideIn 0.3s ease forwards;
}

/* New Conversation Button */
.new-conversation-btn {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.new-conversation-btn:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Conversation List Item Styling */
.conversation-item {
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    padding: 0.75rem 1rem;
}

.conversation-item:hover {
    background-color: var(--hover-bg);
}

.unread-conversation {
    background-color: var(--unread-bg);
    border-left: 4px solid var(--accent-color);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .chat-card {
        height: calc(94vh - 120px);
        margin: -1rem;
    }

    .message {
        max-width: 85%;
    }
}