/* ============================================
   LETPILOT CHATBOT WIDGET STYLES
============================================ */

:root {
  --lp-bg: #060c17;
  --lp-surface: #0d1628;
  --lp-surface2: #111d35;
  --lp-border: rgba(255,255,255,0.08);
  --lp-green: #00e87a;
  --lp-green-dim: rgba(0,232,122,0.12);
  --lp-text: #f0f4ff;
  --lp-muted: #8896b3;
  --lp-user-bubble: #00e87a;
  --lp-user-text: #060c17;
  --lp-bot-bubble: #111d35;
  --lp-radius: 18px;
  --lp-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(0,232,122,0.15);
}

/* BUBBLE BUTTON */
#lp-bubble {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  background: var(--lp-green);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0,232,122,0.4), 0 0 0 0 rgba(0,232,122,0.3);
  z-index: 9998;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s ease;
  animation: lp-pulse 3s ease-in-out infinite;
  border: none;
  outline: none;
}
#lp-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(0,232,122,0.55), 0 0 0 0 rgba(0,232,122,0);
  animation: none;
}
@keyframes lp-pulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(0,232,122,0.4), 0 0 0 0 rgba(0,232,122,0.3); }
  50% { box-shadow: 0 8px 32px rgba(0,232,122,0.4), 0 0 0 10px rgba(0,232,122,0); }
}
#lp-bubble svg { transition: transform 0.3s ease; }
#lp-bubble.open svg.chat-icon { display: none; }
#lp-bubble.open svg.close-icon { display: block !important; }

/* NOTIFICATION DOT */
#lp-notif {
  position: fixed;
  bottom: 76px;
  right: 28px;
  background: #ff4757;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  z-index: 9999;
  border: 2px solid var(--lp-bg);
  transition: opacity 0.3s;
}
#lp-notif.hidden { display: none; }

/* CHAT WINDOW */
#lp-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 380px;
  max-height: 580px;
  background: var(--lp-bg);
  border-radius: var(--lp-radius);
  border: 1px solid rgba(0,232,122,0.2);
  box-shadow: var(--lp-shadow);
  display: flex;
  flex-direction: column;
  z-index: 9997;
  font-family: 'Bricolage Grotesque', sans-serif;
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34,1.3,0.64,1), opacity 0.25s ease;
  overflow: hidden;
}
#lp-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}
@media (max-width: 440px) {
  #lp-window { width: calc(100vw - 32px); right: 16px; bottom: 90px; }
  #lp-bubble { right: 16px; bottom: 16px; }
  #lp-notif { right: 16px; }
}

/* HEADER */
#lp-header {
  background: linear-gradient(135deg, #0a1526 0%, #0d1e38 100%);
  padding: 16px 18px;
  border-bottom: 1px solid var(--lp-border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.lp-avatar {
  width: 38px;
  height: 38px;
  background: var(--lp-green);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  font-size: 13px;
  color: #060c17;
  flex-shrink: 0;
}
.lp-header-info { flex: 1; }
.lp-header-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--lp-text);
  letter-spacing: -0.01em;
}
.lp-header-status {
  font-size: 11px;
  color: var(--lp-green);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}
.lp-status-dot {
  width: 6px;
  height: 6px;
  background: var(--lp-green);
  border-radius: 50%;
  animation: lp-blink 2s ease-in-out infinite;
}
@keyframes lp-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.lp-header-badge {
  background: var(--lp-green-dim);
  border: 1px solid rgba(0,232,122,0.25);
  color: var(--lp-green);
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  padding: 3px 7px;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

/* MESSAGES */
#lp-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: #1e2d4a transparent;
  min-height: 0;
}
#lp-messages::-webkit-scrollbar { width: 4px; }
#lp-messages::-webkit-scrollbar-track { background: transparent; }
#lp-messages::-webkit-scrollbar-thumb { background: #1e2d4a; border-radius: 2px; }

.lp-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: lp-msgIn 0.25s cubic-bezier(0.34,1.3,0.64,1);
}
@keyframes lp-msgIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.lp-msg.bot { align-self: flex-start; }
.lp-msg.user { align-self: flex-end; }

.lp-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
}
.lp-msg.bot .lp-bubble {
  background: var(--lp-bot-bubble);
  color: var(--lp-text);
  border: 1px solid var(--lp-border);
  border-bottom-left-radius: 4px;
}
.lp-msg.user .lp-bubble {
  background: var(--lp-green);
  color: var(--lp-user-text);
  font-weight: 500;
  border-bottom-right-radius: 4px;
}
.lp-msg-time {
  font-size: 10px;
  color: var(--lp-muted);
  margin-top: 4px;
  font-family: 'DM Mono', monospace;
  padding: 0 4px;
}
.lp-msg.user .lp-msg-time { align-self: flex-end; }

/* QUICK REPLIES */
#lp-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
  flex-shrink: 0;
}
.lp-qr {
  background: transparent;
  border: 1px solid rgba(0,232,122,0.3);
  color: var(--lp-green);
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.lp-qr:hover {
  background: var(--lp-green-dim);
  border-color: var(--lp-green);
  transform: translateY(-1px);
}

/* TYPING INDICATOR */
.lp-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
  background: var(--lp-bot-bubble);
  border: 1px solid var(--lp-border);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.lp-typing span {
  width: 6px;
  height: 6px;
  background: var(--lp-muted);
  border-radius: 50%;
  animation: lp-typing 1.2s ease-in-out infinite;
}
.lp-typing span:nth-child(2) { animation-delay: 0.2s; }
.lp-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes lp-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* INPUT AREA */
#lp-input-area {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--lp-border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: var(--lp-surface);
  flex-shrink: 0;
}
#lp-input {
  flex: 1;
  background: var(--lp-surface2);
  border: 1px solid var(--lp-border);
  border-radius: 12px;
  color: var(--lp-text);
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 13.5px;
  padding: 10px 14px;
  outline: none;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  line-height: 1.4;
  transition: border-color 0.2s;
}
#lp-input::placeholder { color: var(--lp-muted); }
#lp-input:focus { border-color: rgba(0,232,122,0.4); }
#lp-send {
  width: 40px;
  height: 40px;
  background: var(--lp-green);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
#lp-send:hover { background: #00ff87; transform: scale(1.05); }
#lp-send:active { transform: scale(0.95); }

/* POWERED BY */
.lp-powered {
  text-align: center;
  font-size: 10px;
  color: #2a3a58;
  padding: 6px 0 10px;
  font-family: 'DM Mono', monospace;
  flex-shrink: 0;
  background: var(--lp-surface);
}
.lp-powered a { color: #2a3a58; text-decoration: none; }

/* CTA BUTTON IN CHAT */
.lp-cta-btn {
  display: inline-block;
  margin-top: 8px;
  background: var(--lp-green);
  color: #060c17;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
}
.lp-cta-btn:hover { background: #00ff87; transform: translateY(-1px); }
