/* Intake AI — Chat Widget Styles
   Reusable: override --intake-* CSS variables per client */

.intake-ai-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--intake-accent, #003078);
  color: var(--intake-accent-text, #ffffff);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 48, 120, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99998;
  transition: transform 0.2s, box-shadow 0.2s;
}

.intake-ai-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0, 48, 120, 0.4);
}

.intake-ai-bubble svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.intake-ai-bubble .intake-notification-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  background: #f0a800;
  border-radius: 50%;
  border: 2px solid var(--intake-accent, #003078);
  display: none;
}

.intake-ai-window {
  position: fixed;
  bottom: 92px;
  right: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  max-height: 600px;
  height: 70vh;
  background: var(--intake-bg, #ffffff);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  z-index: 99999;
  overflow: hidden;
  font-family: var(--intake-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

.intake-ai-window.open {
  display: flex;
  animation: intake-slide-up 0.25s ease;
}

@keyframes intake-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.intake-ai-header {
  background: var(--intake-accent, #003078);
  color: var(--intake-accent-text, #ffffff);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.intake-ai-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.intake-ai-header-text {
  flex: 1;
  min-width: 0;
}

.intake-ai-header-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

.intake-ai-header-subtitle {
  font-size: 12px;
  opacity: 0.85;
  margin: 0;
  line-height: 1.3;
}

.intake-ai-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.7;
  transition: opacity 0.15s;
  line-height: 1;
}

.intake-ai-close:hover { opacity: 1; }

.intake-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.intake-ai-messages::-webkit-scrollbar {
  width: 4px;
}
.intake-ai-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

.intake-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.45;
  word-wrap: break-word;
  animation: intake-msg-fade 0.2s ease;
}

@keyframes intake-msg-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.intake-msg.ai {
  background: var(--intake-bubble-ai, #f0f4fa);
  color: var(--intake-ink, #1c2430);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.intake-msg.user {
  background: var(--intake-accent, #003078);
  color: var(--intake-accent-text, #ffffff);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.intake-msg.typing {
  display: flex;
  gap: 4px;
  padding: 14px 16px;
}

.intake-msg.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #99a4b0;
  animation: intake-typing 1.2s infinite;
}

.intake-msg.typing span:nth-child(2) { animation-delay: 0.2s; }
.intake-msg.typing span:nth-child(3) { animation-delay: 0.4s; }

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

.intake-ai-input-area {
  padding: 12px 14px;
  border-top: 1px solid #e8eaed;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  background: var(--intake-bg, #ffffff);
}

.intake-ai-input {
  flex: 1;
  border: 1px solid #d4d8de;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  resize: none;
  max-height: 100px;
  min-height: 42px;
  line-height: 1.4;
}

.intake-ai-input:focus {
  border-color: var(--intake-accent, #003078);
}

.intake-ai-send {
  background: var(--intake-accent, #003078);
  color: var(--intake-accent-text, #ffffff);
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.intake-ai-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.intake-ai-send svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.intake-ai-footer {
  text-align: center;
  padding: 6px;
  font-size: 11px;
  color: #99a4b0;
  background: var(--intake-bg, #ffffff);
  flex-shrink: 0;
}

.intake-ai-disclaimer {
  display: none;
  padding: 12px 16px;
  background: #fff8e1;
  border-top: 1px solid #ffe082;
  font-size: 12px;
  color: #5d4e1a;
  line-height: 1.4;
  flex-shrink: 0;
}

.intake-ai-disclaimer.show {
  display: block;
}

/* ── Embedded mode — inline on the page, not floating ── */
.intake-ai-window.embedded {
  position: relative;
  bottom: auto;
  right: auto;
  width: 100%;
  max-width: 100%;
  max-height: 600px;
  height: 70vh;
  min-height: 400px;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 35, 80, 0.1);
  display: flex;
  margin: 0 auto;
}

.intake-ai-window.embedded .intake-ai-close {
  display: none;
}

@media (max-width: 30rem) {
  .intake-ai-window.embedded {
    right: auto;
    bottom: auto;
    width: 100%;
    height: 80vh;
    max-height: 80vh;
    border-radius: 12px;
  }
  /* Floating bubble mode mobile */
  .intake-ai-window:not(.embedded) {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .intake-ai-bubble {
    bottom: 16px;
    right: 16px;
  }
}
