/* widget.css — Lead capture chatbot widget styles
   Inherits dark theme tokens from theme.css (--bg-2, --accent, --fg, etc.) */

:root {
  --wc-accent: #f5a623;
  --wc-accent-dim: rgba(245, 166, 35, 0.12);
  --wc-bg: #1a1a1a;
  --wc-bg-panel: #141414;
  --wc-border: rgba(240, 236, 228, 0.1);
  --wc-radius: 16px;
}

#chat-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--wc-accent);
  border: none;
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(245, 166, 35, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#chat-launcher:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 32px rgba(245, 166, 35, 0.45);
}
#chat-launcher svg { width: 28px; height: 28px; fill: #0d0d0d; }

#chat-panel {
  position: fixed;
  bottom: 104px;
  right: 28px;
  width: 380px;
  max-height: 560px;
  background: var(--wc-bg-panel);
  border: 1px solid var(--wc-border);
  border-radius: var(--wc-radius);
  display: none;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
#chat-panel.open { display: flex; }

/* Header */
.chat-header {
  background: var(--wc-bg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--wc-border);
}
.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--wc-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: #0d0d0d;
  flex-shrink: 0;
}
.chat-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 2px;
}
.chat-info p {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
}
.chat-after-hours {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(245,166,35,0.15);
  color: var(--wc-accent);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: auto;
}
.chat-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg-muted);
  font-size: 20px;
  padding: 4px 8px;
  margin-left: auto;
  line-height: 1;
}
.chat-close:hover { color: var(--fg); }

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

.chat-msg { display: flex; gap: 10px; }
.chat-msg.bot .msg-bubble { background: var(--wc-bg); border: 1px solid var(--wc-border); color: var(--fg); }
.chat-msg.user { flex-direction: row-reverse; }
.chat-msg.user .msg-bubble { background: var(--wc-accent); color: #0d0d0d; font-weight: 600; }

.msg-bubble {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 260px;
  word-break: break-word;
}
.msg-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-muted);
  margin-top: 4px;
}

/* Option buttons */
.chat-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px 4px;
}
.chat-option-btn {
  background: var(--wc-bg);
  border: 1px solid var(--wc-border);
  color: var(--fg);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
  font-family: var(--font-body);
}
.chat-option-btn:hover {
  background: var(--wc-accent-dim);
  border-color: var(--wc-accent);
  color: var(--wc-accent);
}

/* Input area */
.chat-input-area {
  padding: 16px;
  border-top: 1px solid var(--wc-border);
  display: flex;
  gap: 8px;
  background: var(--wc-bg);
}
.chat-input {
  flex: 1;
  background: var(--wc-bg-panel);
  border: 1px solid var(--wc-border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--fg);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  resize: none;
}
.chat-input:focus { border-color: var(--wc-accent); }
.chat-input::placeholder { color: var(--fg-muted); }
.chat-send {
  background: var(--wc-accent);
  border: none;
  border-radius: 10px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-send svg { fill: #0d0d0d; width: 18px; height: 18px; }
.chat-send:hover { background: #d4921e; }

/* Booking card */
.booking-card {
  background: var(--wc-accent-dim);
  border: 1px solid var(--wc-accent);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin-top: 8px;
}
.booking-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--fg); }
.booking-card p { font-size: 12px; color: var(--fg-muted); margin-bottom: 12px; }
.book-btn {
  display: inline-block;
  background: var(--wc-accent);
  color: #0d0d0d;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 24px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
}
.book-btn:hover { background: #d4921e; }

/* Typing indicator */
.typing-dots { display: flex; gap: 4px; padding: 12px 16px; }
.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-muted);
  animation: typing 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { opacity: 0.2; transform: scale(1); }
  30% { opacity: 1; transform: scale(1.3); }
}

/* Badge for unread messages */
#chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e53e3e;
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}
#chat-badge.visible { display: flex; }

/* Responsive */
@media (max-width: 480px) {
  #chat-panel { right: 12px; bottom: 90px; width: calc(100vw - 24px); max-height: 480px; }
  #chat-launcher { right: 16px; bottom: 20px; width: 56px; height: 56px; }
}