/* WooLiveChat v3 frontend widget
   Clean, self-contained, live-chat-only styles.
   No bootstrap-like resets. No legacy FAQ/ticket rules. */

#woolivechat-widget {
  --wlc-accent: #1786e5;
  --wlc-bg: #ffffff;
  --wlc-surface: #f8fafc;
  --wlc-surface-2: #eef2f7;
  --wlc-border: rgba(15, 23, 42, 0.08);
  --wlc-text: #111827;
  --wlc-muted: #667085;
  --wlc-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  position: fixed;
  right: 18px;
  bottom: 24px;
  z-index: 999999;
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  touch-action: auto;
}

#woolivechat-widget *,
#woolivechat-widget *::before,
#woolivechat-widget *::after {
  box-sizing: border-box;
}

.woolivechat-panel[hidden],
.woolivechat-offline[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Trigger */
.woolivechat-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--wlc-accent);
  color: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  font: inherit;
  font-weight: 600;
}

.woolivechat-trigger:focus-visible,
.woolivechat-close:focus-visible,
.woolivechat-form button:focus-visible,
.woolivechat-choice:focus-visible,
.woolivechat-file:focus-visible {
  outline: 2px solid rgba(23, 134, 229, 0.5);
  outline-offset: 2px;
}

.woolivechat-trigger.dragging {
  cursor: grabbing;
}

.woolivechat-trigger-dot {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.22);
}

.woolivechat-trigger-label {
  display: block;
  white-space: nowrap;
}

.woolivechat-trigger.has-image {
  width: 72px;
  height: 72px;
  padding: 12px;
  border-radius: 50%;
  justify-content: center;
  overflow: hidden;
}

.woolivechat-trigger-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.woolivechat-header-avatar {
  padding: 4px;
}

.woolivechat-header-avatar img {
  object-fit: contain;
}



.woolivechat-drag-handle {
  position: absolute;
right: -5px;
  bottom: auto;
height: 29px!important;
  width: 29px!important;
  padding: 0!important;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f1f1;
  color: #333;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  font: 700 13px/1 Inter, Arial, sans-serif;
  letter-spacing: -1px;
}

.woolivechat-drag-handle.dragging {
  cursor: grabbing;
}

.woolivechat-drag-handle:hover {
  background: rgba(17, 24, 39, 1);
}

/* Panel shell */
.woolivechat-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  display: flex;
  flex-direction: column;
  width: 380px;
  max-width: calc(100vw - 16px);
  height: 840px;
  max-height: calc(100dvh - 24px);
  background: var(--wlc-bg);
  border: 1px solid var(--wlc-border);
  border-radius: 22px;
  box-shadow: var(--wlc-shadow);
  overflow: hidden;
  touch-action: auto;
}

/* Header */
.woolivechat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: var(--wlc-bg);
  border-bottom: 1px solid var(--wlc-border);
}

.woolivechat-header-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.woolivechat-header-avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--wlc-surface-2);
  border: 1px solid var(--wlc-border);
}

.woolivechat-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.woolivechat-title {
  margin: 0;
  color: var(--wlc-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.woolivechat-subtitle {
  margin-top: 3px;
  color: var(--wlc-muted);
  font-size: 12px;
}

.woolivechat-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--wlc-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.woolivechat-close:hover {
  background: var(--wlc-surface-2);
  color: var(--wlc-text);
}

/* Messages area */
.woolivechat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #f6f8fb 100%);
}

.woolivechat-row {
  display: flex;
  width: 100%;
  margin-bottom: 12px;
}

.woolivechat-row.support {
  justify-content: flex-start;
}

.woolivechat-row.visitor {
  justify-content: flex-end;
}

.woolivechat-row.system {
  justify-content: center;
}

.woolivechat-row > div {
  min-width: 0;
}

.woolivechat-bubble,
.woolivechat-file {
  display: inline-block;
  max-width: min(82%, 100%);
  padding: 10px 12px;
  border-radius: 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

.woolivechat-bubble {
  background: #fff;
  color: var(--wlc-text);
  border: 1px solid var(--wlc-border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.woolivechat-row.visitor .woolivechat-bubble {
  background: var(--wlc-accent);
  color: #fff;
  border-color: transparent;
}

.woolivechat-row.system .woolivechat-bubble {
  background: var(--wlc-surface-2);
  color: #4b5563;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  font-size: 12px;
}

.woolivechat-meta {
  margin-top: 4px;
  color: var(--wlc-muted);
  font-size: 11px;
}

.woolivechat-row.visitor .woolivechat-meta {
  text-align: right;
  color: #7dbdf3;
}

.woolivechat-file {
  background: transparent;
  color: inherit;
  text-decoration: underline;
  padding-left: 0;
  padding-right: 0;
}

/* Related conversations */
.woolivechat-choice-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(300px, 100%);
}

.woolivechat-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  background: #fff;
  color: var(--wlc-text);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.woolivechat-choice:hover {
  background: #f8fafc;
}

.woolivechat-choice span {
  color: var(--wlc-muted);
  font-size: 11px;
}

.woolivechat-choice.primary {
  border-color: transparent;
  background: var(--wlc-accent);
  color: #fff;
}

.woolivechat-choice.primary span {
  color: #d6eaff;
}

/* Offline state */
.woolivechat-offline {
  padding: 12px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff8e1;
  color: #6b4f00;
}

.woolivechat-offline-status {
  font-weight: 700;
  margin-bottom: 4px;
}

.woolivechat-offline-copy {
  font-size: 13px;
}

.woolivechat-offline-actions {
  margin-top: 8px;
}

.woolivechat-offline a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

/* Composer */
.woolivechat-form {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: var(--wlc-bg);
}

.woolivechat-form textarea {
  position: relative;
  z-index: 4;
  pointer-events: auto;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 42px;
  max-height: 120px;
  resize: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
  color: var(--wlc-text);
  font: inherit;
}

.woolivechat-form textarea::placeholder {
  color: #98a2b3;
}

.woolivechat-form textarea:focus {
  outline: none;
  border-color: rgba(23, 134, 229, 0.45);
  box-shadow: 0 0 0 3px rgba(23, 134, 229, 0.12);
}

.woolivechat-form button {
  flex: 0 0 auto;
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: var(--wlc-accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.woolivechat-form button:hover {
  filter: brightness(0.98);
}

.woolivechat-form button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.woolivechat-attach {
  width: 42px;
  padding: 0 !important;
  background: var(--wlc-surface-2) !important;
  color: #334155 !important;
  font-size: 20px;
  line-height: 1;
}

/* Responsive */
@media (max-width: 640px) {
  #woolivechat-widget {
    right: 8px;
    bottom: 8px;
  }

  .woolivechat-panel {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    height: min(72dvh, calc(100dvh - 88px));
    max-height: calc(100dvh - 88px);
    bottom: 72px;
    border-radius: 18px;
  }

  .woolivechat-header,
  .woolivechat-messages,
  .woolivechat-form {
    padding-left: 12px;
    padding-right: 12px;
  }

  .woolivechat-bubble,
  .woolivechat-file {
    max-width: 88%;
  }

  .woolivechat-trigger {
    min-height: 52px;
    padding: 11px 16px;
  }

  .woolivechat-trigger.has-image {
    width: 64px;
    height: 64px;
    padding: 0;
  }
}

@media (max-width: 767px) {
  #woolivechat-widget {
    right: 12px;
    bottom: 16px;
  }

  .woolivechat-panel {
    right: 0;
  }

  .woolivechat-trigger.has-image {
    width: 64px;
    height: 64px;
    padding: 10px;
  }
}

@media (max-width: 767px) {
  .woolivechat-drag-handle {
    width: 24px;
    height: 24px;
    right: 0;
    bottom: 66px;
    font-size: 11px;
  }
}

@-webkit-keyframes tada {
  from {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }

  10%,
  20% {
    -webkit-transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
    transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
  }

  30%,
  50%,
  70%,
  90% {
    -webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
    transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
  }

  40%,
  60%,
  80% {
    -webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
    transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
  }

  to {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }
}
@keyframes tada {
  from {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }

  10%,
  20% {
    -webkit-transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
    transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
  }

  30%,
  50%,
  70%,
  90% {
    -webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
    transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
  }

  40%,
  60%,
  80% {
    -webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
    transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
  }

  to {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }
}
#woolivechat-trigger > img{
	  animation: 3s infinite alternate tada;

}