/* Dental chatbot styles */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f0f4f8;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 600px;
  max-height: calc(100vh - 40px);
}

/* Header */
.header {
  background: linear-gradient(135deg, #00b4d8, #0077b6);
  padding: 20px;
  color: #fff;
}
.clinic-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 600;
}
.header-sub {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 4px;
}

/* Chat window */
.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-window::-webkit-scrollbar { width: 4px; }
.chat-window::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* Messages */
.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.message.user { align-self: flex-end; }
.message.assistant { align-self: flex-start; }

.bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}
.message.user .bubble {
  background: #00b4d8;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.message.assistant .bubble {
  background: #f1f5f9;
  color: #1a1a1a;
  border-bottom-left-radius: 4px;
}
.timestamp {
  font-size: 0.7rem;
  color: #aaa;
  margin-top: 4px;
  padding: 0 4px;
}
.message.user .timestamp { text-align: right; }

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: #f1f5f9;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.dot {
  width: 8px; height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

/* Quick replies */
.quick-replies {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px 8px;
  border-top: 1px solid #eee;
}
.quick-btn {
  background: #e0f7ff;
  color: #0077b6;
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
}
.quick-btn:hover { background: #b3e9f5; }

/* Input area */
.input-area {
  border-top: 1px solid #eee;
  padding: 12px 16px;
}
.input-row {
  display: flex;
  gap: 8px;
}
#messageInput {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}
#messageInput:focus { border-color: #00b4d8; }
.send-btn {
  background: #00b4d8;
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.send-btn:hover { background: #0077b6; }
.send-btn:disabled { background: #ccc; cursor: not-allowed; }

/* Handoff banner */
.handoff-banner {
  background: #d1fae5;
  color: #065f46;
  padding: 12px 20px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.3s ease;
}

/* Appointment form */
.appointment-form {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.appointment-form label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748b;
}
.appointment-form input,
.appointment-form select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
}
.form-row { display: flex; gap: 8px; }
.form-row > * { flex: 1; }
.book-submit {
  background: #00b4d8;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}
.book-submit:hover { background: #0077b6; }