/* Basic fonts */
body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

/* Floating chat button */
.chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #0b4aa2;
  color: #fff;
  font-size: 22px;
  width: 60px;
  height: 60px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1100;
  box-shadow: 0 14px 34px rgba(5, 32, 74, 0.24);
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.chat-button-ring {
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.chat-button:hover {
  transform: scale(1.06);
  background: #083d87;
  box-shadow: 0 18px 42px rgba(5, 32, 74, 0.3);
}

/* Chat window (hidden by default) */
.chat-window {
  position: fixed;
  bottom: 18px;
  right: 20px;
  width: min(420px, calc(100vw - 32px));
  height: min(660px, calc(100vh - 116px));
  background: #f7f9fd;
  border-radius: 12px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1100;
  border: 1px solid rgba(8, 47, 96, 0.12);
  box-shadow: 0 24px 60px rgba(8, 20, 38, .2);
  transition: transform .22s ease, opacity .22s ease;
}

/* Header */
.chat-header {
  background:
    linear-gradient(135deg, rgba(16, 92, 182, 0.12), transparent 38%),
    #07346f;
  color: #fff;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 88px;
}

.chat-header-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.chat-header-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.chat-header-title {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.chat-header-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.82rem;
  line-height: 1.2;
}

.chat-header-status-dot,
.support-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f6bf45;
  box-shadow: 0 0 0 4px rgba(246, 191, 69, 0.18);
  flex-shrink: 0;
}

.support-status-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  border: 2px solid #07346f;
  height: 14px;
  width: 14px;
}

.chat-header-status.is-online .chat-header-status-dot,
.support-status-dot.is-online {
  background: #28c76f;
  box-shadow: 0 0 0 3px rgba(40, 199, 111, 0.18);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chat-header-btn {
  min-width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  transition: background-color .16s ease, border-color .16s ease;
}

.chat-header-btn:hover,
.chat-header-btn:focus {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.26);
}

.chat-header-btn-danger {
  border-color: rgba(255, 179, 184, 0.3);
  color: #ffe3e6;
}

.chat-helper-banner {
  margin: 14px 16px 0;
  background: #fff7df;
  color: #76530a;
  border: 1px solid rgba(230, 176, 54, 0.42);
  border-radius: 6px;
  padding: 10px 13px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.chatSend {
  align-items: center;
  background: #0b4aa2;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  display: inline-flex;
  height: 52px;
  justify-content: center;
  min-width: 56px;
  width: 56px;
  transition: background-color .16s ease, transform .16s ease;
}

.chatSend:hover,
.chatSend:focus {
  background: #083d87;
  color: #fff;
  transform: translateY(-1px);
}

.chat-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.17);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
}

/* Message area #f2f2f4 */ 
.chat-messages {
  flex: 1;
  overflow-y: auto;
  background: #f3f6fb;
  padding: 16px !important;
  padding-bottom: 10px !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-messages-inbox {
  flex: 1;
  overflow-y: auto;
  background: #F7F6FB;  
  padding-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

/* Bubble base */
.chat-bubble {
  width: fit-content;
  max-width: 82%;
  min-width: 96px;
  padding: 13px 15px 11px;
  border-radius: 10px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  font-size: 0.96rem;
  line-height: 1.42;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.08);
  opacity: 0;
  transform: translateY(6px);
  transition: all .16s ease;
}

.chat-bubble-text {
  float: none;
}

#miniChat .chat-messages > .chat-bubble + .chat-bubble {
  margin-top: 12px;
}

/* Self (you) bubble */
#miniChat .chat-messages > .chat-bubble.self {
  align-self: flex-end !important;
  margin-left: auto !important;
  margin-right: 0 !important;
  background: #0b4aa2;
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* imagePreview */
.imagePreview {
  align-self: flex-end;
  margin-top: 12px;
  background: linear-gradient(125deg, #d8e7ef, #f2f2f4);
  /* background: linear-gradient(135deg, #c7dde7d4, #f2f2f4); */
  /* background: #c4e7bcd4; */
  /* color: #F7F6FB; */
  /* border-bottom-right-radius: 6px;  */
  /* position: relative; */
  width: 150px;
  height: 150px;
  
}
.imagePreview img {
  width: 150px;
  height: 150px;
  object-fit: cover;
}
/* #A6B6ED, #7790E4, #4C6EDC, #284DC8, #1F3D9E */

/* Other bubble */
#miniChat .chat-messages > .chat-bubble.other {
  align-self: flex-start !important;
  margin-left: 0 !important;
  margin-right: auto !important;
  background: #ffffff;
  color: #162033;
  border: 1px solid rgba(216, 223, 235, 0.8);
  border-bottom-left-radius: 4px;
}

#miniChat .chat-messages > .chat-bubble.other + .chat-bubble.self,
#miniChat .chat-messages > .chat-bubble.self + .chat-bubble.other {
  margin-top: 16px;
}

/* after insert, show animation */
.chat-bubble.show {
  opacity: 1;
  transform: translateY(0);
}

/* Timestamp */
.timestamp {
  display: block;
  font-size: 12px;
  opacity: .68;
  margin-top: 8px;
  text-align: right;
}

/* Input area */
#miniChat .chat-input {
  background: #ffffff;
  border-color: #e1e7f0 !important;
  padding: 14px 16px 16px !important;
  gap: 9px;
  align-items: center;
}

.chat-composer-hint {
  background: #f3f6fb;
  border-top: 1px solid rgba(216, 223, 235, 0.72);
  padding: 10px 16px 4px;
  font-size: 0.82rem;
  color: #5d6b82;
}

#miniChat .chat-input input.form-control {
  height: 52px;
  border-radius: 8px;
  padding: 12px 15px;
  border: 1px solid #d8dfeb;
  box-shadow: none;
  background: #fbfcff;
  color: #162033;
  font-size: 0.95rem;
  min-width: 0;
}

#miniChat .chat-input input.form-control:focus {
  background: #fff;
  border-color: #8ab6ef;
  box-shadow: 0 0 0 0.18rem rgba(11, 74, 162, 0.12);
}

#miniChat .chat-upload-btn {
  width: 48px;
  min-width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid #d8dfeb;
  color: #0b4aa2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Typing indicator - three bouncing dots */
.typing-indicator {
  background: transparent;
  display: flex;
  align-items: center;
  padding-top: 0 !important;
}

.typing-dots {
  display: inline-flex;
  gap: 6px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: #8290a6;
  border-radius: 50%;
  display: inline-block;
  transform: translateY(0);
  animation: bounce 1s infinite;
}

.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.12s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes bounce {
  0% {
    transform: translateY(0);
    opacity: .6;
  }

  35% {
    transform: translateY(-6px);
    opacity: 1;
  }

  70% {
    transform: translateY(0);
    opacity: .8;
  }

  100% {
    transform: translateY(0);
    opacity: .6;
  }
}

/* Scrollbar (thin & subtle) */
.chat-messages::-webkit-scrollbar {
  width: 7px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
}

@media (max-width: 576px) {
  .chat-window {
    border-radius: 10px;
    bottom: 10px;
    height: min(620px, calc(100vh - 24px));
    left: 10px;
    max-height: none;
    right: 10px;
    width: auto;
  }

  .chat-header {
    min-height: 82px;
    padding: 14px;
  }

  .chat-avatar {
    height: 46px;
    width: 46px;
  }

  .chat-header-title {
    font-size: 1rem;
  }

  .chat-header-status {
    font-size: 0.78rem;
  }

  .chat-header-actions {
    gap: 6px;
  }

  .chat-header-btn {
    border-radius: 8px;
    height: 38px;
    min-width: 38px;
  }

  .chat-helper-banner {
    margin-left: 12px;
    margin-right: 12px;
  }

  #miniChat .chat-messages {
    padding: 14px 12px !important;
  }

  .chat-bubble {
    max-width: 86%;
  }

  .chat-composer-hint {
    padding-left: 12px;
    padding-right: 12px;
  }

  #miniChat .chat-input {
    padding: 12px !important;
  }

  #miniChat .chat-input input.form-control {
    font-size: 0.92rem;
    padding-left: 12px;
    padding-right: 12px;
  }

  .chatSend {
    border-radius: 8px;
    height: 52px;
    min-width: 54px;
    width: 54px;
  }
}


/* left left left side*/
/* Bubble base */
.chat-bubble-left {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 18px;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.25;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  opacity: 0;
  transform: translateY(6px);
  transition: all .16s ease;
}


 .my-button-style {
      background-color: #128C7E;
      color: white;
      padding: 10px 20px;
      border: none;
      cursor: pointer;
    }


.file-upload-container {
  font-family: sans-serif;
  margin-bottom: 20px;
}

.file-input-label {
  display: inline-block;
  padding: 10px 20px;
  background-color: #007bff;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.file-input-label:hover {
  background-color: #0056b3;
}

.image-previews-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  /* border: 2px dashed #ccc; */
  /* padding: 15px; */
  /* min-height: 100px; */
  align-items: center;
  justify-content: center;
  color: #888;
  font-family: sans-serif;
}

/* .image-previews-container:empty:before {
  /* content: "No images selected"; */
/* } */ 

.image-preview {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.delete-button {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(13, 13, 13, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.delete-button:hover {
  background-color: rgb(9, 9, 9);
}    
