/* website/css/support-widget.css — anonymous two-way support chat (marketing site).
   Indigo/violet. Prefixed `kchat-` to avoid any collision with main-site.css. */

.kchat-fab {
  position: fixed; bottom: 24px; right: 24px; height: 56px; padding: 0 20px;
  border-radius: 28px; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 9px; color: #fff;
  font-family: inherit; font-size: clamp(14px, 0.95vw, 16px); font-weight: 600; white-space: nowrap;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  z-index: 2147483000; transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.kchat-fab-open { width: 56px; padding: 0; border-radius: 50%; justify-content: center; gap: 0; }
.kchat-fab-label { line-height: 1; }
.kchat-fab:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 10px 26px rgba(99, 102, 241, 0.5); }
.kchat-fab:active { transform: translateY(0) scale(0.98); }
.kchat-fab svg { width: 22px; height: 22px; flex-shrink: 0; }
.kchat-fab-dot {
  position: absolute; top: 12px; right: 12px; width: 12px; height: 12px;
  border-radius: 50%; background: #EF4444; border: 2px solid #fff; display: none;
}
.kchat-fab-dot.show { display: block; }

.kchat-panel {
  position: fixed; bottom: 92px; right: 24px; width: clamp(380px, 27vw, 480px); max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 120px); background: #fff; border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18); display: none; flex-direction: column;
  overflow: hidden; z-index: 2147483000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, sans-serif;
}
.kchat-panel.open { display: flex; animation: kchat-slide-up 0.22s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes kchat-slide-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.kchat-header { background: linear-gradient(135deg, #6366F1, #8B5CF6); color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 10px; }
.kchat-header-title { flex: 1; min-width: 0; }
.kchat-header-title h3 { margin: 0; font-size: clamp(16px, 1.05vw, 19px); font-weight: 700; }
.kchat-header-title p { margin: 2px 0 0; font-size: clamp(12px, 0.85vw, 14px); color: rgba(255, 255, 255, 0.85); }
.kchat-icon-btn { background: rgba(255, 255, 255, 0.15); border: none; color: #fff; width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.kchat-icon-btn:hover { background: rgba(255, 255, 255, 0.28); }
.kchat-icon-btn svg { width: 18px; height: 18px; }
.kchat-hidden { display: none !important; }

.kchat-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #f8f9fb; }
.kchat-center { flex: 1; display: flex; align-items: center; justify-content: center; }
.kchat-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #e5e7eb; border-top-color: #6366F1; animation: kchat-spin 0.8s linear infinite; }
@keyframes kchat-spin { to { transform: rotate(360deg); } }

.kchat-scroll { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.kchat-bot-bubble { align-self: flex-start; background: #fff; border: 1px solid #e5e7eb; border-radius: 4px 14px 14px 14px; padding: 12px 14px; font-size: clamp(14px, 0.95vw, 17px); color: #374151; max-width: 90%; }

.kchat-cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kchat-cat-chip { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px 12px; font-size: clamp(13px, 0.9vw, 16px); font-weight: 500; color: #374151; cursor: pointer; text-align: left; transition: border-color 0.15s, transform 0.1s; }
.kchat-cat-chip:hover { border-color: #8B5CF6; transform: translateY(-1px); }
.kchat-cat-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }

.kchat-form-row { display: flex; gap: 8px; }
.kchat-input, .kchat-textarea { width: 100%; border: 1px solid #d1d5db; border-radius: 10px; padding: 10px 12px; font-size: clamp(14px, 0.95vw, 17px); font-family: inherit; outline: none; background: #fff; color: #111827; box-sizing: border-box; }
.kchat-input:focus, .kchat-textarea:focus { border-color: #6366F1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12); }
.kchat-textarea { resize: vertical; min-height: 90px; }
.kchat-error { color: #EF4444; font-size: clamp(12px, 0.85vw, 14px); }
.kchat-primary-btn { background: linear-gradient(135deg, #6366F1, #8B5CF6); color: #fff; border: none; border-radius: 10px; padding: 12px; font-size: clamp(14px, 0.95vw, 17px); font-weight: 600; cursor: pointer; }
.kchat-primary-btn:disabled { opacity: 0.6; cursor: default; }

.kchat-conversation { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.kchat-msg-area { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.kchat-bubble { max-width: 80%; border-radius: 14px; padding: 9px 13px; }
.kchat-bubble p { margin: 0; font-size: clamp(13px, 0.9vw, 16px); line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.kchat-bubble .kchat-time { display: block; margin-top: 3px; font-size: clamp(10px, 0.7vw, 11px); opacity: 0.7; }
.kchat-bubble-user { align-self: flex-end; background: linear-gradient(135deg, #6366F1, #8B5CF6); color: #fff; border-bottom-right-radius: 4px; }
.kchat-bubble-support { align-self: flex-start; background: #fff; border: 1px solid #e5e7eb; color: #374151; border-bottom-left-radius: 4px; }
.kchat-bubble-support .kchat-time { color: #9ca3af; }

.kchat-mode-card { display: flex; align-items: center; gap: 12px; width: 100%; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px; font-family: inherit; cursor: pointer; text-align: left; transition: border-color 0.15s, transform 0.1s; }
.kchat-mode-card:hover { border-color: #8B5CF6; transform: translateY(-1px); }
.kchat-mode-icon { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #6366F1, #8B5CF6); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kchat-mode-icon svg { width: 20px; height: 20px; }
.kchat-mode-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kchat-mode-title { font-size: clamp(14px, 0.95vw, 17px); font-weight: 600; color: #111827; }
.kchat-mode-sub { font-size: clamp(12px, 0.85vw, 14px); color: #6b7280; }

.kchat-bubble-assistant { align-self: flex-start; background: #f5f3ff; border: 1px solid #ddd6fe; color: #374151; border-bottom-left-radius: 4px; }
.kchat-bubble-assistant .kchat-time { color: #9ca3af; }
.kchat-bubble-sender { display: block; font-size: clamp(10px, 0.7vw, 11px); font-weight: 700; color: #8B5CF6; margin-bottom: 2px; }
.kchat-typing { display: flex; align-items: center; gap: 4px; padding: 13px 14px; }
.kchat-typing-dot { width: 6px; height: 6px; border-radius: 50%; background: #8B5CF6; animation: kchat-blink 1.2s infinite both; }
.kchat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.kchat-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes kchat-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.kchat-deflect-actions { display: flex; gap: 8px; padding: 8px 16px 10px; background: #f8f9fb; }
.kchat-deflect-btn { flex: 1; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 9px 12px; font-size: clamp(13px, 0.9vw, 16px); font-weight: 500; color: #374151; font-family: inherit; cursor: pointer; transition: border-color 0.15s; }
.kchat-deflect-btn:hover { border-color: #8B5CF6; }
.kchat-deflect-btn:disabled { opacity: 0.5; cursor: default; }
.kchat-deflect-yes { border-color: #8B5CF6; color: #8B5CF6; font-weight: 600; }

.kchat-inline-error { color: #EF4444; font-size: clamp(12px, 0.85vw, 14px); padding: 4px 12px 8px; background: #fff; }
.kchat-reply-bar { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid #e5e7eb; background: #fff; }
.kchat-reply-input { flex: 1; border: 1px solid #d1d5db; border-radius: 20px; padding: 10px 14px; font-size: clamp(14px, 0.95vw, 17px); font-family: inherit; outline: none; resize: none; max-height: 100px; color: #111827; }
.kchat-reply-input:focus { border-color: #6366F1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12); }
.kchat-send-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: linear-gradient(135deg, #6366F1, #8B5CF6); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.kchat-send-btn:disabled { opacity: 0.5; cursor: default; }
.kchat-send-btn svg { width: 18px; height: 18px; }

@media (max-width: 480px) {
  .kchat-panel { inset: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; border-radius: 0; bottom: 0; right: 0; }
  .kchat-fab { bottom: 16px; right: 16px; }
}
