/* =========================================================
   The Flying Eagle — Top-Bar Technical AI Assistant
   Starts collapsed below header with live green online dot
   ========================================================= */

@keyframes fePulseOnline {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.75);
  }
  50% {
    opacity: 0.45;
    box-shadow: 0 0 0 6px rgba(74, 222, 128, 0);
  }
}

.fe-ai-top-bar {
  position: relative;
  z-index: 40;
  max-width: 1200px;
  width: 100%;
  box-sizing: border-box;
  margin: 0.75rem auto 0;
  padding: 0 1.5rem;
}

.fe-ai-fab {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 100%;
  box-sizing: border-box;
  background: #1f1f23;
  color: #fafafa;
  border: 1px solid rgba(229, 185, 76, 0.45);
  border-radius: 999px;
  padding: 0.48rem 1rem;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.fe-ai-fab:hover {
  transform: translateY(-1px);
  border-color: #e5b94c;
  background: #27272c;
}

.fe-ai-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #4ade80;
  display: inline-block;
  flex-shrink: 0;
  animation: fePulseOnline 1.5s infinite ease-in-out;
}

.fe-ai-drawer {
  position: relative;
  margin-top: 0.65rem;
  width: 100%;
  max-width: 540px;
  max-height: 460px;
  box-sizing: border-box;
  display: none;
  flex-direction: column;
  background: #1f1f23;
  color: #fafafa;
  border: 1px solid rgba(229, 185, 76, 0.45);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.55);
}

.fe-ai-drawer.open {
  display: flex;
}

.fe-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  background: #121215;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.fe-ai-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.fe-ai-title-wrap strong {
  display: block;
  font-size: 0.94rem;
  color: #e5b94c;
}

.fe-ai-title-wrap span {
  display: block;
  font-size: 0.74rem;
  color: #a1a1aa;
}

.fe-ai-close {
  background: transparent;
  color: #d4d4d8;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.fe-ai-close:hover {
  color: #fafafa;
  border-color: #e5b94c;
}

.fe-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: #18181b;
  min-height: 160px;
}

.fe-ai-msg {
  max-width: 92%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.fe-ai-msg-user {
  align-self: flex-end;
  background: rgba(229, 185, 76, 0.16);
  color: #fafafa;
  border: 1px solid rgba(229, 185, 76, 0.4);
}

.fe-ai-msg-bot {
  align-self: flex-start;
  background: #1f1f23;
  color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.fe-ai-msg-bot a {
  color: #e5b94c;
  font-weight: 600;
}

.fe-ai-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  background: #121215;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

/* 16px font-size prevents iOS/Android Safari & Chrome from auto-zooming on input focus */
.fe-ai-input {
  flex: 1;
  min-width: 0;
  background: #1f1f23;
  color: #fafafa;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 0.58rem 0.75rem;
  font-size: 16px;
  font-family: inherit;
}

.fe-ai-input:focus {
  outline: none;
  border-color: #e5b94c;
}

.fe-ai-send {
  background: #e5b94c;
  color: #121215;
  border: none;
  border-radius: 8px;
  padding: 0 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.fe-ai-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .fe-ai-top-bar {
    padding: 0 1rem;
    margin-top: 0.65rem;
  }

  .fe-ai-fab {
    font-size: 0.84rem;
    padding: 0.46rem 0.9rem;
  }
}
