/* ============================================
   Woo Category Chatbot – chatbot.css
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&display=swap');

:root {
  --wcc-primary:      #1a1a2e;
  --wcc-accent:       #e94560;
  --wcc-accent-light: #ff6b81;
  --wcc-bg:           #ffffff;
  --wcc-bubble-bg:    #f4f4f8;
  --wcc-bot-bubble:   #f0f0f7;
  --wcc-text:         #1a1a2e;
  --wcc-muted:        #8888aa;
  --wcc-border:       #e8e8f0;
  --wcc-shadow:       0 8px 40px rgba(26,26,46,0.18);
  --wcc-radius:       18px;
  --wcc-font:         'DM Sans', sans-serif;
  --wcc-window-w:     360px;
  --wcc-window-h:     520px;
}

/* ---------- Reset scope ---------- */
#wcc-bot-wrapper * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--wcc-font);
}

/* ---------- Wrapper ---------- */
#wcc-bot-wrapper {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

/* ---------- Bubble button ---------- */
#wcc-bot-bubble {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--wcc-accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(233,69,96,0.45);
  transition: transform 0.2s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s;
  color: #fff;
  flex-shrink: 0;
}
#wcc-bot-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(233,69,96,0.55);
}
#wcc-bot-bubble svg {
  width: 24px;
  height: 24px;
  pointer-events: none;
}

/* ---------- Chat window ---------- */
#wcc-bot-window {
  width: var(--wcc-window-w);
  height: var(--wcc-window-h);
  background: var(--wcc-bg);
  border-radius: var(--wcc-radius);
  box-shadow: var(--wcc-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  animation: wcc-pop-in 0.25s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes wcc-pop-in {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ---------- Header ---------- */
#wcc-bot-header {
  background: var(--wcc-primary);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.wcc-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--wcc-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.wcc-header-avatar svg {
  width: 20px;
  height: 20px;
}

.wcc-header-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.wcc-header-name {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.wcc-header-status {
  color: #6ef0a0;
  font-size: 11px;
  font-weight: 500;
}

#wcc-bot-reset {
  background: rgba(255,255,255,0.1);
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: background 0.15s, color 0.15s;
}
#wcc-bot-reset:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
#wcc-bot-reset svg {
  width: 16px;
  height: 16px;
}

/* ---------- Messages area ---------- */
#wcc-bot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
#wcc-bot-messages::-webkit-scrollbar { width: 4px; }
#wcc-bot-messages::-webkit-scrollbar-track { background: transparent; }
#wcc-bot-messages::-webkit-scrollbar-thumb { background: var(--wcc-border); border-radius: 4px; }

/* ---------- Message bubbles ---------- */
.wcc-msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: wcc-fade-up 0.25s ease both;
}

@keyframes wcc-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wcc-msg-bubble {
  background: var(--wcc-bot-bubble);
  color: var(--wcc-text);
  padding: 10px 14px;
  border-radius: 4px 16px 16px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 88%;
  width: fit-content;
  font-weight: 400;
}

/* ---------- Breadcrumb trail ---------- */
.wcc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding: 0 2px;
}
.wcc-breadcrumb-item {
  font-size: 11px;
  color: var(--wcc-muted);
  font-weight: 500;
}
.wcc-breadcrumb-sep {
  font-size: 11px;
  color: var(--wcc-border);
}
.wcc-breadcrumb-item.active {
  color: var(--wcc-accent);
}

/* ---------- Category buttons ---------- */
.wcc-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 2px 0;
}

.wcc-cat-btn {
  background: var(--wcc-bg);
  border: 1.5px solid var(--wcc-border);
  color: var(--wcc-text);
  padding: 7px 13px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}
.wcc-cat-btn:hover {
  background: var(--wcc-accent);
  border-color: var(--wcc-accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(233,69,96,0.25);
}
.wcc-cat-btn .wcc-arrow {
  font-size: 10px;
  opacity: 0.6;
}

/* Disabled (already selected) buttons */
.wcc-cat-btn.selected {
  background: var(--wcc-primary);
  border-color: var(--wcc-primary);
  color: #fff;
  pointer-events: none;
}
.wcc-buttons.disabled .wcc-cat-btn {
  opacity: 0.45;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}
.wcc-buttons.disabled .wcc-cat-btn.selected {
  opacity: 1;
}

/* ---------- Loading dots ---------- */
.wcc-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: var(--wcc-bot-bubble);
  border-radius: 4px 16px 16px 16px;
  width: fit-content;
}
.wcc-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wcc-muted);
  display: inline-block;
  animation: wcc-dot 1.2s infinite;
}
.wcc-typing span:nth-child(2) { animation-delay: 0.2s; }
.wcc-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wcc-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* ---------- Error message ---------- */
.wcc-error {
  font-size: 12.5px;
  color: var(--wcc-accent);
  padding: 8px 12px;
  background: #fff0f3;
  border-radius: 10px;
  border: 1px solid #ffd0d8;
}

/* ---------- User message bubble (right-aligned) ---------- */
.wcc-msg-user {
  align-items: flex-end;
}
.wcc-msg-user .wcc-msg-bubble {
  background: var(--wcc-accent);
  color: #fff;
  border-radius: 16px 4px 16px 16px;
  align-self: flex-end;
}

/* ---------- AI match summary bubble ---------- */
.wcc-ai-summary {
  background: #f0fff4;
  border: 1px solid #c6f6d5;
  color: #276749;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  width: fit-content;
  max-width: 90%;
}

/* ---------- Input area ---------- */
#wcc-bot-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--wcc-border);
  flex-shrink: 0;
  background: var(--wcc-bg);
}

#wcc-bot-input {
  flex: 1;
  border: 1.5px solid var(--wcc-border);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: var(--wcc-font);
  color: var(--wcc-text);
  outline: none;
  background: var(--wcc-bubble-bg);
  transition: border-color 0.15s;
}
#wcc-bot-input:focus {
  border-color: var(--wcc-accent);
  background: #fff;
}
#wcc-bot-input::placeholder {
  color: var(--wcc-muted);
}
#wcc-bot-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#wcc-bot-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--wcc-accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}
#wcc-bot-send:hover {
  background: var(--wcc-accent-light);
  transform: scale(1.08);
}
#wcc-bot-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
#wcc-bot-send svg {
  width: 15px;
  height: 15px;
}

/* ---------- Footer ---------- */
#wcc-bot-footer {
  padding: 6px 16px;
  text-align: center;
  border-top: 1px solid var(--wcc-border);
  flex-shrink: 0;
}
#wcc-bot-footer span {
  font-size: 10.5px;
  color: var(--wcc-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ---------- Mobile ---------- */
@media (max-width: 420px) {
  #wcc-bot-wrapper {
    bottom: 16px;
    right: 16px;
  }
  #wcc-bot-window {
    width: calc(100vw - 32px);
    height: 70vh;
  }
}
