/* ============================================================
   Hamza Web Solution - Live AI Agent & WhatsApp Automation Widget
   Theme: Obsidian & Champagne Gold (#C9A24B) Luxury Dark Interface
   ============================================================ */

/* Chat Launcher Button */
.hws-ai-launcher {
  position: fixed;
  bottom: 22px;
  left: 22px;
  right: auto;
  z-index: 999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #161F30 0%, #0B0F19 100%);
  border: 1.5px solid #C9A24B;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 16px rgba(201, 162, 75, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.hws-ai-launcher:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6), 0 0 24px rgba(201, 162, 75, 0.45);
  border-color: #E7CE8F;
}
.hws-ai-launcher svg {
  width: 26px;
  height: 26px;
  fill: #C9A24B;
  transition: transform 0.3s ease;
}
.hws-ai-launcher:hover svg {
  transform: rotate(10deg);
}

/* Online status indicator dot */
.hws-ai-status-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10B981;
  border: 2px solid #0B0F19;
  box-shadow: 0 0 8px #10B981;
  animation: hwsPulse 2s infinite;
}
@keyframes hwsPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Tooltip badge next to launcher */
.hws-ai-badge {
  position: absolute;
  left: 68px;
  right: auto;
  top: 50%;
  transform: translateY(-50%);
  background: #111827;
  border: 1px solid #2E3A52;
  color: #E9EAF0;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-family: 'Manrope', -apple-system, sans-serif;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.hws-ai-badge::after {
  content: "";
  position: absolute;
  left: -5px;
  right: auto;
  top: 50%;
  transform: translateY(-50%);
  border-width: 5px 5px 5px 0;
  border-style: solid;
  border-color: transparent #111827 transparent transparent;
}
.hws-ai-launcher:hover .hws-ai-badge {
  opacity: 1;
  transform: translateY(-50%) translateX(4px);
}

/* Chat Window Container */
.hws-chat-window {
  position: fixed;
  bottom: 88px;
  left: 22px;
  right: auto;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: #0B0F19;
  border: 1px solid #2E3A52;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(201, 162, 75, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}
.hws-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Chat Header */
.hws-chat-header {
  padding: 14px 18px;
  background: #111827;
  border-bottom: 1px solid #1F2937;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hws-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hws-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #C9A24B, #161F30);
  border: 1px solid #C9A24B88;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(201, 162, 75, 0.3);
}
.hws-header-text h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.2px;
}
.hws-header-status {
  font-size: 11.5px;
  color: #10B981;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}
.hws-header-status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
}

/* Header Action Buttons */
.hws-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hws-btn-icon {
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.hws-btn-icon:hover {
  background: #1F2937;
  color: #FFFFFF;
}
.hws-btn-icon svg {
  width: 18px;
  height: 18px;
}

/* WhatsApp Fast Handoff Banner */
.hws-wa-banner {
  background: linear-gradient(90deg, #064E3B 0%, #065F46 100%);
  border-bottom: 1px solid #047857;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: #E6FFFA;
}
.hws-wa-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.hws-wa-banner-left svg {
  width: 16px;
  height: 16px;
  fill: #34D399;
}
.hws-wa-banner-btn {
  background: #10B981;
  color: #064E3B;
  border: none;
  font-weight: 700;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .2s;
  text-decoration: none;
}
.hws-wa-banner-btn:hover {
  background: #34D399;
}

/* Message Feed Body */
.hws-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #0B0F19;
  scroll-behavior: smooth;
}
.hws-chat-messages::-webkit-scrollbar {
  width: 5px;
}
.hws-chat-messages::-webkit-scrollbar-thumb {
  background: #1F2937;
  border-radius: 4px;
}

/* Chat Message Bubbles */
.hws-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: hwsFadeIn 0.25s ease-out;
}
@keyframes hwsFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.hws-msg.bot {
  align-self: flex-start;
}
.hws-msg.user {
  align-self: flex-end;
}

.hws-bubble {
  padding: 11px 15px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}
.hws-msg.bot .hws-bubble {
  background: #161F30;
  color: #E2E8F0;
  border: 1px solid #263044;
  border-bottom-left-radius: 3px;
}
.hws-msg.user .hws-bubble {
  background: #C9A24B;
  color: #111827;
  font-weight: 500;
  border-bottom-right-radius: 3px;
  box-shadow: 0 4px 14px rgba(201, 162, 75, 0.25);
}

.hws-msg-time {
  font-size: 10px;
  color: #64748B;
  margin-top: 4px;
  font-family: monospace;
}
.hws-msg.user .hws-msg-time {
  align-self: flex-end;
}

/* Quick Prompt Suggestions */
.hws-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.hws-chip {
  background: #111827;
  border: 1px solid #2E3A52;
  color: #C9A24B;
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.hws-chip:hover {
  background: #C9A24B;
  color: #111827;
  border-color: #C9A24B;
  transform: translateY(-1px);
}

/* WhatsApp Handoff Bubble Action */
.hws-wa-handoff-card {
  margin-top: 8px;
  background: #0B221B;
  border: 1px solid #10B98155;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hws-wa-handoff-card p {
  margin: 0;
  font-size: 12px;
  color: #A7F3D0;
  line-height: 1.4;
}
.hws-wa-send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #25D366;
  color: #064E3B;
  font-weight: 700;
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s ease;
}
.hws-wa-send-btn:hover {
  background: #22C55E;
}
.hws-wa-send-btn svg {
  width: 15px;
  height: 15px;
  fill: #064E3B;
}

/* Typing indicator */
.hws-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #161F30;
  border: 1px solid #263044;
  border-radius: 12px;
  width: fit-content;
}
.hws-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C9A24B;
  animation: hwsTyping 1.4s infinite;
}
.hws-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.hws-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes hwsTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Chat Input Footer */
.hws-chat-footer {
  padding: 12px 14px;
  background: #111827;
  border-top: 1px solid #1F2937;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hws-chat-input {
  flex: 1;
  background: #0B0F19;
  border: 1px solid #2E3A52;
  border-radius: 8px;
  padding: 9px 12px;
  color: #FFFFFF;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.hws-chat-input:focus {
  border-color: #C9A24B;
}
.hws-chat-input::placeholder {
  color: #64748B;
}
.hws-chat-send {
  background: #C9A24B;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #111827;
  transition: all 0.2s ease;
}
.hws-chat-send:hover {
  background: #E7CE8F;
  transform: scale(1.04);
}
.hws-chat-send svg {
  width: 17px;
  height: 17px;
  fill: #111827;
}

/* Settings Modal for OpenAI Key */
.hws-settings-modal {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(8px);
  z-index: 1050;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.hws-settings-modal.active {
  opacity: 1;
  pointer-events: all;
}
.hws-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #F8FAFC;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hws-modal-body {
  margin-top: 14px;
}
.hws-modal-label {
  font-size: 12px;
  color: #94A3B8;
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}
.hws-modal-input {
  width: 100%;
  background: #111827;
  border: 1px solid #2E3A52;
  border-radius: 6px;
  padding: 9px 12px;
  color: #FFFFFF;
  font-size: 13px;
  font-family: monospace;
  box-sizing: border-box;
}
.hws-modal-hint {
  font-size: 11px;
  color: #64748B;
  margin-top: 6px;
  line-height: 1.4;
}
.hws-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.hws-modal-save {
  flex: 1;
  background: #C9A24B;
  color: #111827;
  font-weight: 700;
  font-size: 13px;
  padding: 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}
.hws-modal-cancel {
  background: transparent;
  color: #94A3B8;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid #2E3A52;
  cursor: pointer;
}

/* Responsive tweaks for mobile viewports */
@media (max-width: 480px) {
  .hws-chat-window {
    left: 10px;
    right: auto;
    bottom: 78px;
    width: calc(100vw - 20px);
    height: calc(100vh - 96px);
    border-radius: 12px;
  }
  .hws-ai-launcher {
    left: 14px;
    right: auto;
    bottom: 20px;
    width: 50px;
    height: 50px;
  }
}

/* ============================================================
   Proactive AI "Book a Call" Side Notification
   ============================================================ */
.hws-ai-proactive-card {
  position: fixed;
  bottom: 88px;
  left: 22px;
  z-index: 998;
  width: 320px;
  background: linear-gradient(145deg, #161F30 0%, #0E1422 100%);
  border: 1.5px solid #C9A24B;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.55), 0 0 20px rgba(201,162,75,0.22);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #E9EAF0;
}
.hws-ai-proactive-card.show {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.hws-proactive-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #2E3A52;
  background: rgba(17,24,39,0.7);
  color: #94A3B8;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: .2s;
}
.hws-proactive-close:hover {
  background: #C9A24B;
  color: #111827;
  border-color: #C9A24B;
}
.hws-proactive-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.hws-proactive-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #C9A24B;
  color: #111827;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(201,162,75,0.4);
}
.hws-proactive-title {
  font-size: 13px;
  font-weight: 700;
  color: #F8FAFC;
}
.hws-proactive-sub {
  font-size: 10.5px;
  color: #10B981;
  font-family: 'IBM Plex Mono', monospace;
}
.hws-proactive-body {
  font-size: 12.5px;
  line-height: 1.55;
  color: #CBD5E1;
  margin-bottom: 12px;
}
.hws-proactive-body strong {
  color: #F8FAFC;
}
.hws-proactive-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hws-proactive-btn-book {
  background: #C9A24B;
  color: #111827;
  border: none;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: .2s;
  box-shadow: 0 4px 12px rgba(201,162,75,0.3);
}
.hws-proactive-btn-book:hover {
  background: #E7CE8F;
  transform: translateY(-1px);
}
.hws-proactive-btn-chat {
  background: rgba(255,255,255,0.06);
  color: #E2E8F0;
  border: 1px solid #2E3A52;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}
.hws-proactive-btn-chat:hover {
  border-color: #C9A24B;
  color: #C9A24B;
}
@media (max-width: 480px) {
  .hws-ai-proactive-card {
    left: 12px;
    bottom: 78px;
    width: calc(100vw - 24px);
  }
}
