/* OnPoint AI Chat Widget — extends the site's existing color tokens (see /assets/css/style.css :root) */
.op-chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: var(--z-modal, 1040);
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
}

.op-chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--color-blue, #0088FF), var(--color-cyan, #00B4D8));
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 136, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.op-chat-toggle:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 136, 255, 0.45); }
.op-chat-toggle svg { width: 26px; height: 26px; }
.op-chat-toggle .op-chat-icon-close { display: none; }
.op-chat-widget.open .op-chat-toggle .op-chat-icon-open { display: none; }
.op-chat-widget.open .op-chat-toggle .op-chat-icon-close { display: block; }

.op-chat-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 140px);
  background: var(--color-navy-light, #0C1220);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.op-chat-widget.open .op-chat-panel { display: flex; }

.op-chat-header {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: var(--color-navy, #06090F);
}
.op-chat-header-title { display: flex; align-items: center; gap: 10px; }
.op-chat-header-title strong { display: block; color: #fff; font-size: 14px; font-family: var(--font-heading, 'Space Grotesk', sans-serif); }
.op-chat-header-title small { display: block; color: var(--color-gray-400, #94A3B8); font-size: 12px; margin-top: 2px; }
.op-chat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-green, #10B981); box-shadow: 0 0 0 3px rgba(16,185,129,0.2); flex-shrink: 0; }

.op-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.op-chat-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.op-chat-msg-bot {
  align-self: flex-start;
  background: rgba(255,255,255,0.06);
  color: var(--color-gray-200, #E2E8F0);
  border-bottom-left-radius: 4px;
}
.op-chat-msg-user {
  align-self: flex-end;
  background: var(--color-blue, #0088FF);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.op-chat-msg-error {
  align-self: flex-start;
  background: rgba(255,107,53,0.12);
  color: var(--color-orange, #FF6B35);
  border: 1px solid rgba(255,107,53,0.3);
}
.op-chat-typing { align-self: flex-start; display: flex; gap: 4px; padding: 10px 13px; }
.op-chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--color-gray-400, #94A3B8); animation: opChatBlink 1.2s infinite ease-in-out; }
.op-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.op-chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes opChatBlink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

.op-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: var(--color-navy, #06090F);
}
.op-chat-form input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 12px;
  color: #fff;
  font-size: 13.5px;
}
.op-chat-form input::placeholder { color: var(--color-gray-500, #64748B); }
.op-chat-form input:focus { outline: none; border-color: var(--color-blue, #0088FF); }
.op-chat-form button {
  width: 40px;
  border-radius: 10px;
  border: none;
  background: var(--color-blue, #0088FF);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.op-chat-form button svg { width: 17px; height: 17px; }
.op-chat-form button:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 480px) {
  .op-chat-widget { right: 16px; bottom: 16px; }
  .op-chat-panel { width: calc(100vw - 32px); }
}
