/* AI Travel Assistant — visual system aligned with Fly Junction */

.fj-ai-root {
  --ai-navy: #0b1f3a;
  --ai-blue: #1261a0;
  --ai-sky: #38bdf8;
  --ai-orange: #f59e0b;
  --ai-bg: #f8fafc;
  --ai-text: #0f172a;
  --ai-muted: #64748b;
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9999;
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}

.fj-ai-fab {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 0;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #1261a0 0%, #0b1f3a 100%);
  border-radius: 999px;
  padding: 0.85rem 1.1rem 0.85rem 0.9rem;
  box-shadow: 0 16px 40px -16px rgba(11, 31, 58, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fj-ai-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px -16px rgba(11, 31, 58, 0.75);
}

.fj-ai-fab-icon {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(56, 189, 248, 0.18);
}

.fj-ai-fab-label {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.fj-ai-panel {
  position: absolute;
  right: 0;
  bottom: 4.25rem;
  width: min(380px, calc(100vw - 1.5rem));
  height: min(560px, calc(100vh - 7rem));
  background: #fff;
  border-radius: 1.25rem;
  overflow: hidden;
  display: none;
  flex-direction: column;
  box-shadow: 0 30px 80px -28px rgba(11, 31, 58, 0.55),
    0 0 0 1px rgba(15, 23, 42, 0.06);
}

.fj-ai-panel.is-open {
  display: flex;
  animation: fjAiRise 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fjAiRise {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.fj-ai-header {
  background: linear-gradient(135deg, #0b1f3a 0%, #1261a0 100%);
  color: #fff;
  padding: 1rem 1rem 0.95rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.fj-ai-title {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.fj-ai-subtitle {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
}

.fj-ai-close {
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  cursor: pointer;
}

.fj-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fj-ai-bubble {
  max-width: 88%;
  padding: 0.7rem 0.85rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.fj-ai-bubble.bot {
  align-self: flex-start;
  background: #fff;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-bottom-left-radius: 0.35rem;
  box-shadow: 0 6px 16px -12px rgba(11, 31, 58, 0.35);
}

.fj-ai-bubble.user {
  align-self: flex-end;
  background: #0b1f3a;
  color: #fff;
  border-bottom-right-radius: 0.35rem;
}

.fj-ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.75rem;
  background: #eff6ff;
}

.fj-ai-chip {
  border: 1px solid rgba(18, 97, 160, 0.2);
  background: #fff;
  color: #1261a0;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.fj-ai-chip:hover {
  background: #eff6ff;
  transform: translateY(-1px);
}

.fj-ai-composer {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
}

.fj-ai-composer input {
  flex: 1;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.75rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.875rem;
  outline: none;
}

.fj-ai-composer input:focus {
  border-color: #1261a0;
  box-shadow: 0 0 0 3px rgba(18, 97, 160, 0.12);
}

.fj-ai-send {
  border: 0;
  border-radius: 0.75rem;
  background: #f59e0b;
  color: #fff;
  font-weight: 700;
  padding: 0 0.95rem;
  cursor: pointer;
  box-shadow: 0 10px 20px -12px rgba(245, 158, 11, 0.7);
}

.fj-ai-send:hover {
  background: #d97706;
}

.fj-ai-typing {
  align-self: flex-start;
  display: none;
  gap: 0.25rem;
  padding: 0.55rem 0.75rem;
  background: #fff;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.fj-ai-typing.is-on { display: inline-flex; }

.fj-ai-typing span {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: #94a3b8;
  animation: fjDot 1s infinite ease-in-out;
}

.fj-ai-typing span:nth-child(2) { animation-delay: 0.15s; }
.fj-ai-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes fjDot {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.fj-ai-note {
  font-size: 0.65rem;
  color: #64748b;
  padding: 0 0.85rem 0.65rem;
  background: #fff;
}

@media (max-width: 480px) {
  .fj-ai-root {
    right: 0.75rem;
    bottom: 0.75rem;
  }
  .fj-ai-fab-label { display: none; }
  .fj-ai-fab { padding: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  .fj-ai-panel.is-open { animation: none; }
  .fj-ai-typing span { animation: none; }
}
