/* PixelCode Floating AI Chatbot CSS Stylesheet */

/* ─── Launcher Button ──────────────────────────────────────────────────────── */
.chatbot-launcher-btn {
  position: fixed;            /* MUST be fixed – DO NOT override below */
  bottom: 128px;              /* Floats above call/WhatsApp pill row    */
  right: 24px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #6D5DFB;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;             /* Above everything, including pills       */
  cursor: pointer;
  box-shadow:
    0 8px 24px rgba(109, 93, 251, 0.45),
    0 0 0 0 rgba(109, 93, 251, 0.55);
  outline: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-launcher-btn:hover {
  transform: scale(1.08);
  box-shadow:
    0 12px 32px rgba(109, 93, 251, 0.55),
    0 0 0 0 rgba(109, 93, 251, 0.55);
}

.chatbot-launcher-active {
  background: linear-gradient(135deg, #09090B 0%, #1a1a2e 100%);
  box-shadow: 0 10px 30px rgba(9, 9, 11, 0.4);
}

/* ─── Notification Badge ───────────────────────────────────────────────────── */
.chatbot-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff4757;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(255, 71, 87, 0.55);
  z-index: 100001;
  animation: badge-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes badge-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ─── Notification glow-pulse (calm, non-intrusive) ───────────────────────── */
.chatbot-launcher-bounce {
  animation: chatbot-glow-pulse 2.8s infinite ease-in-out;
}

@keyframes chatbot-glow-pulse {
  0%,  100% { box-shadow: 0 8px 24px rgba(109, 93, 251, 0.40); }
  50%        { box-shadow: 0 8px 32px rgba(109, 93, 251, 0.75), 0 0 0 8px rgba(109, 93, 251, 0.12); }
}

/* ─── Chat Drawer Window ───────────────────────────────────────────────────── */
.chatbot-window-drawer {
  position: fixed;
  bottom: 196px;              /* sits above the launcher button */
  right: 24px;
  width: 360px;
  height: 480px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  z-index: 99998;
  overflow: hidden;
  box-sizing: border-box;
  animation: chatbot-slide-up 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes chatbot-slide-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* Glassmorphism background */
.glass {
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ─── Header ───────────────────────────────────────────────────────────────── */
.chatbot-header {
  background: rgba(255, 255, 255, 0.90);
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-close-btn {
  background: rgba(100, 116, 139, 0.10);
  border: none;
  font-size: 14px;
  color: #64748b;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.chatbot-close-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* ─── Messages Area ────────────────────────────────────────────────────────── */
.chatbot-messages-area {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(248, 250, 252, 0.50);
}

/* Thin custom scrollbar */
.chatbot-messages-area::-webkit-scrollbar        { width: 4px; }
.chatbot-messages-area::-webkit-scrollbar-track  { background: transparent; }
.chatbot-messages-area::-webkit-scrollbar-thumb  { background: rgba(109,93,251,0.3); border-radius: 4px; }

/* ─── Bubbles ───────────────────────────────────────────────────────────────── */
.chat-bubble {
  max-width: 80%;
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.55;
  border-radius: 18px;
  word-wrap: break-word;
}

.bubble-assistant {
  background: #ffffff;
  color: #334155;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(17, 24, 39, 0.06);
}

.bubble-user {
  background: linear-gradient(135deg, #6D5DFB, #3ecff7);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(109, 93, 251, 0.25);
}

/* ─── Typing dots ──────────────────────────────────────────────────────────── */
.typing-indicator-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
}

.typing-indicator-bubble .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #94a3b8;
  display: inline-block;
  animation: dot-pulse 1.2s infinite ease-in-out;
}

@keyframes dot-pulse {
  0%,  100% { transform: scale(0.6); opacity: 0.4; }
  50%        { transform: scale(1.1); opacity: 1;   }
}

/* ─── Input Panel ──────────────────────────────────────────────────────────── */
.chatbot-input-panel {
  padding: 14px 20px;
  background: #ffffff;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13.5px;
  color: #0f172a;
  background: transparent;
}

.chatbot-input::placeholder { color: #94a3b8; }

.chatbot-send-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: transform 0.15s;
}

.chatbot-send-btn:hover { transform: scale(1.1); }

/* ─── Hidden utility ───────────────────────────────────────────────────────── */
.chatbot-hidden { display: none !important; }

/* ─── Mobile ────────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .chatbot-launcher-btn {
    bottom: 128px;
    right: 16px;
    width: 50px;
    height: 50px;
  }

  .chatbot-window-drawer {
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    z-index: 100000;
  }
}
