/* ======= WEBSY AI CHATBOT STYLES ======= */

:root {
  --chat-bg: rgba(10, 15, 26, 0.92);
  --chat-border: rgba(0, 195, 255, 0.25);
  --chat-primary: #00c3ff;
  --chat-accent: #9d00ff;
  --chat-green: #00ff74;
  --chat-pink: #fc466b;
  --chat-text: #ffffff;
  --chat-text-muted: #a0aec0;
  --chat-user-msg: linear-gradient(135deg, #00c3ff 0%, #3f5efb 100%);
  --chat-bot-msg: rgba(255, 255, 255, 0.08);
}

/* Floating Launcher Button */
#websy-chat-launcher {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  width: 62px !important;
  height: 62px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #00c3ff 0%, #9d00ff 50%, #6a00ff 100%) !important;
  color: #fff !important;
  border: 2px solid #00ff74 !important;
  box-shadow: 0 8px 32px rgba(0, 195, 255, 0.6), 0 0 20px rgba(0, 255, 116, 0.5) !important;
  cursor: pointer !important;
  z-index: 9999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease !important;
}

#websy-chat-launcher:hover {
  transform: scale(1.12) rotate(5deg) !important;
  box-shadow: 0 12px 40px rgba(0, 195, 255, 0.8), 0 0 28px rgba(0, 255, 116, 0.8) !important;
}

#websy-chat-launcher svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  transition: transform 0.3s ease;
}

#websy-chat-launcher.active svg {
  transform: rotate(90deg);
}

/* Notification Badge */
.chat-launcher-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: var(--chat-green);
  border: 2px solid #000;
  border-radius: 50%;
  animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0, 255, 116, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(0, 255, 116, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0, 255, 116, 0); }
}

/* Chat Drawer Window */
#websy-chat-window {
  position: fixed !important;
  bottom: 96px !important;
  right: 24px !important;
  width: 380px !important;
  height: 580px !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100vh - 120px) !important;
  background: var(--chat-bg) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid var(--chat-border) !important;
  border-radius: 24px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(0, 195, 255, 0.25) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  z-index: 9999999 !important;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Roboto', 'Orbitron', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

/* Header */
.chat-header {
  padding: 16px 20px;
  background: rgba(18, 26, 44, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c3ff 0%, #9d00ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Orbitron', sans-serif;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 0 12px rgba(0, 195, 255, 0.5);
}

.chat-header-text h3 {
  margin: 0;
  font-size: 15px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}

.chat-header-text span {
  font-size: 11px;
  color: var(--chat-green);
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: var(--chat-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--chat-green);
}

.chat-close-btn {
  background: transparent;
  border: none;
  color: var(--chat-text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.chat-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Chat Messages Container */
.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 195, 255, 0.3) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 5px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 195, 255, 0.3);
  border-radius: 10px;
}

/* Message Bubble */
.chat-msg {
  max-width: 84%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: fadeInMsg 0.25s ease-out forwards;
}

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

.chat-msg.bot {
  align-self: flex-start;
  background: var(--chat-bot-msg);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 4px;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--chat-user-msg);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 195, 255, 0.3);
}

.chat-msg strong {
  color: #00ff74;
}

.chat-msg a.wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 14px;
  background: #25D366;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
  transition: transform 0.2s, background 0.2s;
}

.chat-msg a.wa-btn:hover {
  transform: translateY(-2px);
  background: #20ba5a;
}

/* Suggestions / Chips */
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px 12px 16px;
  background: rgba(10, 15, 26, 0.5);
}

.chat-chip {
  background: rgba(0, 195, 255, 0.1);
  border: 1px solid rgba(0, 195, 255, 0.3);
  color: #00c3ff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.chat-chip:hover {
  background: var(--chat-primary);
  color: #000;
  font-weight: bold;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 195, 255, 0.4);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: var(--chat-bot-msg);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  align-self: flex-start;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--chat-primary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

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

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

/* Input Area */
.chat-input-area {
  padding: 12px 16px;
  background: rgba(18, 26, 44, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 10px 16px;
  color: #fff;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input:focus {
  border-color: var(--chat-primary);
  box-shadow: 0 0 10px rgba(0, 195, 255, 0.3);
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c3ff 0%, #3f5efb 100%);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 195, 255, 0.3);
  transition: transform 0.2s, background 0.2s;
}

.chat-send-btn:hover {
  transform: scale(1.08);
  background: linear-gradient(135deg, #00ff74 0%, #00c3ff 100%);
  color: #000;
}

.chat-send-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  #websy-chat-window {
    right: 16px;
    bottom: 84px;
    width: calc(100vw - 32px);
    height: 520px;
    border-radius: 20px;
  }

  #websy-chat-launcher {
    right: 16px;
    bottom: 16px;
    width: 54px;
    height: 54px;
  }
}
