/* ======================================================
   EnrichBuild AI Chatbot Styles
   ====================================================== */

.eb-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Toggle Button */
.eb-chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.4);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  color: white;
}

.eb-chat-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 32px rgba(99, 102, 241, 0.5);
}

.eb-chat-icon-close {
  display: none;
}

.eb-chat-open .eb-chat-icon-open {
  display: none;
}

.eb-chat-open .eb-chat-icon-close {
  display: block;
}

/* Badge */
.eb-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: center;
  animation: eb-pulse 2s infinite;
}

@keyframes eb-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Chat Window */
.eb-chat-window {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 380px;
  height: 520px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s ease;
}

.eb-chat-open .eb-chat-window {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.eb-chat-header {
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
}

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

.eb-chat-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eb-chat-title {
  font-weight: 600;
  font-size: 15px;
}

.eb-chat-status {
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.eb-status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: eb-pulse 2s infinite;
}

.eb-chat-minimize {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: background 0.2s;
}

.eb-chat-minimize:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Messages Container */
.eb-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
}

/* Welcome Message */
.eb-chat-welcome {
  text-align: center;
  padding: 20px;
}

.eb-chat-welcome-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(6, 182, 212, 0.1));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.eb-chat-welcome h4 {
  font-size: 16px;
  color: #1e293b;
  margin: 0 0 8px;
}

.eb-chat-welcome p {
  font-size: 14px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

/* Messages */
.eb-chat-message {
  display: flex;
  gap: 10px;
  max-width: 85%;
  animation: eb-fadeIn 0.3s ease;
}

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

.eb-chat-message.eb-user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.eb-msg-avatar {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}

.eb-msg-content {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.eb-chat-message.eb-bot .eb-msg-content {
  background: white;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.eb-chat-message.eb-user .eb-msg-content {
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: white;
  border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.eb-typing-dots {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.eb-typing-dots span {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  animation: eb-typing 1.4s infinite;
}

.eb-typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.eb-typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes eb-typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Suggestions */
.eb-chat-suggestions {
  padding: 0 20px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #f8fafc;
}

.eb-suggestion {
  padding: 8px 14px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 13px;
  color: #6366f1;
  cursor: pointer;
  transition: all 0.2s;
}

.eb-suggestion:hover {
  background: #6366f1;
  color: white;
  border-color: #6366f1;
}

/* Input Area */
.eb-chat-input-area {
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 12px;
}

.eb-chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.eb-chat-input:focus {
  border-color: #6366f1;
}

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

.eb-chat-send {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: transform 0.2s, box-shadow 0.2s;
}

.eb-chat-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.eb-chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .eb-chat-widget {
    bottom: 16px;
    right: 16px;
  }

  .eb-chat-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .eb-chat-toggle {
    width: 54px;
    height: 54px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .eb-chat-window {
    background: #1e293b;
  }

  .eb-chat-messages {
    background: #0f172a;
  }

  .eb-chat-message.eb-bot .eb-msg-content {
    background: #1e293b;
    color: #f1f5f9;
    border-color: #334155;
  }

  .eb-chat-welcome h4 {
    color: #f1f5f9;
  }

  .eb-chat-welcome p {
    color: #94a3b8;
  }

  .eb-chat-suggestions {
    background: #0f172a;
  }

  .eb-suggestion {
    background: #1e293b;
    border-color: #334155;
  }

  .eb-chat-input-area {
    background: #1e293b;
    border-color: #334155;
  }

  .eb-chat-input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
  }
}
