/* ============================================================
   CloudFixies — Chat Widget + Agent Playground styles
   ============================================================ */

/* Floating chat launcher */
.cf-chat-launcher {
  position: fixed; bottom: 24px; right: 24px; z-index: 60;
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1.15rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--acc-mag);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 0.9rem;
  cursor: none;
  box-shadow: var(--shadow-brut);
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.cf-chat-launcher:hover { transform: translate(-3px,-3px); box-shadow: 9px 9px 0 var(--ink); }
.cf-chat-launcher .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--acc-lime); border: 1px solid var(--ink);
  animation: cf-pulse 1.4s ease-in-out infinite;
}
@keyframes cf-pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: 0.6; } }
@media (max-width: 640px) { .cf-chat-launcher { bottom: 16px; right: 16px; } }

/* Chat panel */
.cf-chat-panel {
  position: fixed; bottom: 92px; right: 24px; z-index: 61;
  width: 380px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 130px);
  background: var(--bg-2);
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  box-shadow: var(--shadow-brut-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.cf-chat-panel.open { display: flex; animation: cf-in 240ms var(--ease-out); }
@keyframes cf-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

.cf-chat-header {
  padding: 0.9rem 1rem;
  border-bottom: 1.5px solid var(--ink);
  background: var(--ink); color: var(--bg-2);
  display: flex; align-items: center; justify-content: space-between; gap: 0.7rem;
}
.cf-chat-header .who { display: flex; align-items: center; gap: 0.6rem; }
.cf-chat-header .who span:first-child {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--acc-mag);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 12px;
  border: 1.5px solid var(--bg-2);
}
.cf-chat-header .title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; letter-spacing: -0.02em; font-size: 0.95rem; }
.cf-chat-header .sub { font-family: 'JetBrains Mono', monospace; font-size: 10px; opacity: 0.7; letter-spacing: 0.16em; text-transform: uppercase; }
.cf-close { background: transparent; border: 0; color: var(--bg-2); font-size: 1.2rem; cursor: none; padding: 4px 8px; }
.cf-close:hover { color: var(--acc-mag); }

.cf-chat-body {
  flex: 1; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.7rem;
  font-size: 0.92rem; line-height: 1.5;
}
.cf-chat-body::-webkit-scrollbar { width: 6px; }
.cf-chat-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.cf-msg { max-width: 85%; padding: 0.65rem 0.9rem; border-radius: 12px; border: 1.5px solid var(--ink); word-wrap: break-word; white-space: pre-wrap; }
.cf-msg.user { align-self: flex-end; background: var(--acc-blue); color: #fff; border-top-right-radius: 4px; }
.cf-msg.bot  { align-self: flex-start; background: var(--bg); color: var(--ink); border-top-left-radius: 4px; }
.cf-msg.err  { background: var(--acc-coral); color: #fff; border-top-left-radius: 4px; }
.cf-msg strong { font-weight: 700; }
.cf-msg .dots span { display: inline-block; width: 6px; height: 6px; margin: 0 1px; border-radius: 50%; background: var(--ink); animation: cf-dot 1.2s ease-in-out infinite; }
.cf-msg .dots span:nth-child(2) { animation-delay: 0.2s; }
.cf-msg .dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes cf-dot { 0%,60%,100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.cf-suggest {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  padding: 0.7rem 1rem 0.2rem;
}
.cf-suggest button {
  padding: 0.35rem 0.7rem; border: 1.5px solid var(--ink);
  background: var(--bg); color: var(--ink);
  border-radius: 999px;
  font-size: 0.78rem; font-family: 'Space Grotesk', sans-serif; font-weight: 500;
  cursor: none;
}
.cf-suggest button:hover { background: var(--acc-lime); }

.cf-chat-form {
  border-top: 1.5px solid var(--ink);
  padding: 0.6rem;
  display: flex; gap: 0.5rem; align-items: stretch;
  background: var(--bg-3);
}
.cf-chat-form input {
  flex: 1; padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--ink); border-radius: 4px;
  background: var(--bg-2);
  font-family: 'Space Grotesk', sans-serif; font-size: 0.9rem;
}
.cf-chat-form input:focus { outline: none; box-shadow: 3px 3px 0 var(--acc-mag); }
.cf-chat-form button {
  padding: 0 1rem;
  background: var(--acc-blue); color: #fff;
  border: 1.5px solid var(--ink); border-radius: 4px;
  font-weight: 600; font-size: 0.9rem;
  cursor: none;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}
.cf-chat-form button:hover:not(:disabled) { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); }
.cf-chat-form button:disabled { opacity: 0.5; }

/* Agent playground (inside Cloudfixies.AI tab) */
.cf-agent {
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--bg);
  box-shadow: var(--shadow-brut);
  overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 380px;
}
.cf-agent-head {
  background: var(--ink); color: var(--bg-2);
  padding: 0.7rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
}
.cf-agent-body {
  flex: 1; padding: 1rem; overflow-y: auto;
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px; line-height: 1.7;
  color: var(--ink-2);
  max-height: 340px;
}
.cf-agent-body::-webkit-scrollbar { width: 6px; }
.cf-agent-body::-webkit-scrollbar-thumb { background: var(--line); }
.cf-agent-body .trace { color: var(--acc-blue); font-weight: 600; }
.cf-agent-body .policy { color: var(--acc-mag); font-weight: 600; }
.cf-agent-body .action { color: var(--ink); font-weight: 700; }
.cf-agent-body .user-line { color: var(--ink); font-weight: 700; margin-top: 0.4rem; }
.cf-agent-body .bot-line { color: var(--ink-2); }
.cf-agent-body .cursor::after { content: '▌'; color: var(--acc-mag); animation: cf-blink 1s step-end infinite; }
@keyframes cf-blink { 50% { opacity: 0; } }

.cf-agent-form {
  border-top: 1.5px solid var(--ink);
  padding: 0.6rem;
  display: flex; gap: 0.5rem;
  background: var(--bg-3);
}
.cf-agent-form input {
  flex: 1; padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--ink); border-radius: 4px;
  background: var(--bg-2);
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px;
}
.cf-agent-form input:focus { outline: none; box-shadow: 3px 3px 0 var(--acc-mag); }
.cf-agent-form button {
  padding: 0 1rem;
  background: var(--acc-mag); color: #fff;
  border: 1.5px solid var(--ink); border-radius: 4px;
  font-weight: 600; font-size: 0.9rem;
  cursor: none;
  box-shadow: 3px 3px 0 var(--ink);
}
.cf-agent-form button:hover:not(:disabled) { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); }
.cf-agent-form button:disabled { opacity: 0.5; }

/* Testimonial cards */
.testimonial {
  padding: 2rem 1.8rem;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--bg-2);
  box-shadow: var(--shadow-brut);
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 260px;
  transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}
.testimonial:hover { transform: translate(-4px,-4px); box-shadow: 10px 10px 0 var(--ink); }
.testimonial blockquote {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 1.2rem;
}
.testimonial blockquote::before { content: '“'; color: var(--acc-mag); font-size: 2.4rem; line-height: 0; vertical-align: -0.4em; margin-right: 0.15em; }
.testimonial .author { display: flex; align-items: center; gap: 0.8rem; }
.testimonial .avatar {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  color: var(--ink); font-size: 15px;
}
.testimonial .who .name { font-weight: 700; font-size: 0.95rem; }
.testimonial .who .role { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-top: 2px; }
