/* FlyNow AI Chat Widget */
#flybot {
  position: fixed;
  bottom: 90px;
  right: 20px;
  z-index: 9000;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Toggle Button */
#flybot-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

#flybot-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 25px rgba(79, 70, 229, 0.5);
}

.flybot-open #flybot-toggle .flybot-close-icon { display: block; }
.flybot-open #flybot-toggle svg:first-child { display: none; }
.flybot-closed #flybot-toggle .flybot-close-icon { display: none; }

/* Panel */
#flybot-panel {
  position: absolute;
  bottom: 64px;
  right: 0;
  width: 370px;
  height: 480px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.flybot-open #flybot-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
#flybot-header {
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  color: white;
  padding: 1rem 1.2rem;
  flex-shrink: 0;
}

.flybot-header-info {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.flybot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.flybot-header-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.flybot-header-status {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Messages */
#flybot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: #f8fafc;
}

.flybot-msg {
  max-width: 85%;
  padding: 0.7rem 1rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-wrap: break-word;
  animation: flybot-fade 0.3s ease;
}

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

.flybot-msg-bot {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.flybot-msg-user {
  background: #4F46E5;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.flybot-typing {
  padding: 0.8rem 1.2rem;
}

.flybot-dots {
  display: flex;
  gap: 4px;
}

.flybot-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: flybot-bounce 1.2s infinite;
}

.flybot-dots span:nth-child(2) { animation-delay: 0.2s; }
.flybot-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes flybot-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Input */
#flybot-input {
  display: flex;
  gap: 0.5rem;
  padding: 0.8rem;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  flex-shrink: 0;
}

#flybot-text {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 0.88rem;
  outline: none;
  background: #f8fafc;
  color: #1e293b;
  font-family: inherit;
}

#flybot-text:focus {
  border-color: #4F46E5;
  background: #ffffff;
}

#flybot-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #4F46E5;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

#flybot-send:hover {
  background: #4338CA;
}

/* Scrollbar */
#flybot-messages::-webkit-scrollbar { width: 4px; }
#flybot-messages::-webkit-scrollbar-track { background: transparent; }
#flybot-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* Mobile */
@media (max-width: 480px) {
  #flybot { bottom: 10px; right: 10px; }
  #flybot-panel {
    width: calc(100vw - 20px);
    right: 0;
    height: 70vh;
    bottom: 60px;
    border-radius: 14px;
  }
  #flybot-toggle { right: 0; }
}

/* Print: hide */
@media print { #flybot { display: none !important; } }
