/* SnapEstimate — Chat Interface Styles */

.chat-container {
  width: 100%; max-width: 480px; height: 100vh; height: 100dvh;
  margin: 0 auto; display: flex; flex-direction: column; background: var(--color-bg);
}

/* Header */
.chat-header {
  display: flex; align-items: center; padding: 12px 16px;
  border-bottom: 1px solid var(--color-border); background: var(--color-bg); flex-shrink: 0;
}
.chat-header-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--color-primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; margin-right: 10px; flex-shrink: 0;
}
.chat-header-name { font-weight: 600; font-size: 0.95rem; color: var(--color-text); }
.chat-header-status { font-size: 0.8rem; color: var(--color-success); }

/* Message area */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; -webkit-overflow-scrolling: touch;
}

/* Bubbles */
.chat-bubble {
  max-width: 85%; padding: 10px 14px; border-radius: 16px;
  margin-bottom: 8px; line-height: 1.45; font-size: 0.95rem; word-wrap: break-word;
}
.chat-bubble p { margin: 0; }
.chat-bubble-bot {
  background: var(--color-bg-alt); color: var(--color-text);
  border-bottom-left-radius: 4px; align-self: flex-start;
}
.chat-bubble-user {
  background: var(--color-primary); color: #fff;
  border-bottom-right-radius: 4px; align-self: flex-end;
}

/* Entrance animation */
.chat-bubble-enter {
  opacity: 0; transform: translateY(8px); animation: bubbleIn 0.3s ease forwards;
}
@keyframes bubbleIn { to { opacity: 1; transform: translateY(0); } }

/* Typing indicator */
.typing-indicator {
  display: flex; gap: 4px; padding: 10px 14px; align-self: flex-start;
  background: var(--color-bg-alt); border-radius: 16px;
  border-bottom-left-radius: 4px; margin-bottom: 8px;
}
.typing-indicator span {
  width: 8px; height: 8px; background: var(--color-text-muted);
  border-radius: 50%; animation: typingDot 1.2s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Input area */
.chat-input-area {
  display: flex; align-items: flex-end; padding: 8px 12px;
  border-top: 1px solid var(--color-border); background: var(--color-bg); flex-shrink: 0;
}
.chat-input-area textarea {
  flex: 1; border: 2px solid var(--color-border); border-radius: 20px;
  padding: 10px 14px; font-size: 0.95rem; font-family: inherit;
  resize: none; max-height: 100px; min-height: 0; line-height: 1.4; overflow-y: auto;
}
.chat-input-area textarea:focus { outline: none; border-color: var(--color-primary); }
.chat-send-btn {
  width: 40px; height: 40px; border: none; border-radius: 50%;
  background: var(--color-primary); color: #fff; margin-left: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: opacity 0.15s;
}
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-send-btn svg { width: 20px; height: 20px; fill: currentColor; }

/* Widgets */
.chat-widget { max-width: 90%; padding: 4px 0; }
.chat-widget .btn { padding: 12px 16px; font-size: 0.95rem; }
.photo-prompt-btns { display: flex; gap: 8px; margin-top: 8px; }
.photo-prompt-btns .btn { flex: 1; margin-top: 0; }
.chat-photo-preview {
  max-width: 200px; max-height: 200px; border-radius: 12px; margin-top: 4px; display: block;
}

/* Lead form */
.lead-form input {
  width: 100%; padding: 12px; border: 2px solid var(--color-border);
  border-radius: var(--radius); font-size: 0.95rem; font-family: inherit; margin-bottom: 4px;
}
.lead-form input:focus { outline: none; border-color: var(--color-primary); }
.lead-form-error { color: var(--color-danger); font-size: 0.8rem; min-height: 18px; }
.lead-form .btn { margin-top: 8px; }

/* Price card */
.chat-price-card {
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 16px; margin-top: 4px;
}
.chat-price-card .chat-line-item {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}
.chat-line-desc { flex: 1; font-size: 0.9rem; }
.chat-line-price { white-space: nowrap; font-weight: 600; font-size: 0.9rem; margin-left: 12px; }
.chat-line-total {
  display: flex; flex-wrap: wrap; justify-content: space-between; padding: 12px 0 0;
  font-weight: 700; font-size: 1.05rem; border-top: 2px solid var(--color-text); margin-top: 4px;
}
.chat-min-fee-note {
  width: 100%; font-size: 0.75rem; font-weight: 400; color: var(--color-text-muted);
  font-style: italic; text-align: right; margin-top: 2px;
}
.chat-price-single { text-align: center; padding: 8px 0; }
.chat-price-single .price { font-size: 1.5rem; font-weight: 800; }
.chat-price-single .label { font-size: 0.9rem; color: var(--color-text-muted); }
.chat-price-summary {
  font-size: 0.9rem; color: var(--color-text); line-height: 1.5;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--color-border);
}
.chat-price-single .label { max-width: 240px; margin: 0 auto 6px; }
.chat-price-disclaimer {
  font-size: 0.75rem; color: var(--color-text-muted); text-align: center;
  margin-top: 10px; font-style: italic;
}
.chat-generic-note {
  color: #b45309; background: #fef3c7; padding: 6px 10px;
  border-radius: 6px; font-style: normal; margin-top: 8px;
}

/* Budget + soft landing */
.budget-btns { display: flex; gap: 8px; margin-top: 8px; }
.budget-btns .btn { flex: 1; margin-top: 0; }
.chat-soft-landing {
  padding: 12px; text-align: center; color: var(--color-text);
  line-height: 1.6; font-size: 0.95rem;
}
