/* Lika Chatbot Widget */
#lika-widget {
  --lika-primary: #2563eb;
  --lika-bg: #ffffff;
  --lika-text: #172033;
  --lika-muted: #64748b;
  font-family: inherit;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
}

#lika-widget.lika-left {
  right: auto;
  left: 24px;
}

.lika-launcher {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: var(--lika-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(37, 99, 235, .35);
  transition: transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}

.lika-launcher:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 32px rgba(37, 99, 235, .4);
}

.lika-launcher img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lika-launcher svg {
  width: 32px;
  height: 32px;
}

.lika-launcher::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: #22c55e;
  border: 2px solid #fff;
  border-radius: 50%;
  right: 3px;
  bottom: 3px;
}

.lika-launcher.lika-rounded {
  border-radius: 20px;
}

.lika-launcher.lika-small {
  width: 52px;
  height: 52px;
}

.lika-launcher.lika-large {
  width: 76px;
  height: 76px;
}

.lika-window {
  position: absolute;
  bottom: 82px;
  right: 0;
  width: min(380px, calc(100vw - 32px));
  height: min(540px, calc(100dvh - 125px));
  min-height: 360px;
  background: var(--lika-bg);
  color: var(--lika-text);
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 20px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, .2);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.lika-left .lika-window {
  right: auto;
  left: 0;
}

.lika-window.lika-open {
  display: flex;
  animation: lika-enter .2s ease-out;
}

@keyframes lika-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.lika-header {
  background: linear-gradient(135deg, var(--lika-primary), #1d4ed8);
  color: #fff;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.lika-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.lika-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lika-header-info {
  flex: 1;
  min-width: 0;
}

.lika-header-info strong {
  display: block;
  font-size: 16px;
}

.lika-header-info small {
  font-size: 12px;
  opacity: .85;
}

.lika-close {
  border: 0;
  background: rgba(255,255,255,.15);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
}

.lika-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--lika-bg);
}

.lika-message {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.lika-message.bot,
.lika-message.admin {
  align-self: flex-start;
  background: #f1f5f9;
  color: #172033;
  border-bottom-left-radius: 4px;
}

.lika-message.visitor {
  align-self: flex-end;
  background: var(--lika-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.lika-typing {
  color: var(--lika-muted);
  font-size: 12px;
  padding: 0 16px 8px;
}

.lika-footer {
  padding: 12px;
  border-top: 1px solid rgba(148, 163, 184, .2);
  display: flex;
  gap: 8px;
  background: var(--lika-bg);
}

.lika-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 22px;
  padding: 11px 14px;
  font: inherit;
  font-size: 14px;
  outline: none;
  background: var(--lika-bg);
  color: var(--lika-text);
}

.lika-input:focus {
  border-color: var(--lika-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.lika-send {
  border: 0;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: var(--lika-primary);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.lika-send:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.lika-actions {
  padding: 0 12px 10px;
  display: flex;
  justify-content: center;
}

.lika-human {
  border: 0;
  background: transparent;
  color: var(--lika-primary);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

.lika-dark {
  --lika-bg: #111827;
  --lika-text: #f8fafc;
  --lika-muted: #94a3b8;
}

.lika-dark .lika-message.bot,
.lika-dark .lika-message.admin {
  background: #273449;
  color: #f8fafc;
}

.lika-dark .lika-footer {
  border-color: #334155;
}

.lika-dark .lika-input {
  border-color: #475569;
}

@media (max-width: 480px) {
  #lika-widget {
    bottom: 16px;
    right: 16px;
  }

  #lika-widget.lika-left {
    right: auto;
    left: 16px;
  }

  .lika-window {
    position: fixed;
    inset: 12px;
    width: auto;
    height: auto;
    min-height: 0;
    border-radius: 18px;
  }

  .lika-left .lika-window {
    left: 12px;
    right: 12px;
  }
}
