/* ============================================
   JORDAN GALL — Website Chatbot Widget (Port 3009)
   Styling for the AI chat widget on jordangall-site
   ============================================ */

/* ---------- Chatbot Widget Container ---------- */
#jg-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Inter', sans-serif;
}

/* Trigger Button */
#jg-chat-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}

#jg-chat-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

#jg-chat-trigger svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Chat Panel */
#jg-chat-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 380px;
  max-height: 500px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

#jg-chat-panel.is-open {
  display: flex;
}

/* Header */
.jg-chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.jg-chat-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.jg-chat-header p {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.9;
}

.jg-chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

/* Messages Area */
.jg-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8f9fa;
  max-height: 350px;
}

.jg-chat-message {
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
}

.jg-chat-message.bot {
  justify-content: flex-start;
}

.jg-chat-message.user {
  justify-content: flex-end;
}

.jg-chat-message .bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.jg-chat-message.bot .bubble {
  background: white;
  color: #333;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-bottom-left-radius: 4px;
}

.jg-chat-message.user .bubble {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.jg-typing {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
}

.jg-typing span {
  width: 8px;
  height: 8px;
  background: #999;
  border-radius: 50%;
  animation: jg-bounce 1.4s infinite ease-in-out;
}

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

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

/* Input Area */
.jg-chat-input {
  padding: 12px 16px;
  background: white;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 8px;
}

.jg-chat-input input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #dee2e6;
  border-radius: 25px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.jg-chat-input input:focus {
  border-color: #667eea;
}

.jg-chat-input button {
  padding: 10px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  transition: opacity 0.2s;
}

.jg-chat-input button:hover {
  opacity: 0.9;
}

/* WhatsApp Fallback */
.jg-whatsapp-fallback {
  padding: 16px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  text-align: center;
}

.jg-whatsapp-fallback p {
  margin: 0 0 12px;
  font-size: 13px;
  color: #6c757d;
}

.jg-whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #25D366;
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

.jg-whatsapp-btn:hover {
  background: #128C7E;
}

/* Responsive */
@media (max-width: 480px) {
  #jg-chat-widget {
    bottom: 16px;
    right: 16px;
  }
  
  #jg-chat-panel {
    width: calc(100vw - 32px);
    max-height: 70vh;
    bottom: 65px;
  }
}
