.chat-container {
    display: flex;
    max-width: 1200px;
    margin: 30px auto 50px auto; /* <--- TAMBAH space bawah 50px */
    width: 100%;
    height: 90vh; /* lebih tinggi */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background: white;
}
/* USER LIST */
.user-list {
    width: 30%;
    background-color: #ffffff;
    border-right: 1px solid #ddd;
    padding: 15px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 12px;
    margin-bottom: 15px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s;
    background-color: #fff;
}

.user-item:hover {
    background-color: #f7f7f7;
}

.user-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 12px;
}

.user-item .product-name {
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: bold;
}

.user-item .last-chat {
    font-size: 13px;
    color: #777;
}

.user-item .chat-time {
    font-size: 12px;
    color: #555;
}

.user-item .last-time {
    margin-left: auto;
    font-size: 12px;
    color: #888;
}

/* CHAT AREA */
.chat-area {
    width: 70%;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #ddd;
    position: relative;
    height: 100%;
}

/* MESSAGES */
.messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message.sent {
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    max-width: 80%;
    align-self: flex-end;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.message.received {
    background-color: #e0e0e0;
    color: #333;
    padding: 10px 15px;
    border-radius: 20px;
    max-width: 80%;
    align-self: flex-start;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.message.sent::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 10px;
    border-width: 10px;
    border-style: solid;
    border-color: #4CAF50 transparent transparent transparent;
}

.message.received::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 10px;
    border-width: 10px;
    border-style: solid;
    border-color: #e0e0e0 transparent transparent transparent;
}
/* Input tetap di bawah */
.message-input {
    background-color: #fff;
    padding: 15px;
    display: flex;
    align-items: center;
    border-top: 1px solid #ddd;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
}

.message-input textarea {
    flex: 1;
    height: 45px;
    resize: none;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-right: 10px;
    font-size: 14px;
}

.message-input textarea:focus {
    border-color: #007BFF;
    outline: none;
}

.message-input button {
    width: 45px;
    height: 45px;
    background-color: #007BFF;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 18px;
    cursor: pointer;
}


.message-input button:hover {
    background-color: #0056b3;
}

/* VENDOR DETAIL */
.vendor-detail {
    padding: 15px;
      position: relative;
    border-bottom: 1px solid #ddd;
    background: #f7f7f7;
    display: flex;
    align-items: center;
    gap: 15px;
      overflow: visible !important;
      z-index: 20;
}


.vendor-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
}

.vendor-info {
    flex-grow: 1;
}

.product-name {
    font-size: 16px;
    font-weight: bold;
}

.product-description {
    font-size: 12px;
    color: #777;
}

.more-options {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}


.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 10px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 10px;
      z-index: 9999; /* pastikan tinggi */
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    padding: 8px;
    display: block;
}

.dropdown-menu a:hover {
    background-color: #f1f1f1;
}

@media (max-width: 768px) {
    .hide-on-chat-mobile {
        display: none !important;
    }
    .user-list{
        width: 100%;
    }

    .chat-area {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .messages {
        flex-grow: 1;
        overflow-y: auto;
        padding: 15px;
        max-height: calc(100vh - 140px); /* sesuaikan jika vendor detail + input total 140px */
    }

    .message-input {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 100;
        background: white;
        border-top: 1px solid #ddd;
    }
}