/* ══════════════════════════════════════════════════════════
   30A HAUS SOLUTIONS — Live Chat Widget Styles
   Human-like iMessage/WhatsApp aesthetic
   ══════════════════════════════════════════════════════════ */

/* ── Floating Launcher ── */
.haus-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: #0A0A0A;
  color: #FFFFFF;
  padding: 0.85rem 1.35rem;
  border-radius: 9999px;
  border: 1.5px solid rgba(200, 163, 102, 0.4);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.25);
  font-family: var(--font-sans, 'Montserrat', -apple-system, sans-serif);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.haus-chat-launcher:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.35);
  background: #1C1917;
}

.haus-chat-launcher.hidden {
  transform: scale(0) translateY(20px);
  opacity: 0;
  pointer-events: none;
}

.haus-chat-launcher-label {
  font-weight: 700;
}

.haus-chat-pulse {
  width: 9px;
  height: 9px;
  background: #22C55E;
  border-radius: 50%;
  flex-shrink: 0;
  animation: haus-pulse 2s infinite;
}

@keyframes haus-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ── Chat Window ── */
.haus-chat-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: min(400px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 60px));
  background: #FFFFFF;
  border-radius: 20px;
  border: 1px solid #E7E5E4;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-sans, 'Montserrat', -apple-system, sans-serif);
}

.haus-chat-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ── Header ── */
.haus-chat-header {
  background: #0A0A0A;
  color: #FFFFFF;
  padding: 1rem 1.15rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.haus-chat-header-left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.haus-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C8A366, #A67C3D);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.haus-chat-header-name {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.haus-chat-header-status {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.haus-chat-status-dot {
  width: 7px;
  height: 7px;
  background: #22C55E;
  border-radius: 50%;
  flex-shrink: 0;
}

.haus-chat-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  line-height: 1;
  transition: color 0.2s;
}

.haus-chat-close:hover {
  color: #FFFFFF;
}

/* ── Messages Area ── */
.haus-chat-messages {
  flex: 1;
  padding: 1rem 0.85rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: #F5F5F4;
}

.haus-chat-date-divider {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: #A8A29E;
  padding: 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Message Bubbles ── */
.haus-chat-msg {
  display: flex;
  gap: 0.5rem;
  max-width: 90%;
  align-items: flex-end;
}

.haus-chat-msg-bot {
  align-self: flex-start;
}

.haus-chat-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.haus-chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C8A366, #A67C3D);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.65rem;
  flex-shrink: 0;
}

.haus-chat-msg-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.haus-chat-msg-bubble {
  padding: 0.7rem 0.95rem;
  border-radius: 18px;
  font-size: 0.84rem;
  line-height: 1.55;
  word-break: break-word;
}

.haus-chat-msg-bot .haus-chat-msg-bubble {
  background: #FFFFFF;
  color: #1C1917;
  border: 1px solid #E7E5E4;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.haus-chat-msg-user .haus-chat-msg-bubble {
  background: #0A0A0A;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.haus-chat-msg-time {
  font-size: 0.62rem;
  color: #A8A29E;
  padding: 0 0.25rem;
}

.haus-chat-msg-user .haus-chat-msg-time {
  text-align: right;
}

/* ── Typing Indicator ── */
.haus-chat-typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.85rem 1.1rem !important;
  min-width: 60px;
}

.haus-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #A8A29E;
  animation: haus-typing 1.4s infinite;
}

.haus-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.haus-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes haus-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

/* ── Quick Action Chips ── */
.haus-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem 0 0.25rem 2.5rem;
}

.haus-chat-chip {
  background: #FFFFFF;
  border: 1px solid #E7E5E4;
  color: #1C1917;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-family: inherit;
  line-height: 1.3;
}

.haus-chat-chip:hover {
  background: #0A0A0A;
  color: #FFFFFF;
  border-color: #0A0A0A;
  transform: translateY(-1px);
}

/* ── Input Area ── */
.haus-chat-input-area {
  padding: 0.75rem 0.85rem;
  background: #FFFFFF;
  border-top: 1px solid #E7E5E4;
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.haus-chat-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1.5px solid #E7E5E4;
  border-radius: 9999px;
  font-size: 0.84rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  color: #0A0A0A;
  background: #F5F5F4;
}

.haus-chat-input:focus {
  border-color: #0A0A0A;
  background: #FFFFFF;
}

.haus-chat-input::placeholder {
  color: #A8A29E;
}

.haus-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0A0A0A;
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.haus-chat-send:hover {
  background: #292524;
  transform: scale(1.05);
}

/* ── Mobile Responsive ── */
@media (max-width: 480px) {
  .haus-chat-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .haus-chat-launcher-label {
    display: none;
  }

  .haus-chat-launcher {
    padding: 0.85rem;
    border-radius: 50%;
    width: 54px;
    height: 54px;
    justify-content: center;
  }
}

/* ══════════════════════════════════════════════════════════
   STICKY EMERGENCY HEADER BAR
   ══════════════════════════════════════════════════════════ */
.emergency-sticky-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1001;
  background: #0A0A0A;
  color: #FFFFFF;
  padding: 0.55rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  font-family: var(--font-sans, 'Montserrat', sans-serif);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(200, 163, 102, 0.3);
}

.emergency-sticky-bar a {
  color: #C8A366;
  text-decoration: none;
  transition: color 0.2s;
}

.emergency-sticky-bar a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.emergency-sticky-bar .emergency-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(200, 163, 102, 0.15);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(200, 163, 102, 0.3);
  color: #C8A366;
  font-weight: 800;
  text-decoration: none;
}

.emergency-sticky-bar .emergency-phone:hover {
  background: #C8A366;
  color: #0A0A0A;
}

@media (max-width: 640px) {
  .emergency-sticky-bar {
    font-size: 0.65rem;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    flex-wrap: wrap;
  }
}
