/* ═══════════════════════════════════════════════════════════════
   Uplift Co — AI Chatbot Widget Styles
   Fully scoped to #uplift-chat-widget — zero impact on main site.
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Root widget container ────────────────────────────────────── */
#uplift-chat-widget {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 9998;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* ── Toggle button ────────────────────────────────────────────── */
#uplift-chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  flex-shrink: 0;
}

#uplift-chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37, 99, 235, 0.55);
}

/* Notification dot */
#uplift-notif-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 13px;
  height: 13px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid white;
  animation: uplift-dot-pulse 2s infinite;
}

@keyframes uplift-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

#uplift-chat-toggle.uplift-bounce {
  animation: uplift-btn-bounce 0.5s ease 3;
}

@keyframes uplift-btn-bounce {
  0%, 100% { transform: scale(1) translateY(0); }
  40%       { transform: scale(1.15) translateY(-6px); }
  70%       { transform: scale(1.05) translateY(-2px); }
}

/* ── Chat window ──────────────────────────────────────────────── */
#uplift-chat-window {
  width: 340px;
  height: 520px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 14px;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

#uplift-chat-window.uplift-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header ───────────────────────────────────────────────────── */
.uplift-header {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  flex-shrink: 0;
}

.uplift-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.uplift-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: white;
}

.uplift-header-name {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  font-family: 'Inter', sans-serif;
}

.uplift-header-status {
  font-size: 11px;
  opacity: 0.82;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-family: 'Inter', sans-serif;
}

.uplift-status-dot {
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.uplift-header-right {
  display: flex;
  gap: 6px;
}

.uplift-icon-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.2s;
  line-height: 1;
  font-family: 'Inter', sans-serif;
}

.uplift-icon-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ── Messages ─────────────────────────────────────────────────── */
.uplift-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f4f7ff;
  scroll-behavior: smooth;
}

.uplift-messages::-webkit-scrollbar        { width: 4px; }
.uplift-messages::-webkit-scrollbar-track  { background: transparent; }
.uplift-messages::-webkit-scrollbar-thumb  { background: #c7d9f8; border-radius: 4px; }

.uplift-msg {
  display: flex;
  gap: 8px;
  max-width: 88%;
  animation: uplift-msg-in 0.2s ease;
}

@keyframes uplift-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.uplift-msg.uplift-bot  { align-self: flex-start; }
.uplift-msg.uplift-user { align-self: flex-end; flex-direction: row-reverse; }

.uplift-msg-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  margin-top: auto;
  letter-spacing: 0.03em;
  font-family: 'Inter', sans-serif;
}

.uplift-bubble {
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
  font-family: 'Inter', sans-serif;
}

.uplift-msg.uplift-bot .uplift-bubble {
  background: #ffffff;
  color: #1e293b;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.uplift-msg.uplift-user .uplift-bubble {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

/* ── Typing indicator ─────────────────────────────────────────── */
.uplift-typing {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  align-self: flex-start;
  animation: uplift-msg-in 0.2s ease;
}

.uplift-typing-bubble {
  background: #ffffff;
  padding: 11px 14px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  display: flex;
  gap: 4px;
  align-items: center;
}

.uplift-dot {
  width: 6px;
  height: 6px;
  background: #93c5fd;
  border-radius: 50%;
  animation: uplift-typing-anim 1.3s infinite ease-in-out;
}
.uplift-dot:nth-child(2) { animation-delay: 0.18s; }
.uplift-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes uplift-typing-anim {
  0%, 60%, 100% { transform: translateY(0);    opacity: 0.4; }
  30%            { transform: translateY(-6px); opacity: 1;   }
}

/* ── Input area ───────────────────────────────────────────────── */
.uplift-input-area {
  padding: 10px 12px;
  background: #ffffff;
  border-top: 1px solid #e8f0fe;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}

#uplift-input {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 9px 13px;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  outline: none;
  resize: none;
  max-height: 90px;
  line-height: 1.45;
  color: #1e293b;
  background: #f8faff;
  transition: border-color 0.2s, background 0.2s;
}

#uplift-input:focus {
  border-color: #2563eb;
  background: #ffffff;
}

#uplift-input::placeholder {
  color: #94a3b8;
  font-family: 'Inter', sans-serif;
}

#uplift-send {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

#uplift-send:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

#uplift-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Footer ───────────────────────────────────────────────────── */
.uplift-footer {
  text-align: center;
  font-size: 10.5px;
  color: #94a3b8;
  padding: 5px 0 8px;
  background: #ffffff;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.01em;
}

/* ── Mobile — full screen overlay ────────────────────────────── */
@media (max-width: 480px) {
  #uplift-chat-widget {
    bottom: 88px; /* sits above WhatsApp button (24px + 56px + 8px gap) */
    right: 24px;  /* matches WhatsApp right: 24px exactly */
  }

  #uplift-chat-toggle {
    width: 52px;
    height: 52px;
  }

  /* Window becomes a full-screen overlay on mobile */
  #uplift-chat-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    margin-bottom: 0;
    z-index: 9999;
  }

  /* Taller header on mobile for easier tap */
  .uplift-header {
    padding: 16px 16px;
    padding-top: calc(16px + env(safe-area-inset-top));
  }

  .uplift-header-name  { font-size: 15px; }
  .uplift-header-avatar { width: 40px; height: 40px; border-radius: 12px; font-size: 13px; }

  .uplift-icon-btn { width: 36px; height: 36px; font-size: 16px; }

  .uplift-messages { padding: 16px 14px; gap: 12px; }

  .uplift-bubble    { font-size: 14px; padding: 10px 14px; }

  .uplift-input-area { padding: 12px 14px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

  #uplift-input { font-size: 15px; padding: 10px 14px; }

  #uplift-send { width: 44px; height: 44px; border-radius: 12px; }
}
