body {
  margin: 0;
}

#chatWidget {
  font-family: "Segoe UI", sans-serif;
}

#chatToggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #5e6ed6;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  font-size: 26px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  cursor: pointer;
}

.intercone-chat-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

@keyframes bounce {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }

  100% {
    transform: translateY(0);
  }
}

#chatToggleBadge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 11px;
  background: #dc3545;
  color: white;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: bold;
  min-width: 18px;
  text-align: center;
  line-height: 1;
  display: none;
  animation: bounce 0.5s ease-in-out;
}

#chatIcon {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 26px;
  line-height: 1;
}

/* Custom button styles for contact quick replies */
.intercone-btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.intercone-btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: 0.2rem;
}

.intercone-btn-outline-primary {
  color: #007bff;
  border-color: #007bff;
  background-color: transparent;
}

.intercone-btn-outline-primary:hover {
  color: #fff;
  background-color: #007bff;
  border-color: #007bff;
}

.intercone-btn-outline-primary:focus {
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.intercone-btn-outline-secondary {
  color: #6c757d;
  border-color: #6c757d;
  background-color: transparent;
}

.intercone-btn-outline-secondary:hover {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

.intercone-btn-outline-secondary:focus {
  box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

/* Chat window opening animation */
.intercone-chat-window.animate-in {
  animation: slideUpFade 0.5s ease-out;
}

/* Chat window closing animation */
.intercone-chat-window.animate-out {
  animation: slideDownFade 0.5s ease-in;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDownFade {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(50px);
  }
}

.intercone-chat-window {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 460px;
  max-height: calc(100vh - 120px);
  height: 620px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
}

.intercone-chat-window.animate {
  animation: slideUpFade 0.5s ease-out;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1000px) {
  .intercone-chat-window {
    width: 95vw;
    left: 2.5%;
    right: auto;
    max-height: calc(100vh - 120px);
    height: 620px;
  }
}

.intercone-chat-header {
  background: #fff;
  color: #333;
  padding: 16px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.intercone-chat-body {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.intercone-chat-footer {
  padding: 10px;
  background: white;
  display: flex;
  align-items: center;
}

.intercone-chat-input {
  flex: 1;
  padding: 14px 14px;
  outline: none;
  font-size: 14px;
  border: none;
  border-radius: 20px;
  background-color: #EBEBEB;
  color: #5E6261;
}

.intercone-send-btn {
  background: linear-gradient(90deg, #2980B9, #9B59B6, #85C1E9);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  border: none;
  margin-left: 8px;
  font-size: 23px;
  cursor: pointer;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.intercone-message {
  padding: 10px 14px;
  border-radius: 20px;
  max-width: 90%;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
  box-sizing: content-box !important;
  animation: fadeIn 0.5s ease-in;
}

.intercone-message.received {
  animation: fadeIn 0.25s ease-in 0.05s;
}

.intercone-message-wrapper {
  animation: fadeIn 0.3s ease-in;
}

.intercone-sent {
  background: #EBEBEB;
  color: #333;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.intercone-message-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.intercone-message-wrapper.sent-wrapper {
  justify-content: flex-end;
  align-items: flex-end;
  gap: 8px;
}

.intercone-message-wrapper.sent-wrapper .intercone-avatar {
  transform: translateY(-10px);
}

.intercone-message-wrapper.received-wrapper .intercone-avatar {
  transform: translateY(-10px);
}

.intercone-message.received {
  background-color: #fff;
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
  color: black;
  border-radius: 16px 16px 16px 4px;
  padding: 10px 14px;
  max-width: 90%;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
  white-space: normal;
  font-weight: 400;
}

/* Styling for clickable links in messages */
.intercone-message a {
  color: #007bff;
  text-decoration: underline;
  word-break: break-all;
  transition: color 0.2s ease;
}

.intercone-message a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.intercone-message a:visited {
  color: #6f42c1;
}

.intercone-message a:active {
  color: #e83e8c;
}

.intercone-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  align-self: flex-end;
}

.intercone-quick-replies {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.intercone-quick-reply {
  background-color: #ffffff;
  color: #2948ff;
  border: none;
  padding: 10px 16px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  max-width: 80%;
  text-align: left;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: background 0.2s ease;
}

.intercone-quick-reply:hover {
  background: #2948ff;
  color: white;
}

.intercone-typing-indicator {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  height: 20px;
  padding: 10px 14px;
  border-radius: 20px;
  background: #03a84e;
  color: black;
  max-width: 90%;
}

.intercone-typing-indicator span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: black;
  border-radius: 50%;
  animation: blink 1.4s infinite both;
}

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

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

.intercone-typing-avatar {
  transform: translateY(50px);
}

.intercone-start-chat-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  font-family: "Segoe UI", sans-serif;
  cursor: pointer;
  width: 95%;
  margin: 10px;
  border: none;
}

.intercone-start-chat-box .title {
  font-weight: 600;
  font-size: 16px;
  color: black;
}

.intercone-start-chat-box .subtitle {
  font-size: 13px;
  color: #777;
  margin-top: 2px;
}

.intercone-start-chat-box i {
  font-size: 20px;
  color: #5e6ed6;
}

.intercone-start-chat-box .text-wrapper {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.intercone-recent-messages-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  width: 100%;
}

.intercone-recent-message-box {
  background-color: white;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  color: #333;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
  max-width: 100%;
}

.intercone-recent-message-box:hover {
  background-color: #f2f4ff;
}

.intercone-recent-message-box {
  display: flex;
  flex-direction: column;
  background-color: white;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: background 0.2s ease;
}

.intercone-bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: white;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.1);
}

.intercone-nav-item {
  font-size: 24px;
  color: #888;
  cursor: pointer;
}

.intercone-nav-item.active {
  color: #03a84e;
}

#welcomePanel::-webkit-scrollbar {
  width: 6px;
}

#welcomePanel::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

.intercone-chat-unread-badge {
  position: absolute;
  top: 2px;
  right: 6px;
  background: #dc3545;
  color: white;
  font-size: 11px;
  font-weight: bold;
  border-radius: 999px;
  padding: 2px 6px;
}

.intercone-system-message {
  background-color: #ffe0b2;
  color: #8d5c00;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  text-align: center;
  margin: 10px auto;
  max-width: 80%;
  opacity: 1;
  transition: opacity 0.5s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.intercone-system-message.fade-out {
  opacity: 0;
}

/* Styling for clickable links in system messages */
.intercone-system-message a {
  color: #007bff;
  text-decoration: underline;
  word-break: break-all;
  transition: color 0.2s ease;
}

.intercone-system-message a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.intercone-system-message a:visited {
  color: #6f42c1;
}

.intercone-system-message a:active {
  color: #e83e8c;
}

.intercone-message-time {
  font-size: 11px;
  margin-top: 4px;
  color: #888;
}

@keyframes blink {
  0%, 80%, 100% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
}
