/* /public/css/aicost-chat-floating.css
   Floating AICost Genie chat — bubble + slide-up panel.
   Scoped under #aic-fc-root so it can't leak to inline #aicostChat on home. */

#aic-fc-root {
  --aic-fc-green:    #00b894;
  --aic-fc-green-d:  #008d71;
  --aic-fc-gold:     #fbbf24;
  --aic-fc-cream:    #ffffff;
  --aic-fc-cream-2:  #fbfbfd;
  --aic-fc-ink:      #1d1d1f;
  --aic-fc-ink-soft: #424245;
  --aic-fc-line:     #d2d2d7;
  position: fixed;
  bottom: 0; right: 0;
  z-index: 9998;            /* below modals (9999+), above page chrome */
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
}

/* ─── Bubble (closed state) ──────────────────────────────────────── */
#aic-fc-root .aic-fc-bubble {
  position: fixed;
  bottom: 22px; right: 22px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px 12px 14px;
  background: var(--aic-fc-green);
  color: #fff;
  border: 0; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(44,122,79,.35), 0 2px 6px rgba(0,0,0,.12);
  cursor: pointer;
  font-weight: 700; font-size: 14px; letter-spacing: .01em;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
#aic-fc-root .aic-fc-bubble:hover {
  background: var(--aic-fc-green-d);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(44,122,79,.45), 0 2px 6px rgba(0,0,0,.15);
}
#aic-fc-root .aic-fc-bubble-icon { font-size: 22px; line-height: 1; }
#aic-fc-root .aic-fc-bubble-label { white-space: nowrap; }
#aic-fc-root .aic-fc-bubble-pulse {
  position: absolute; top: 6px; right: 8px;
  width: 10px; height: 10px;
  background: var(--aic-fc-gold);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(251,191,36,.7);
  animation: aic-fc-pulse 2.2s infinite;
}
@keyframes aic-fc-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(251,191,36,.65); }
  70%  { box-shadow: 0 0 0 12px rgba(251,191,36,0); }
  100% { box-shadow: 0 0 0 0   rgba(251,191,36,0); }
}

/* Hide bubble when panel is open */
#aic-fc-root.is-open .aic-fc-bubble { display: none; }

/* ─── Panel (open state) ────────────────────────────────────────── */
#aic-fc-root .aic-fc-panel {
  position: fixed;
  bottom: 22px; right: 22px;
  width: 380px; max-width: calc(100vw - 24px);
  height: 560px; max-height: calc(100vh - 44px);
  display: none;
  flex-direction: column;
  background: var(--aic-fc-cream);
  border: 1px solid var(--aic-fc-line);
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.22), 0 4px 14px rgba(0,0,0,.08);
  overflow: hidden;
  animation: aic-fc-rise .22s cubic-bezier(.2,.7,.3,1);
}
#aic-fc-root.is-open .aic-fc-panel { display: flex; }
@keyframes aic-fc-rise {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

#aic-fc-root .aic-fc-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--aic-fc-green) 0%, #1f5a3a 100%);
  color: #fff;
}
#aic-fc-root .aic-fc-header-avatar {
  font-size: 24px; line-height: 1;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.14);
  border-radius: 50%;
}
#aic-fc-root .aic-fc-header-text { flex: 1; min-width: 0; }
#aic-fc-root .aic-fc-header-name { font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
#aic-fc-root .aic-fc-header-hl   { color: var(--aic-fc-gold); }
#aic-fc-root .aic-fc-header-tagline { font-size: 11.5px; opacity: .82; margin-top: 1px; }
#aic-fc-root .aic-fc-close {
  background: none; border: 0; color: #fff;
  width: 32px; height: 32px; border-radius: 8px;
  font-size: 24px; line-height: 1; cursor: pointer;
  opacity: .85; transition: opacity .15s, background .15s;
}
#aic-fc-root .aic-fc-close:hover { opacity: 1; background: rgba(255,255,255,.12); }

/* Thread */
#aic-fc-root .aic-fc-thread {
  flex: 1; overflow-y: auto; padding: 14px 14px 6px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: #d4c4a0 transparent;
}
#aic-fc-root .aic-fc-thread::-webkit-scrollbar { width: 6px; }
#aic-fc-root .aic-fc-thread::-webkit-scrollbar-thumb { background: #d4c4a0; border-radius: 3px; }

#aic-fc-root .aic-fc-msg {
  max-width: 86%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13.5px; line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}
#aic-fc-root .aic-fc-msg-bot {
  align-self: flex-start;
  background: #fff;
  color: var(--aic-fc-ink);
  border: 1px solid var(--aic-fc-line);
  border-bottom-left-radius: 4px;
}
#aic-fc-root .aic-fc-msg-bot a { color: var(--aic-fc-green); font-weight: 600; }
#aic-fc-root .aic-fc-msg-bot a:hover { text-decoration: underline; }
#aic-fc-root .aic-fc-msg-user {
  align-self: flex-end;
  background: var(--aic-fc-green);
  color: #fff;
  border-bottom-right-radius: 4px;
}
#aic-fc-root .aic-fc-msg-system {
  align-self: center;
  background: transparent;
  color: var(--aic-fc-ink-soft);
  font-size: 12px;
  font-style: italic;
  text-align: center;
  max-width: 100%;
}
#aic-fc-root .aic-fc-msg-typing {
  align-self: flex-start;
  display: inline-flex; gap: 4px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--aic-fc-line);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}
#aic-fc-root .aic-fc-msg-typing span {
  width: 6px; height: 6px;
  background: #a1a1a6; border-radius: 50%;
  animation: aic-fc-bounce 1.3s infinite ease-in-out;
}
#aic-fc-root .aic-fc-msg-typing span:nth-child(2) { animation-delay: .15s; }
#aic-fc-root .aic-fc-msg-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes aic-fc-bounce {
  0%, 80%, 100% { transform: scale(.6); opacity: .4; }
  40%           { transform: scale(1);  opacity: 1; }
}

/* Suggestions row (rendered initially with quick prompts) */
#aic-fc-root .aic-fc-suggestions {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px 14px 10px;
}
#aic-fc-root .aic-fc-suggestion {
  background: #fff;
  border: 1px solid var(--aic-fc-line);
  color: var(--aic-fc-ink);
  font-size: 12px; font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
#aic-fc-root .aic-fc-suggestion:hover {
  border-color: var(--aic-fc-green);
  background: var(--aic-fc-cream-2);
}

/* Composer */
#aic-fc-root .aic-fc-composer {
  display: flex; gap: 8px; padding: 10px 12px 12px;
  border-top: 1px solid var(--aic-fc-line);
  background: #fff;
}
#aic-fc-root .aic-fc-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--aic-fc-line);
  border-radius: 999px;
  background: var(--aic-fc-cream);
  font-size: 13.5px; font-family: inherit;
  color: var(--aic-fc-ink);
  outline: none;
  transition: border-color .15s, background .15s;
}
#aic-fc-root .aic-fc-input:focus {
  border-color: var(--aic-fc-green);
  background: #fff;
}
#aic-fc-root .aic-fc-send {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: var(--aic-fc-green);
  color: #fff; border: 0; border-radius: 50%;
  cursor: pointer; transition: background .15s, transform .15s;
}
#aic-fc-root .aic-fc-send:hover:not(:disabled)  { background: var(--aic-fc-green-d); }
#aic-fc-root .aic-fc-send:disabled { background: #c9a87c; cursor: not-allowed; opacity: .65; }
#aic-fc-root .aic-fc-send:active:not(:disabled) { transform: scale(.94); }

#aic-fc-root .aic-fc-footer {
  font-size: 10.5px;
  color: #86868b;
  text-align: center;
  padding: 6px 12px 8px;
  background: #fff;
}

/* Mobile */
@media (max-width: 480px) {
  #aic-fc-root .aic-fc-bubble {
    bottom: 16px; right: 14px;
    padding: 11px 16px 11px 12px;
    font-size: 13px;
  }
  #aic-fc-root .aic-fc-bubble-label { display: none; }   /* icon only on phones */
  #aic-fc-root .aic-fc-bubble-icon  { font-size: 24px; }
  #aic-fc-root .aic-fc-panel {
    bottom: 12px; right: 12px;
    width: calc(100vw - 24px);
    height: calc(100vh - 24px); max-height: none;
  }
}
