/* Live Chat Widget Styles */

/* Reset and base styles.
   :where() keeps the reset at zero specificity — a bare #id selector outranks
   every .livechat-* class rule below, so `all: initial` would silently undo
   position:fixed/bottom/right and the button lands in the page flow instead
   of floating. */
:where(#livechat-button, #livechat-window) {
  all: initial;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  box-sizing: border-box;
  z-index: 999999;
}

:where(#livechat-button, #livechat-window) * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Chat Button */
.livechat-button {
  position: fixed;
  bottom: 20px;
  z-index: 999999;

  /* Starts hidden and arrives once the page has loaded (ChatButton.revealWhenPageIsReady).
     The overshoot in the easing is the bounce: the curve passes 1 and settles back. */
  opacity: 0;
  transform: scale(0.4) translateY(12px);
  transition: opacity 0.24s ease-out, transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.livechat-button-revealed {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.livechat-button-right {
  right: 20px;
}

.livechat-button-left {
  left: 20px;
}

.livechat-button-main {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background-color: #1f93ff;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.livechat-button-main:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.livechat-button-icon {
  width: 28px;
  height: 28px;
}

.livechat-button-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: #ef4444;
  color: white;
  border-radius: 12px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Chat Window */
.livechat-window {
  position: fixed;
  bottom: 90px;
  z-index: 999998;
  width: 380px;
  max-width: calc(100vw - 40px);

  /* Open and close animate; `display` is still what shows and hides it, so ChatWindow.hide()
     waits out the 200ms below before setting display:none. The origin is the bottom corner
     nearest the launcher, so the panel grows out of the button rather than from its middle. */
  opacity: 0;
  transform: scale(0.94) translateY(12px);
  transform-origin: bottom right;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.livechat-window-open {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* `all: initial` in the reset resets `direction` too, and an author declaration beats the UA
   rule that `dir="rtl"` relies on — so the attribute alone would not survive. Restate it. */
.livechat-window[dir='rtl'],
.livechat-button[dir='rtl'] {
  direction: rtl;
}

.livechat-window-right {
  right: 20px;
}

.livechat-window-left {
  left: 20px;
  /* Grow out of the launcher, which is on the other side in this position. */
  transform-origin: bottom left;
}

.livechat-window-wrapper {
  background: #f8fafc;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  height: 500px;
  max-height: calc(100vh - 120px);
  overflow: hidden;
}

/* Header */
.livechat-header {
  background-color: #1f93ff;
  color: white;
  padding: 16px;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}

.livechat-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.livechat-header-info {
  flex: 1;
}

.livechat-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.livechat-company-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.livechat-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
}

.livechat-status-offline {
  background-color: #6b7280;
}

.livechat-reply-time {
  font-size: 12px;
  opacity: 0.9;
}

.livechat-close-button {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.livechat-close-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Window Body */
.livechat-window-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8fafc;
}

/* Pre-chat Form */
.livechat-prechat-form {
  display: flex;
  flex-direction: column;
  padding: 16px;
  height: 100%;
}

.livechat-prechat-content {
  display: flex;
  flex-direction: column;
}

.livechat-welcome-card {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.livechat-welcome-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.livechat-welcome-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
}

.livechat-welcome-subtitle {
  font-size: 12px;
  color: #64748b;
}

.livechat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: #ffe0bb;
  color: #99543a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.livechat-start-button {
  background: transparent;
  border: none;
  color: #1f93ff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  margin: -8px;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.livechat-start-button:hover {
  background-color: rgba(31, 147, 255, 0.05);
}

/* Messages */
.livechat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.livechat-messages::-webkit-scrollbar {
  width: 6px;
}

.livechat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.livechat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.livechat-message {
  display: flex;
  margin-bottom: 4px;
}

.livechat-message-visitor {
  justify-content: flex-end;
}

.livechat-message-agent {
  justify-content: flex-start;
}

.livechat-message-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.livechat-message-visitor .livechat-message-bubble {
  background-color: #1f93ff;
  color: white;
  border-bottom-right-radius: 4px;
}

.livechat-message-agent .livechat-message-bubble {
  background-color: white;
  color: #1e293b;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.livechat-message-text {
  margin: 0;
}

/* Typing Indicator */
.livechat-typing-indicator {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: white;
  border-radius: 20px;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  width: fit-content;
}

.livechat-typing-dots {
  display: flex;
  gap: 4px;
}

.livechat-typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #94a3b8;
  animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Input Container */
.livechat-input-container {
  padding: 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
  /* The anchor the emoji picker positions against. */
  position: relative;
}

/* Emoji picker — opens upward, over the transcript, because the input is at the bottom. */
.livechat-emoji-picker {
  position: absolute;
  bottom: calc(100% - 8px);
  right: 16px;
  left: 16px;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  max-height: 180px;
  overflow-y: auto;
  padding: 8px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

/* The reset above is :where(), so `hidden` needs to beat `display: grid` explicitly. */
.livechat-emoji-picker[hidden] {
  display: none;
}

.livechat-emoji-option {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  font-size: 20px;
  line-height: 1.4;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.livechat-emoji-option:hover,
.livechat-emoji-option:focus-visible {
  background-color: #f1f5f9;
}

.livechat-input-wrapper {
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  transition: border-color 0.2s;
}

.livechat-input-wrapper:focus-within {
  border-color: #1f93ff;
}

.livechat-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  font-family: inherit;
  color: #1e293b;
  background: transparent;
}

.livechat-input::placeholder {
  color: #94a3b8;
}

.livechat-input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.livechat-emoji-button,
.livechat-send-button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
  color: #64748b;
}

.livechat-emoji-button:hover,
.livechat-send-button:hover {
  background-color: #f1f5f9;
}

.livechat-send-button {
  color: #1f93ff;
}

/* Footer */
.livechat-footer {
  padding: 10px;
  display: flex;
  justify-content: center;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.livechat-branding {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #64748b;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.livechat-branding:hover {
  opacity: 1;
}

/* The whole line is the link; the name carries the weight so it reads as the brand. */
.livechat-branding-name {
  font-weight: 600;
}

.livechat-branding:hover .livechat-branding-name {
  text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .livechat-window {
    width: 100%;
    max-width: 100%;
    bottom: 0;
    left: 0 !important;
    right: 0 !important;
  }

  .livechat-window-wrapper {
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .livechat-header {
    border-radius: 0;
  }

  .livechat-button {
    bottom: 16px;
  }

  .livechat-button-right {
    right: 16px;
  }

  .livechat-button-left {
    left: 16px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .livechat-window-wrapper {
    background: #1e293b;
  }

  .livechat-window-body {
    background: #1e293b;
  }

  .livechat-welcome-card {
    background: #334155;
  }

  .livechat-welcome-title {
    color: #f1f5f9;
  }

  .livechat-message-agent .livechat-message-bubble {
    background: #334155;
    color: #f1f5f9;
  }

  .livechat-input-wrapper {
    background: #334155;
    border-color: #475569;
  }

  .livechat-input {
    color: #f1f5f9;
  }

  .livechat-input::placeholder {
    color: #64748b;
  }

  .livechat-input-container {
    background: #1e293b;
    border-top-color: #334155;
  }

  .livechat-emoji-picker {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }

  .livechat-emoji-option:hover,
  .livechat-emoji-option:focus-visible {
    background-color: #334155;
  }

  .livechat-footer {
    background: #1e293b;
    border-top-color: #334155;
  }
}

/* Someone who has asked their OS for less motion should still get the widget, just without
   the bounce and the slide. Kept to the properties this file animates rather than a blanket
   `* { animation: none }`, so the hover and colour transitions above survive. */
@media (prefers-reduced-motion: reduce) {
  .livechat-button,
  .livechat-window {
    transition: opacity 0.01ms;
    transform: none;
  }

  .livechat-button-revealed,
  .livechat-window-open {
    transform: none;
  }
}


/*# sourceMappingURL=livechat.min.css.map*/