/* HR Painting Services — Chatbot */

:root {
  --hrp-cyan: #00e5ff;
  --hrp-cyan-dark: #00b4cc;
  --hrp-fuchsia: #ff00e5;
  --hrp-fuchsia-dark: #cc00b4;
  --hrp-ink: #060510;
  --hrp-ink-2: #0A0318;
  --hrp-grad: linear-gradient(135deg, var(--hrp-cyan-dark), var(--hrp-fuchsia-dark));
}

#hrp-chatbot-root,
#hrp-chatbot-root * {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ── Floating Toggle (custom button, not bubble) ── */
#hrp-chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999998;
  width: auto;
  min-width: 60px;
  height: 60px;
  padding: 0 22px 0 18px;
  border: none;
  border-radius: 30px;
  background: var(--hrp-grad);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 10px 32px rgba(0, 180, 204, 0.35), 0 4px 12px rgba(204, 0, 180, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.2s ease;
}
#hrp-chatbot-toggle:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 14px 40px rgba(0, 180, 204, 0.45), 0 6px 16px rgba(204, 0, 180, 0.3);
}
#hrp-chatbot-toggle .hrp-toggle-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#hrp-chatbot-toggle .hrp-pulse {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7);
  animation: hrp-pulse 2s infinite;
}
@keyframes hrp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(0, 255, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}
#hrp-chatbot-toggle.hrp-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

/* ── Chat Window ── */
#hrp-chatbot-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  width: 380px;
  height: 560px;
  max-height: calc(100vh - 48px);
  background: linear-gradient(165deg, var(--hrp-ink) 0%, var(--hrp-ink-2) 100%);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: none;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#hrp-chatbot-window.hrp-open {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Header */
.hrp-header {
  padding: 16px 18px;
  background: var(--hrp-grad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.hrp-header-info { display: flex; align-items: center; gap: 12px; }
.hrp-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.hrp-header-text strong {
  display: block;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.hrp-header-text small {
  display: block;
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
  font-weight: 500;
  margin-top: 2px;
}
.hrp-header-text small::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00ff88;
  margin-right: 6px;
  vertical-align: middle;
}
.hrp-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.hrp-close:hover { background: rgba(255, 255, 255, 0.28); }

/* Messages */
.hrp-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.hrp-messages::-webkit-scrollbar { width: 6px; }
.hrp-messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }

.hrp-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
  animation: hrp-fade-in 0.25s ease;
}
@keyframes hrp-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.hrp-msg.hrp-bot {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom-left-radius: 6px;
  align-self: flex-start;
}
.hrp-msg.hrp-user {
  background: var(--hrp-grad);
  color: #fff;
  border-bottom-right-radius: 6px;
  align-self: flex-end;
  font-weight: 500;
}
.hrp-typing {
  display: inline-flex;
  gap: 4px;
  padding: 6px 0;
}
.hrp-typing span {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  animation: hrp-bounce 1.2s infinite ease-in-out;
}
.hrp-typing span:nth-child(2) { animation-delay: 0.15s; }
.hrp-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes hrp-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Quick action chips */
.hrp-quick-actions {
  padding: 0 16px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.hrp-chip {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.25);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.hrp-chip:hover {
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.5);
  color: #fff;
}

/* Lead form (inline, in chat) */
.hrp-lead-form {
  margin-top: 4px;
  padding: 14px;
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: stretch;
}
.hrp-lead-form label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.45);
}
.hrp-lead-form input {
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  outline: none;
}
.hrp-lead-form input:focus { border-color: rgba(0, 229, 255, 0.5); }
.hrp-lead-form button {
  padding: 10px;
  border-radius: 999px;
  background: var(--hrp-grad);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.hrp-lead-form button:hover { opacity: 0.88; }
.hrp-lead-form button:disabled { opacity: 0.5; cursor: not-allowed; }
.hrp-lead-form .hrp-form-error {
  color: #ff6b8b;
  font-size: 11px;
  text-align: center;
}

/* Input bar */
.hrp-input-bar {
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.hrp-input-bar input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}
.hrp-input-bar input::placeholder { color: rgba(255, 255, 255, 0.3); }
.hrp-input-bar input:focus { border-color: rgba(0, 229, 255, 0.4); }
.hrp-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--hrp-grad);
  border: none;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}
.hrp-send:hover { transform: scale(1.05); }
.hrp-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Mobile */
@media (max-width: 480px) {
  #hrp-chatbot-window {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
  #hrp-chatbot-toggle {
    bottom: 16px;
    right: 16px;
  }
}
