/* Chat Container */
.chat-container {
    display: flex;
    height: calc(100vh - 300px);
    min-height: 500px;
    background: #fff;
}

/* Chat List */
.chat-list {
    width: 300px;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.main-content-left-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.main-chat-list-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.main-chat-list {
    height: 100%;
    overflow-y: auto;
    padding: 0;
}

/* Customize scrollbar for chat list */
.main-chat-list::-webkit-scrollbar {
    width: 6px;
}

.main-chat-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.main-chat-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.main-chat-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Chat list items */
.main-chat-list .media {
    padding: 12px;
    margin: 0;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.main-chat-list .media.selected {
    background-color: var(--primary005) !important;
}

/* Search box */
.main-content-left .p-4.border-bottom {
    flex-shrink: 0;
    background: #fff;
    position: relative;
    z-index: 1;
}

.chat-users {
    flex: 1;
    overflow-y: auto;
}

.chat-user {
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-user:hover {
    background-color: #f8f9fa;
}

.chat-user.active {
    background-color: #f0f2f5;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.main-chat-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: calc(100vh - 400px);
    background-color: white;
}

.content-inner {
    padding: 20px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    background-color: #f8f9fa;
}

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

.chat-message.admin {
    justify-content: flex-end;
}

.message-content {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-message.admin .message-content {
    background-color: #e3f2fd;
}

.message-time {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.message-file {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.message-file a {
    color: #1a73e8;
    text-decoration: none;
}

.message-file i {
    margin-right: 0.5rem;
}

/* No Chat Selected */
.no-chat-selected {
    color: #6c757d;
}

.no-chat-selected i {
    font-size: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-list {
        width: 100%;
        display: block;
    }

    .chat-area {
        display: none;
    }

    .chat-container.show-chat {
        .chat-list {
            display: none;
        }

        .chat-area {
            display: flex;
        }
    }
}

/* Typing indicator */
.typing {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 5px 10px;
}

.typing .dot {
    width: 8px;
    height: 8px;
    background-color: #90949c;
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}

.typing .dot:nth-child(1) {
    animation-delay: 0s;
}

.typing .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.5);
    }
}