/* U Homes L Chatbot - Final Popup CSS */

.uh-chat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.56);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9997;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.uh-chat-overlay.uh-open {
  opacity: 1;
  pointer-events: auto;
}

.uh-chat-launcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  min-width: 175px;
  height: 66px;
  padding: 0 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #3e418b 0%, #5a5ed1 60%, #7a7df0 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 16px 35px rgba(62, 65, 139, 0.34);
  z-index: 9998;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.uh-chat-launcher:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 22px 44px rgba(62, 65, 139, 0.42);
}

.uh-chat-launcher::after {
  content: "Chat with Raa";
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.uh-chat-launcher-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.uh-chat-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.uh-chat-container.uh-open {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.uhomesl-chat {
  width: min(680px, 100%);
  max-height: min(88vh, 820px);
  border-radius: 24px;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.35);
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.uh-chat-hero {
  padding: 22px 22px 16px;
  background: linear-gradient(135deg, #3e418b 0%, #5d61d6 100%);
  color: #fff;
}

.uh-chat-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  margin-bottom: 12px;
}

.uh-chat-hero-title {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  margin-bottom: 8px;
}

.uh-chat-hero-text {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.uh-chat-quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.uh-quick-btn {
  border: none;
  background: #fff;
  color: #2c317f;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.uh-quick-btn:hover {
  transform: translateY(-1px);
}

.uh-chat-header {
  padding: 12px 16px;
  background: #ffffff;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
}

.uh-chat-header-main {
  display: flex;
  flex-direction: column;
}

.uh-chat-title {
  font-size: 15px;
  font-weight: 700;
}

.uh-chat-subtitle {
  font-size: 12px;
  color: #6b7280;
}

.uh-chat-header-actions {
  display: flex;
  gap: 6px;
}

.uh-chat-header-actions button {
  border: none;
  background: #f3f4f6;
  color: #111827;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.uh-chat-header-actions button:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

.uh-chat-window {
  height: 380px;
  overflow-y: auto;
  padding: 14px 14px 8px;
  background: #f3f4f6;
}

.uh-chat-window::-webkit-scrollbar {
  width: 6px;
}

.uh-chat-window::-webkit-scrollbar-track {
  background: transparent;
}

.uh-chat-window::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}

.uh-chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.uh-chat-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  font-size: 14px;
  outline: none;
}

.uh-chat-form input:focus {
  border-color: #3e418b;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.15);
}

.uh-chat-form button[type="submit"] {
  border: 0;
  background: #3e418b;
  color: #fff;
  cursor: pointer;
}

body.uh-chat-modal-open {
  overflow: hidden;
}

/* Button row: Send, Voice, Call */

.uh-chat-voice-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.uh-icon-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.uh-icon-btn:hover {
  transform: translateY(-1px);
}

.uh-icon-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.uh-icon-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.uh-send-btn {
  background: #3e418b;
  color: #fff;
  box-shadow: 0 8px 20px rgba(62, 65, 139, 0.25);
}

.uh-send-btn:hover {
  background: #2f3270;
}

.uh-mic-btn {
  background: #10b981;
  color: #fff;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.22);
}

.uh-mic-btn.recording {
  background: #ef4444;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.24);
}

.uh-chat-call-btn {
  background: #111827;
  color: #fff;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.18);
}

.uh-chat-call-btn.active {
  background: #ef4444;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.24);
}

/* Messages */

.msg {
  margin: 6px 0;
  font-size: 13px;
  animation: uh-fade-in-up 0.18s ease-out;
  max-width: 100%;
}

.msg-inner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3e418b, #484a8f);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #e5e7eb;
  flex-shrink: 0;
}

.msg-avatar span {
  font-weight: 600;
}

.msg-text {
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.45;
  word-wrap: break-word;
}

.msg.user {
  display: flex;
  justify-content: flex-end;
}

.msg.user .msg-text {
  margin-left: auto;
  background: #dbeafe;
  border-bottom-right-radius: 4px;
}

.msg.bot {
  display: flex;
  justify-content: flex-start;
}

.msg.bot .msg-text {
  background: #ffffff;
  border-bottom-left-radius: 4px;
}

.msg.bot.typing,
.msg.bot.thinking {
  padding: 9px 11px;
  margin: 6px 0;
  border-radius: 12px;
  line-height: 1.45;
  font-size: 13px;
  max-width: 92%;
  word-wrap: break-word;
  background: #ffffff;
  font-style: italic;
  color: #6b7280;
}

.msg-text a {
  color: #1d4ed8;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.msg-text a:hover {
  text-decoration: none;
}

/* Inline lead form */

.uh-inline-lead .uh-lead-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #3e418b;
}

.uh-inline-lead .uh-lead-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.uh-inline-lead label {
  font-size: 12px;
  color: #374151;
}

.uh-inline-lead input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 13px;
  background: #ffffff;
  outline: none;
}

.uh-inline-lead input:focus {
  border-color: #3e418b;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.15);
}

.uh-lead-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.uh-lead-submit {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: #3e418b;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.uh-lead-submit:hover {
  background: #000;
}

.uh-lead-cancel {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: #e5e7eb;
  color: #3e418b;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.uh-lead-hint {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}

/* Inline booking form */

.uh-inline-booking .uh-booking-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #3e418b;
}

.uh-inline-booking .uh-booking-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.uh-inline-booking label {
  font-size: 12px;
  color: #374151;
}

.uh-inline-booking input,
.uh-inline-booking textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 13px;
  background: #ffffff;
  outline: none;
}

.uh-inline-booking input:focus,
.uh-inline-booking textarea:focus {
  border-color: #3e418b;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.15);
}

.uh-booking-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.uh-booking-submit {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: #3e418b;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.uh-booking-submit:hover {
  background: #000;
}

.uh-booking-cancel {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: #e5e7eb;
  color: #3e418b;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.uh-booking-hint {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}

/* Slot buttons */

.uh-slots-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.uh-slots-status {
  font-size: 12px;
  color: #6b7280;
}

.uh-slots-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.uh-slot-btn {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #3e418b;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}

.uh-slot-btn:hover {
  transform: translateY(-1px);
  border-color: #3e418b;
}

.uh-slot-btn.uh-selected {
  background: #3e418b;
  color: #ffffff;
  border-color: #3e418b;
}

/* Recording UI */

.uh-recording-status {
  display: none;
  align-items: center;
  gap: 10px;
  flex: 1;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  color: #111827;
}

.uh-record-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #dc2626;
  animation: uh-record-pulse 1s infinite;
}

@keyframes uh-record-pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

.uh-chat-form.is-recording #uh-chat-input,
.uh-chat-form.is-recording .uh-chat-voice-actions {
  display: none;
}

.uh-chat-form.is-recording .uh-recording-status {
  display: flex;
}

/* TTS unlock */

.uh-tts-unlock .msg-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.uh-tts-play-btn {
  align-self: flex-start;
  border: none;
  background: #3e418b;
  color: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
}

.uh-tts-play-btn:hover {
  background: #000;
}

/* Animation */

@keyframes uh-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile */

@media (max-width: 768px) {
  .uh-chat-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: stretch;
    padding: 0;
  }

  .uhomesl-chat {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 18px 18px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    display: flex;
    flex-direction: column;
  }

  @supports (height: 100dvh) {
    .uhomesl-chat {
      height: 100dvh;
      max-height: 100dvh;
      min-height: 100dvh;
    }
  }

  .uh-chat-hero {
    padding: 14px 14px 10px;
    flex-shrink: 0;
  }

  .uh-chat-badge {
    font-size: 11px;
    padding: 5px 8px;
    margin-bottom: 8px;
  }

  .uh-chat-hero-title {
    font-size: 18px;
    line-height: 1.28;
    margin-bottom: 6px;
  }

  .uh-chat-hero-text {
    font-size: 12.5px;
    line-height: 1.4;
  }

  .uh-chat-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
  }

  .uh-quick-btn {
    width: 100%;
    text-align: center;
    font-size: 12px;
    padding: 10px 12px;
    -webkit-appearance: none;
    appearance: none;
  }

  .uh-chat-header {
    padding: 10px 12px;
    flex-shrink: 0;
  }

  .uh-chat-header-actions button {
    -webkit-appearance: none;
    appearance: none;
  }

  .uh-chat-window {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 12px 8px;
  }

  .uh-chat-form {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid #e5e7eb;
    background: #fff;
  }

  .uh-chat-form input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    font-size: 16px;
    padding: 10px 12px;
    border-radius: 999px;
    -webkit-appearance: none;
    appearance: none;
  }

  .uh-chat-voice-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 0;
    flex-shrink: 0;
  }

  .uh-icon-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
  }

  .uh-icon-btn svg {
    width: 18px;
    height: 18px;
  }

  .uh-chat-launcher {
    min-width: 132px;
    height: 52px;
    padding: 0 12px;
    border-radius: 14px;
    gap: 8px;
    bottom: 12px;
    right: 12px;
    -webkit-appearance: none;
    appearance: none;
  }

  .uh-chat-launcher::after {
    content: "Chat";
    font-size: 13px;
  }

  .uh-chat-launcher-icon {
    width: 30px;
    height: 30px;
    font-size: 16px;
    border-radius: 10px;
  }

  .msg {
    font-size: 12.5px;
  }

  .msg-inner {
    gap: 6px;
  }

  .msg-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .msg-text {
    padding: 9px 10px;
  }

  .uh-recording-status {
    font-size: 12px;
    padding: 9px 10px;
  }

  .uh-record-dot {
    width: 8px;
    height: 8px;
  }
}

@media (max-width: 480px) {
  .uhomesl-chat {
    border-radius: 18px 18px 0 0;
  }

  .uh-chat-hero {
    padding: 14px 14px 10px;
  }

  .uh-chat-hero-title {
    font-size: 17px;
  }

  .uh-chat-hero-text {
    font-size: 12.5px;
  }

  .uh-chat-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .uh-quick-btn {
    width: 100%;
    text-align: center;
  }

  .uh-chat-header {
    padding: 10px 10px;
  }

  .uh-chat-window {
    padding: 10px 10px 6px;
  }

  .uh-chat-form {
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    gap: 6px;
  }

  .uh-chat-form input {
    font-size: 13px;
    padding: 10px 11px;
  }

  .uh-chat-voice-actions {
    gap: 5px;
  }

  .uh-icon-btn {
    width: 40px;
    height: 40px;
  }

  .uh-icon-btn svg {
    width: 18px;
    height: 18px;
  }

  .uh-chat-launcher {
    min-width: 132px;
    height: 52px;
    padding: 0 12px;
    border-radius: 14px;
    gap: 8px;
    bottom: 12px;
    right: 12px;
  }

  .uh-chat-launcher::after {
    content: "Chat";
    font-size: 13px;
  }

  .uh-chat-launcher-icon {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .uh-recording-status {
    font-size: 12px;
    padding: 9px 10px;
  }

  .uh-record-dot {
    width: 8px;
    height: 8px;
  }
}


/* Safari fixes */
.uhomesl-chat,
.uh-chat-window,
.uh-chat-form,
.uh-chat-form input,
.uh-quick-btn,
.uh-chat-header-actions button,
.uh-icon-btn {
  box-sizing: border-box;
}

.uh-chat-window,
.uhomesl-chat {
  min-width: 0;
}

@supports (-webkit-touch-callout: none) {
  .uh-chat-container {
    height: -webkit-fill-available;
  }

  .uhomesl-chat {
    height: -webkit-fill-available;
    max-height: -webkit-fill-available;
  }

  .uh-chat-window {
    -webkit-overflow-scrolling: touch;
  }
}