 /* Modern WhatsApp-like Chat UI */
.dmvc-chat-holder {
  position: relative;
  display: inline-block;
}

/* Chat Button */
.dmvc-chat-btn {
  background: linear-gradient(135deg, #28a745, #28a745);
  color: #fff;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 500;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
margin-bottom:15px;
}
.dmvc-chat-btn:hover {
 background: linear-gradient(135deg, #28a745, #28a745);
  transform: translateY(-2px);
}

/* Chat Box */
.dmvc-chat-box {
  width: 30%;
  max-width: 90vw;
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #e5ddd5 url("https://www.transparenttextures.com/patterns/dust.png");
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  overflow: hidden;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", Roboto, sans-serif;
}

/* Header */
.dmvc-chat-header {
  padding: 12px 16px;
  background: #075e54;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dmvc-chat-header .dmvc-chat-title {
  font-weight: 600;
  font-size: 15px;
}
.dmvc-chat-header .dmvc-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: 0.2s;
}
.dmvc-chat-header .dmvc-close:hover {
  opacity: 0.8;
}

/* Messages Area */
.dmvc-chat-messages {
  padding: 12px;
  height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
}
.dmvc-chat-messages::-webkit-scrollbar {
  width: 5px;
}
.dmvc-chat-messages::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

/* Message Bubbles */
.dmvc-msg {
  max-width: 75%;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sent Message (right) */
.dmvc-msg-sent {
  align-self: flex-end;
  text-align: right;
}
.dmvc-msg-sent .dmvc-msg-body {
  background: #dcf8c6;
  color: #222;
  border-radius: 8px 8px 0 8px;
  padding: 8px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Received Message (left) */
.dmvc-msg-recv {
  align-self: flex-start;
}
.dmvc-msg-recv .dmvc-msg-body {
  background: #fff;
  border-radius: 8px 8px 8px 0;
  padding: 8px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Timestamp */
.dmvc-msg-time {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

/* Input Section */
.dmvc-chat-input {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: #f0f0f0;
  border-top: 1px solid #ddd;
  gap: 6px;
}
.dmvc-chat-input input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid #ccc;
  outline: none;
  font-size: 14px;
  transition: all 0.2s;
}
.dmvc-chat-input input:focus {
  border-color: #00bfa5;
  background: #fff;
}
.dmvc-send-btn {
  background:#28a745;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
}
.dmvc-send-btn:hover {
  background: #28a745;
  transform: scale(1.05);
}

/* Vendor Inbox Styles */
.dmvc-inbox-wrap {
  max-width: 1100px;
  margin: 20px auto;
  background: #f7f9fa;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.dmvc-inbox-columns {
  display: flex;
  gap: 16px;
}

/* Threads */
.dmvc-threads-list {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: auto;
  max-height: 600px;
}
.dmvc-thread-item {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f1f1;
  cursor: pointer;
  transition: 0.2s;
}
.dmvc-thread-item:hover {
  background: #e9fef9;
}
.dmvc-thread-item-title {
  font-weight: 600;
  color: #075e54;
}
.dmvc-thread-item-msg {
  font-size: 13px;
  color: #555;
  margin: 4px 0;
}
.dmvc-thread-item-time {
  font-size: 11px;
  color: #888;
}

/* Chat Window for Vendors */
.dmvc-thread-window {
  display: flex;
  flex-direction: column;
  background: #e5ddd5;
  border-radius: 10px;
  overflow: hidden;
  flex: 1;
}
.dmvc-thread-header {
  background: #075e54;
  color: #fff;
  padding: 12px 14px;
  font-weight: 600;
}
.dmvc-thread-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background: #e5ddd5;
}
.dmvc-thread-input {
  display: flex;
  padding: 10px;
  background: #f0f0f0;
  border-top: 1px solid #ddd;
  gap: 8px;
}
.dmvc-thread-input input {
  flex: 1;
  border-radius: 20px;
  border: 1px solid #ccc;
  padding: 8px 12px;
  outline: none;
}
.dmvc-thread-send-btn {
  background: #00bfa5;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: 0.3s;
}
.dmvc-thread-send-btn:hover {
  background: #009688;
  transform: scale(1.05);
}

.dmvc-thread-messages {
    height: calc(100vh - 250px); /* adjustable */
    overflow-y: auto;
}
.dmvc-login-required {
    background: #999;
    cursor: pointer;
    opacity: 0.85;
}
.dmvc-login-required:hover {
    background: #777;
}
/* =============================
   📱 Mobile Responsive Fixes
   ============================= */
@media screen and (max-width: 768px) {

  /* Popup chat box (Buyer side) */
  .dmvc-chat-box {
    width: 90%;
    right: 5%;
    bottom: 10px;
    border-radius: 12px;
  }

  .dmvc-chat-header {
    padding: 10px;
    font-size: 14px;
  }

  .dmvc-chat-messages {
    height: 60vh; /* adaptive height */
    padding: 10px;
  }

  .dmvc-msg-body {
    font-size: 13px;
    padding: 7px 10px;
  }

  .dmvc-chat-input {
    padding: 8px;
    gap: 4px;
  }

  .dmvc-chat-input input {
    font-size: 13px;
    padding: 7px 10px;
  }

  .dmvc-send-btn {
    font-size: 14px;
    padding: 8px 10px;
  }

  /* Vendor Inbox */
  .dmvc-inbox-wrap {
    padding: 10px;
    margin: 10px auto;
  }

  .dmvc-inbox-columns {
    flex-direction: column;
  }

  .dmvc-threads-list {
    max-height: 40vh;
    border-radius: 8px;
  }

  .dmvc-thread-window {
    margin-top: 10px;
    border-radius: 8px;
  }

  .dmvc-thread-header {
    font-size: 14px;
    padding: 10px;
  }

  .dmvc-thread-messages {
    height: 45vh;
    padding: 10px;
  }

  .dmvc-thread-input {
    padding: 8px;
    gap: 6px;
  }

  .dmvc-thread-input input {
    padding: 7px 10px;
    font-size: 13px;
  }

  .dmvc-thread-send-btn {
    font-size: 14px;
    padding: 8px 10px;
  }

  /* Better scroll control */
  .dmvc-thread-messages,
  .dmvc-chat-messages {
    -webkit-overflow-scrolling: touch;
  }
}

/* Ultra small devices */
@media screen and (max-width: 400px) {
  .dmvc-chat-box {
    width: 95%;
    right: 2.5%;
  }

  .dmvc-thread-messages {
    height: 50vh;
  }

  .dmvc-chat-header .dmvc-chat-title {
    font-size: 13px;
  }
}