/* ==========================================================================
   Maya AI Chatbot Widget Styling
   ========================================================================== */

.maya-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 100px; /* Placed cleanly to the left of the WhatsApp button */
  z-index: 1100;
  font-family: var(--font-main, system-ui, sans-serif);
}

/* Trigger Button */
.maya-trigger-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #15803d 0%, #0b4d79 100%);
  color: #ffffff;
  border: none;
  padding: 8px 18px 8px 10px;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(21, 128, 61, 0.4), 0 8px 10px -6px rgba(11, 77, 121, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.maya-trigger-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 30px -5px rgba(21, 128, 61, 0.5);
}

.maya-avatar-ring {
  width: 46px;
  height: 46px;
  background: #ffffff;
  color: #15803d;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.maya-avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid #ffffff;
}

.maya-online-dot {
  position: absolute;
  top: 0px;
  right: 0px;
  width: 13px;
  height: 13px;
  background-color: #22c55e;
  border: 2px solid #ffffff;
  border-radius: 50%;
  z-index: 3;
  animation: mayaPulse 2s infinite;
}

@keyframes mayaPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.maya-trigger-label {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}

.maya-trigger-label strong {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.maya-trigger-label small {
  font-size: 0.75rem;
  color: #86efac;
}

/* Chat Box Window */
.maya-chat-box {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1200;
}

.maya-chat-box.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.maya-chat-header {
  background: linear-gradient(135deg, #15803d 0%, #0b4d79 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.maya-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.maya-header-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.maya-header-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.maya-header-online {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 11px;
  height: 11px;
  background-color: #4ade80;
  border: 2px solid #ffffff;
  border-radius: 50%;
  z-index: 2;
}

.maya-header-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.maya-header-subtitle {
  font-size: 0.75rem;
  color: #86efac;
}

.maya-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.maya-close-btn:hover { background: rgba(255, 255, 255, 0.3); }

/* Messages Area */
.maya-messages-area {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background-color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.maya-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: mayaMsgSlide 0.25s ease;
}

@keyframes mayaMsgSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.maya-user-msg {
  align-self: flex-end;
}

.maya-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  word-break: break-word;
}

.maya-bot-msg .maya-bubble {
  background-color: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 3px;
}

.maya-user-msg .maya-bubble {
  background-color: #15803d;
  color: #ffffff;
  border-bottom-right-radius: 3px;
}

/* Quick Action Chips */
.maya-chips-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.maya-chip {
  background: #ffffff;
  color: #15803d;
  border: 1px solid #86efac;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.maya-chip:hover {
  background: #dcfce7;
  border-color: #15803d;
  transform: translateX(4px);
}

/* Typing Indicator */
.maya-typing-indicator {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 8px 20px;
  background-color: #f8fafc;
  color: #64748b;
  font-size: 0.8rem;
}

.maya-typing-indicator.active {
  display: flex;
}

.maya-typing-indicator span {
  width: 6px;
  height: 6px;
  background-color: #15803d;
  border-radius: 50%;
  animation: mayaDotBounce 1.4s infinite ease-in-out both;
}

.maya-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.maya-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes mayaDotBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Input Form */
.maya-input-form {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.maya-input-field {
  flex: 1;
  border: 1px solid #cbd5e1;
  padding: 10px 14px;
  border-radius: 24px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.maya-input-field:focus {
  border-color: #15803d;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.15);
}

.maya-send-btn {
  width: 40px;
  height: 40px;
  background-color: #15803d;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.maya-send-btn:hover { background-color: #166534; transform: scale(1.05); }
.maya-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.maya-footer-note {
  text-align: center;
  font-size: 0.72rem;
  color: #94a3b8;
  padding: 6px 12px 8px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}

/* Responsive */
@media (max-width: 768px) {
  .maya-chat-widget {
    right: 16px;
    bottom: 18px;
  }
  .maya-trigger-label {
    display: none; /* Icon-only trigger on mobile */
  }
  .maya-trigger-btn {
    padding: 6px;
    border-radius: 50%;
  }
  .maya-chat-box {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    z-index: 9999;
    overflow-x: hidden;
  }
}
