/* public/css/chatbot.css */
/* OBCO Tax Intelligence Chatbot — floating widget */

:root {
  --cbg: #1a1a2e;
  --c-surface: #ffffff;
  --c-border: rgba(26, 26, 46, 0.1);
  --c-text: #1a1a2e;
  --c-text-muted: #6b6b7b;
  --c-accent: #c9a84c;
  --c-accent-dim: rgba(201, 168, 76, 0.15);
  --c-user-bg: #c9a84c;
  --c-assistant-bg: #f8f5f0;
  --c-radius: 16px;
  --c-shadow: 0 8px 40px rgba(26, 26, 46, 0.18);
}

/* Launcher button */
#obco-chat-launcher {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9998;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--c-accent);
  border: none;
  cursor: pointer;
  box-shadow: var(--c-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
}
#obco-chat-launcher:hover {
  transform: scale(1.08);
  background: #b8922f;
}
#obco-chat-launcher svg { transition: transform 0.3s; }
#obco-chat-launcher.open svg { transform: rotate(45deg); }

/* Chat panel */
#obco-chat-panel {
  position: fixed;
  bottom: 112px;
  right: 32px;
  z-index: 9999;
  width: 380px;
  max-height: 560px;
  background: var(--c-surface);
  border-radius: var(--c-radius);
  box-shadow: var(--c-shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--c-border);
}

/* Header */
.obco-chat-header {
  background: var(--cbg);
  color: #f8f5f0;
  padding: 20px 24px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.obco-chat-header-info { flex: 1; }
.obco-chat-header-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 4px;
}
.obco-chat-header-sub {
  font-size: 12px;
  opacity: 0.65;
  line-height: 1.4;
}
.obco-chat-header-actions { display: flex; align-items: center; gap: 6px; }
.obco-lang-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #f8f5f0;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  transition: background 0.15s;
  letter-spacing: 0.03em;
}
.obco-lang-btn:hover { background: rgba(255,255,255,0.22); }
.obco-chat-close {
  background: none;
  border: none;
  color: #f8f5f0;
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.obco-chat-close:hover { opacity: 1; }

/* Messages area */
.obco-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}
.obco-chat-messages::-webkit-scrollbar { width: 4px; }
.obco-chat-messages::-webkit-scrollbar-track { background: transparent; }
.obco-chat-messages::-webkit-scrollbar-thumb { background: rgba(26,26,46,0.15); border-radius: 2px; }

/* Individual messages */
.obco-chat-msg { display: flex; flex-direction: column; gap: 4px; }
.obco-chat-msg.user { align-items: flex-end; }
.obco-chat-msg.assistant { align-items: flex-start; }

.obco-chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}
.obco-chat-msg.user .obco-chat-bubble {
  background: var(--c-user-bg);
  color: #1a1a2e;
  border-bottom-right-radius: 4px;
}
.obco-chat-msg.assistant .obco-chat-bubble {
  background: var(--c-assistant-bg);
  color: var(--c-text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--c-border);
}

.obco-chat-meta {
  font-size: 10px;
  color: var(--c-text-muted);
  padding: 0 4px;
}
.obco-chat-msg.user .obco-chat-meta { text-align: right; }

/* Welcome / suggestion chips */
.obco-chat-welcome {
  background: var(--c-accent-dim);
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--c-text-muted);
  text-align: center;
  margin-bottom: 4px;
  line-height: 1.5;
}
.obco-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.obco-suggestion {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--c-text);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.obco-suggestion:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: var(--c-accent-dim);
}

/* Typing indicator */
.obco-typing {
  display: flex;
  gap: 5px;
  padding: 12px 16px;
  background: var(--c-assistant-bg);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--c-border);
  width: fit-content;
}
.obco-typing-dot {
  width: 7px;
  height: 7px;
  background: var(--c-accent);
  border-radius: 50%;
  animation: obco-typing-bounce 1.2s infinite;
}
.obco-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.obco-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes obco-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Disclaimer */
.obco-chat-disclaimer {
  font-size: 10px;
  color: var(--c-text-muted);
  padding: 8px 16px 4px;
  border-top: 1px solid var(--c-border);
  line-height: 1.4;
  display: none;
}
.obco-chat-disclaimer.visible { display: block; }

/* Input area */
.obco-chat-input-area {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--c-border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.obco-chat-input {
  flex: 1;
  border: 1px solid var(--c-border);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  background: var(--c-surface);
  color: var(--c-text);
  outline: none;
  resize: none;
  max-height: 100px;
  line-height: 1.5;
  transition: border-color 0.15s;
}
.obco-chat-input:focus { border-color: var(--c-accent); }
.obco-chat-input::placeholder { color: var(--c-text-muted); }
.obco-chat-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--c-accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.15s;
}
.obco-chat-send:hover { transform: scale(1.05); background: #b8922f; }
.obco-chat-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Responsive */
@media (max-width: 480px) {
  #obco-chat-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 90vh;
    border-radius: var(--c-radius) var(--c-radius) 0 0;
  }
  #obco-chat-launcher { bottom: 20px; right: 20px; }
}