.mip-chat-window {
  overflow: visible;
}

.mip-chat-body {
  overflow: visible;
}

.bubble::after {
  position: fixed; /* ⬅️ THIS is the trick */
}


.mip-no-messages {
  text-align: center;
  color: #666;
  font-weight:600;
  padding: 20px;
  font-size: 14px;
}


#mip-chat-button.has-new-message {
    background-color: #ff4d4d;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
#mip-chat-toast {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 80px;
    background: #fff;
    border: 1px solid #ccc;
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
    z-index: 9999;
    max-width: 260px;
    font-size: 14px;
}
.mip-toast-avatar {
    float: left;
    margin-right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.mip-toast-content {
    overflow: hidden;
}
.mip-chat-toast-msg {
   display: block;
    font-size: 13px;
    line-height: 19px !important; 
    padding-top:15px !important;

}
.mip-toast-view {
    display: block;
    margin-top: 5px;
    color: #0073aa;
    text-decoration: underline;
    cursor: pointer;
}
.mip-chat-popup {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 300px;
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
  border-radius: 8px;
  z-index: 9999;
}
#mip-chat-minimized {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #0073aa;
  color: #fff;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 9998;
}
#mip-chat-minimized .reopen-chat {
  font-weight: bold;
  margin-left: 10px;
  text-decoration: underline;
}

.mip-chat-window {
  position: relative;
  width: 325px;
  height: 500px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}


.mip-chat-header {
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 8px 12px;
  border-radius:20px 20px 0px 0px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
padding: 5px;
 gap: 10px;
  position: relative; /* Needed for internal positioning */
    overflow: visible;  /* Let tooltips overflow */
    z-index: 10;
}

.mip-chat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.mip-chat-title {
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
    margin: 0;
    padding-top:10px !important;
    padding: 0;

    /* Let it expand, but still allow space for controls */
    flex-grow: 1;
}
.mip-chat-title-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.mip-chat-title strong {
    font-weight: bold;
}

.mip-chat-status {
    font-size: 12px !important;
    font-weight:400 !important;
    color: #65676B;
    margin-top:5px !important;
}

.mip-chat-controls span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: normal; /* <== Ensure buttons don't inherit bold */
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    position: relative;
    margin-left: 4px;

}

.mip-chat-controls span:hover {
    background-color: #e4e6eb; /* Light gray like Facebook */
    color: #000;
}

.mip-chat-controls i {
    pointer-events: none; /* So clicks go to the span */
    font-size: 20px;
}

/* Tooltip styling */
.tooltip-hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px); /* Positions the tooltip above the element */
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 9999; /* Ensures the tooltip appears above other elements */
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.tooltip-hover:hover::after {
    opacity: 1;
}

.mip-chat-body {
  flex: 1;
  padding: 10px;
  overflow-y: auto; /* ✅ Keeps the scroll */
  overflow-x: visible; /* ✅ Allows tooltips to overflow horizontally */
  position: relative;  /* ✅ Needed for child tooltip positioning */
  z-index: 1;


}
.mip-form-block {
  border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 10px;
    background: #fff;
}
.mip-chat-form {
    display: flex;
    border-radius:30px;
    padding: 8px;
    background: #e9e9e9;
}

.mip-chat-form textarea {
    flex: 1;
    padding: 8px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    resize: none;
    overflow: hidden;
    min-height: 34px;
    max-height: 120px; /* optional limit */
    line-height: 18px;
    border-radius: 20px;
}



.mip-chat-form input {
    flex: 1;
    padding: 8px;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: 14px;
    box-shadow: none !important;
}

/* Optional: Add placeholder style */
.mip-chat-form input::placeholder {
    color: #aaa;

}


/* Also kill browser default blue shadow in Safari/Chrome */
.mip-chat-form input:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}
.mip-chat-form input:-webkit-autofill {
    box-shadow: 0 0 0px 1000px #e9e9e9 inset !important;
    -webkit-text-fill-color: #000 !important;
}





.mip-chat-form button {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  background: #e9e9e9;
  border: none;
  border-radius: 50%; /* makes it a perfect circle */
  color: #1877F2;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  padding: 0;
}


.mip-chat-form button:hover {
  background: #fafafa;
}

.mip-chat-form button i {
  font-size: 16px;
}
#mip-minimized-chats {
  position: fixed;
  bottom: 80px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* ✅ forces all avatars to align RIGHT */
  gap: 10px;
  z-index: 9999;
}

.mip-minimized-chat-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid #0073aa;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
  display: block;
}

.mip-minimized-chat-avatar:hover {
  transform: scale(1.05);
}


.mip-badge {
    background: red;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    position: absolute;
    top: -4px;
    right: -4px;
    display: inline-block;
}



.mip-badge-hidden {
    display: none !important;
}
#mip-chat-windows-container {
   position: fixed;
  bottom: 0;
  right: 80px; /* ✅ Leave space for minimized bubbles */
  display: flex;
  flex-direction: row-reverse; /* ✅ New chats on the right */
  gap: 10px;
  z-index: 9999;
}


.mip-minimized-chat-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  width: auto;
}


.mip-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: red;
  color: white;
  font-size: 11px;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 50%;
  display: inline-block;
}


.mip-badge-hidden {
    display: none;
}






/* Message Bubbles */


.mip-message {
  display: flex;
  margin-bottom: 2px;
  align-items: flex-end;
}

.mip-message .avatar,
.mip-message .avatar-placeholder {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  margin-right: 0px;
}

.avatar-placeholder {
  width: 40px;
  height: 40px;
  visibility: hidden;
}
.mip-message.received {
  justify-content: flex-start;
}

.mip-message.sent {
  justify-content: flex-end;
}

.mip-message.received .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 8px;
}



.bubble small {
  display: block;
  font-size: 11px;
  opacity: 0.6;
  margin-top: 5px;
}
.bubble {
    white-space: pre-line;
}


/* Base bubble styles */
.mip-message .bubble {
  padding: 10px 14px;
  font-size: 14px;
  max-width: 75%;
  line-height: 1.4;
  position: relative;
  display: inline-block;
}

/* SENDER (Your message) */
.mip-message.sent .bubble {
  background: #4C6EF5;
  color: white;
  border-radius: 16px 16px 4px 16px;
}

/* RECEIVER (Their message) */
.mip-message.received .bubble {
  background: #f0f0f0;
  color: #050505;
  border-radius: 16px 16px 4px 16px;
}

/* Solo bubble (default fallback) */
.mip-message.sent.first .bubble {
    border-radius: 16px 16px 4px 16px;
}
.mip-message.sent.middle .bubble {
    border-radius: 16px 4px 4px 16px;
}
.mip-message.sent.last .bubble {
    border-radius: 16px 4px 16px 16px;
}
.mip-message.sent.solo .bubble {
    border-radius: 16px 16px 16px 16px;
}

.mip-message.received.first .bubble {
    border-radius: 16px 16px 16px 4px;
}
.mip-message.received.middle .bubble {
    border-radius: 4px 16px 16px 4px;
}
.mip-message.received.last .bubble {
    border-radius: 4px 16px 16px 16px;
}
.mip-message.received.solo .bubble {
    border-radius: 16px 16px 16px 16px;
}





.mip-date-divider {
    text-align: center;
    font-weight:500;
    font-size: 12px;
    color: #888;
    margin: 15px 0 10px;
    font-style: normal;
    position: relative;
}
.mip-date-divider::before,
.mip-date-divider::after {
    content: "";
    display: inline-block;
    width: 20%;
    height: 1px;
    background: #ccc;
    vertical-align: middle;
    margin: 0 10px;
}


.chat-bubble-tooltip {
    position: absolute;
    background: #242526;
    color: #fff;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
    line-height: 1.4;
      opacity: 1;
}


/* SEEN Indicator */

.mip-seen-indicator {
    margin-top: 4px;
    text-align: right;
    padding-right: 4px;
    position: relative;
}

.mip-seen-avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
    cursor: default;
}



.global-tooltip {
    position: absolute; 
    z-index: 9999; 
    display: none; 
    padding: 6px 10px; 
    background: #333; 
    color: #fff; 
    font-size: 13px; 
    border-radius: 8px; 
    white-space: nowrap; 
    pointer-events: none;
}


 .mip-message-user-btn {
    display: block;
    background-color: #ffdd7e;
    color: #333;
    border: none;
    padding: 20px 20px;
     letter-spacing: 0.1px !important;
    font-family: inherit; 
    font-weight: 700 !important;
    font-size:15px;
    border-radius: 6px;
    cursor: pointer;
    width:100%;
    transition: background-color 0.2s;
    margin-top: 15px;
    color: #333;
}
/* Hover/focus for default */
.mip-message-user-btn:hover,
.mip-message-user-btn:focus {
    background-color: #fcd665;
     font-weight: bold !important;
    color: #222;
}









