/* ==========================================================================
   EZAARO AI ASSISTANT STYLESHEET
   Floating Launcher, Modern Chat Window, Quick Chips & Lead Modal
   ========================================================================== */

/* Floating Launcher */
.ez-ai-floating-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  background: linear-gradient(135deg, #0d5c46 0%, #167a5e 100%);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  box-shadow: 0 10px 25px -5px rgba(13, 92, 70, 0.4), 0 8px 10px -6px rgba(13, 92, 70, 0.2);
  cursor: pointer;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.ez-ai-floating-launcher:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 32px -4px rgba(13, 92, 70, 0.5);
}

.ez-ai-launcher-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Chat Modal / Window */
.ez-ai-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}

.ez-ai-modal.ez-ai-open {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px;
}

.ez-ai-window {
  width: 100%;
  max-width: 420px;
  height: 600px;
  max-height: calc(100vh - 48px);
  background-color: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: ez-ai-slide-up 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes ez-ai-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
.ez-ai-window-header {
  background: linear-gradient(135deg, #0d5c46 0%, #083d2e 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ez-ai-window-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.875rem;
}

.ez-ai-window-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9375rem;
}

.ez-ai-window-sub {
  font-size: 0.75rem;
  color: #a7f3d0;
}

.ez-ai-header-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-radius: 9999px;
  padding: 4px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 150ms;
}

.ez-ai-header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.ez-ai-window-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

/* Message Thread */
.ez-ai-thread {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background-color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ez-ai-msg {
  max-width: 85%;
  padding: 12px 16px;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-line;
}

.ez-ai-msg-ai {
  align-self: flex-start;
  background-color: #ffffff;
  color: #0f172a;
  border-radius: 16px 16px 16px 4px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ez-ai-msg-user {
  align-self: flex-end;
  background-color: #0d5c46;
  color: #ffffff;
  border-radius: 16px 16px 4px 16px;
}

/* Quick Replies */
.ez-ai-quick-replies {
  padding: 8px 16px;
  background-color: #f8fafc;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid #f1f5f9;
}

.ez-ai-chip {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  transition: all 150ms;
}

.ez-ai-chip:hover {
  background-color: #e6f4f1;
  border-color: #0d5c46;
  color: #0d5c46;
}

/* Lead Form Card Overlay */
.ez-ai-lead-modal {
  padding: 16px;
  background-color: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.ez-ai-lead-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
}

.ez-ai-lead-card h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0d5c46;
  margin-bottom: 4px;
}

.ez-ai-lead-card p {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 12px;
}

.ez-ai-lead-card input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.8125rem;
  margin-bottom: 8px;
  box-sizing: border-box;
}

/* Footer & Input */
.ez-ai-window-footer {
  padding: 12px 16px;
  background-color: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.ez-ai-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ez-ai-input-wrap input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  font-size: 0.875rem;
  outline: none;
}

.ez-ai-input-wrap input:focus {
  border-color: #0d5c46;
}

.ez-ai-send-btn {
  background: #0d5c46;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 150ms;
}

.ez-ai-send-btn:hover {
  background: #083d2e;
}

/* Responsive Modal for Mobile */
@media (max-width: 480px) {
  .ez-ai-modal.ez-ai-open {
    padding: 0;
  }

  .ez-ai-window {
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .ez-ai-floating-launcher {
    bottom: 20px;
    right: 20px;
    padding: 10px 16px;
    font-size: 0.875rem;
  }
}
