/* WP AI Chatbot Widget Styles */
#wp-ai-chatbot-wrapper {
  position: fixed;
  z-index: 999999;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 12px;
  --chatbot-ink: #191516;
  --chatbot-paper: #ffffff;
  --chatbot-paper-strong: #ffffff;
  --chatbot-muted: #6f6668;
  --chatbot-border: rgba(48, 45, 50, 0.14);
  --chatbot-shadow: 0 24px 70px rgba(17, 13, 14, 0.18);
}

#wp-ai-chatbot-wrapper.position-bottom-right {
  bottom: 24px;
  right: 24px;
}

#wp-ai-chatbot-wrapper.position-bottom-left {
  bottom: 24px;
  left: 24px;
}

#wp-chatbot-toggle {
  width: 64px;
  height: 64px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 36%),
    linear-gradient(145deg, var(--chatbot-primary, #302d32), var(--chatbot-primary-dark, #1f1b1e));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 18px 35px rgba(17, 13, 14, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

#wp-chatbot-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 40px rgba(17, 13, 14, 0.34);
}

#wp-chatbot-toggle svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  transition: opacity 0.2s ease;
}

#wp-chatbot-toggle .icon-chat,
#wp-chatbot-toggle .icon-close {
  position: absolute;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#wp-chatbot-toggle .icon-close {
  opacity: 0;
  transform: rotate(-90deg);
}

#wp-chatbot-toggle.open .icon-chat {
  opacity: 0;
  transform: rotate(90deg);
}

#wp-chatbot-toggle.open .icon-close {
  opacity: 1;
  transform: rotate(0deg);
}

#wp-chatbot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: #f25c54;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 11px;
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

#wp-chatbot-window {
  position: absolute;
  bottom: 82px;
  right: 0;
  width: 390px;
  max-height: 525px;
  background: var(--chatbot-paper-strong);
  border-radius: 30px;
  border: 1px solid var(--chatbot-border);
  box-shadow: var(--chatbot-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.position-bottom-left #wp-chatbot-window {
  right: auto;
  left: 0;
}

#wp-chatbot-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

#wp-chatbot-header {
  position: relative;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 24%),
    linear-gradient(180deg, #302d32 0%, #1f1b1e 100%);
  color: #fff;
  padding: 18px 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

#wp-chatbot-header::after {
  content: '';
  position: absolute;
  inset: auto 0 -1px 0;
  height: 26px;
  background: radial-gradient(120% 100% at 50% 0%, transparent 57%, var(--chatbot-paper-strong) 58%);
}

#wp-chatbot-avatar {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

#wp-chatbot-header-info {
  flex: 1;
  position: relative;
  z-index: 1;
}

.wp-chatbot-kicker {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
}

#wp-chatbot-bot-name {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.04em;
}

#wp-chatbot-status {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  letter-spacing: 0.03em;
}

#wp-chatbot-status::before {
  content: '';
  width: 7px;
  height: 7px;
  background: #86efac;
  border-radius: 50%;
  display: inline-block;
  margin-right: 7px;
}

#wp-chatbot-close-btn {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

#wp-chatbot-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

#wp-chatbot-close-btn svg {
  width: 18px;
  height: 18px;
}

#wp-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #ffffff;
  min-height: 0;
}

#wp-chatbot-messages::-webkit-scrollbar {
  width: 5px;
}

#wp-chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

#wp-chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(48, 45, 50, 0.24);
  border-radius: 999px;
}

#wp-chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 18px 16px;
  background: #ffffff;
}

.wp-chatbot-suggestions-label {
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--chatbot-muted);
  margin-bottom: 2px;
}

.wp-chatbot-suggestion {
  border: 1px solid rgba(48, 45, 50, 0.14);
  background: rgba(255, 255, 255, 0.86);
  color: var(--chatbot-ink);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.wp-chatbot-suggestion:hover {
  transform: translateY(-1px);
  border-color: rgba(48, 45, 50, 0.28);
  background: #fff;
}

.wp-chatbot-msg {
  display: flex;
  gap: 10px;
  animation: msgIn 0.22s ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.wp-chatbot-msg.user {
  flex-direction: row-reverse;
}

.wp-chatbot-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  background: var(--chatbot-primary, #302d32);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 3px;
}

.wp-chatbot-msg.user .wp-chatbot-msg-avatar {
  background: #d9c7a8;
  color: var(--chatbot-ink);
}

.wp-chatbot-msg-bubble {
  max-width: 80%;
  padding: 12px 15px;
  border-radius: 20px;
  font-size: 12px;
  line-height: 1.55;
  word-break: break-word;
}

.wp-chatbot-msg.bot .wp-chatbot-msg-bubble {
  background: #fff;
  color: var(--chatbot-ink);
  border: 1px solid rgba(48, 45, 50, 0.08);
  border-bottom-left-radius: 8px;
  box-shadow: 0 8px 18px rgba(17, 13, 14, 0.05);
}

.wp-chatbot-msg.user .wp-chatbot-msg-bubble {
  background: linear-gradient(145deg, #302d32, #1f1b1e);
  color: #fff;
  border-bottom-right-radius: 8px;
  box-shadow: 0 10px 18px rgba(17, 13, 14, 0.14);
}

.wp-chatbot-typing {
  display: flex;
  gap: 5px;
  padding: 12px 16px;
  align-items: center;
}

.wp-chatbot-typing span {
  width: 7px;
  height: 7px;
  background: rgba(48, 45, 50, 0.38);
  border-radius: 50%;
  display: inline-block;
  animation: typingBounce 1.2s infinite;
}

.wp-chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.wp-chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-5px); opacity: 1; }
}

#wp-chatbot-input-area {
  padding: 14px 16px;
  border-top: 1px solid rgba(48, 45, 50, 0.08);
  background: #ffffff;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
}

#wp-chatbot-input {
  flex: 1;
  border: 1px solid rgba(48, 45, 50, 0.14);
  background: #ffffff;
  border-radius: 22px;
  padding: 12px 16px;
  font-size: 12px;
  outline: none;
  resize: none;
  max-height: 100px;
  overflow-y: auto;
  font-family: inherit;
  color: var(--chatbot-ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  line-height: 1.4;
}

#wp-chatbot-input:focus {
  border-color: rgba(48, 45, 50, 0.32);
  box-shadow: 0 0 0 4px rgba(48, 45, 50, 0.08);
}

#wp-chatbot-input::placeholder {
  color: #9c9394;
}

#wp-chatbot-send {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(145deg, var(--chatbot-primary, #302d32), var(--chatbot-primary-dark, #1f1b1e));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 10px 20px rgba(17, 13, 14, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#wp-chatbot-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(17, 13, 14, 0.24);
}

#wp-chatbot-send:disabled {
  background: #d9d2d3;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

#wp-chatbot-send svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

#wp-chatbot-footer {
  text-align: center;
  padding: 0 16px 14px;
  font-size: 12px;
  color: var(--chatbot-muted);
  background: #ffffff;
}

@media (max-width: 420px) {
  #wp-ai-chatbot-wrapper.position-bottom-right,
  #wp-ai-chatbot-wrapper.position-bottom-left {
    right: 16px;
    left: 16px;
    bottom: 16px;
  }

  #wp-chatbot-toggle {
    margin-left: auto;
  }

  #wp-chatbot-window,
  .position-bottom-left #wp-chatbot-window {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    right: 0;
    left: 0;
    bottom: 0;
    border-radius: 0;
    border: none;
  }

  #wp-chatbot-header {
    border-radius: 0;
  }

  #wp-chatbot-messages {
    padding-bottom: 18px;
  }
}
