/* Kiflow Chatbot Widget Styles */
#kf-chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #e07a15;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(224, 122, 21, 0.4);
  z-index: 9999;
  transition: transform 0.2s, box-shadow 0.2s;
}
#kf-chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(224, 122, 21, 0.5);
}

#kf-chat-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 560px;
  max-height: calc(100vh - 48px);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 12px 48px rgba(0,0,0,0.15);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: opacity 0.2s, transform 0.2s;
}
#kf-chat-panel.kf-hidden {
  display: none;
}

.kf-header {
  background: #0d0d12;
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.kf-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.kf-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e07a15;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 900;
  font-size: 18px;
}
.kf-title {
  font-weight: 600;
  font-size: 15px;
}
.kf-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}
.kf-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.kf-close:hover { color: #fff; }

.kf-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f5f4f0;
}

.kf-msg {
  max-width: 85%;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
  animation: kfFadeIn 0.2s ease;
}
@keyframes kfFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.kf-msg-user {
  background: #e07a15;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.kf-msg-assistant {
  background: #ffffff;
  color: #0d0d12;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid #ddd9cf;
}

/* Typing indicator */
.kf-typing {
  display: flex;
  gap: 4px;
  padding: 14px 20px;
}
.kf-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c4c4c4;
  animation: kfBounce 1.4s infinite ease-in-out both;
}
.kf-typing span:nth-child(1) { animation-delay: 0s; }
.kf-typing span:nth-child(2) { animation-delay: 0.16s; }
.kf-typing span:nth-child(3) { animation-delay: 0.32s; }
@keyframes kfBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Input area */
.kf-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #ddd9cf;
  background: #fff;
  flex-shrink: 0;
}
.kf-msg-input {
  flex: 1;
  border: 1px solid #ddd9cf;
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 14px;
  font-family: 'DM Sans', system-ui, sans-serif;
  outline: none;
  background: #f5f4f0;
  transition: border-color 0.2s;
}
.kf-msg-input:focus {
  border-color: #e07a15;
}
.kf-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: #e07a15;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.kf-send-btn:hover { background: #c4630f; }

/* Lead form */
.kf-lead-form {
  padding: 12px 16px;
  border-top: 1px solid #ddd9cf;
  background: #fdf3e7;
  flex-shrink: 0;
}
.kf-lead-form.kf-hidden { display: none; }
.kf-lead-text {
  font-size: 13px;
  color: #6b6b78;
  margin-bottom: 8px;
}
.kf-input {
  display: block;
  width: 100%;
  border: 1px solid #ddd9cf;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: 'DM Sans', system-ui, sans-serif;
  margin-bottom: 6px;
  outline: none;
  background: #fff;
}
.kf-input:focus { border-color: #e07a15; }
.kf-lead-btn {
  width: 100%;
  background: #e07a15;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.2s;
}
.kf-lead-btn:hover { background: #c4630f; }
.kf-lead-success {
  color: #0d0d12;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 8px 0;
}

@media (max-width: 480px) {
  #kf-chat-panel {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    bottom: 8px;
    right: 8px;
    border-radius: 12px;
  }
}
