/* PCoD Club Agent chat box. Colors follow the pcd_modern template. */
.pcodagent {
  --pa-navy: #0b2545;
  --pa-blue: #1d4f9a;
  --pa-soft: #e8eef8;
  --pa-gold: #c9a227;
  --pa-ink: #1b2533;
  --pa-muted: #5b6676;
  --pa-line: #e3e8ef;
  --pa-bg: #f5f7fb;
  --pa-card: #ffffff;
  --pa-err: #a01818;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  font: 16px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--pa-ink);
}
.pcodagent *, .pcodagent *::before, .pcodagent *::after { box-sizing: border-box; }

.pcodagent-launch {
  display: flex; align-items: center; gap: 10px;
  margin-left: auto;
  padding: 12px 18px;
  border: 0; border-radius: 999px;
  background: var(--pa-navy); color: #fff;
  font: 600 15px/1.2 inherit; font-family: inherit;
  box-shadow: 0 12px 40px rgba(11, 37, 69, .25);
  cursor: pointer;
}
.pcodagent-launch:hover { background: var(--pa-blue); }
.pcodagent-launch:focus-visible, .pcodagent button:focus-visible, .pcodagent-input:focus-visible {
  outline: 3px solid var(--pa-gold); outline-offset: 2px;
}
.pcodagent-launch svg { color: var(--pa-gold); flex: none; }
.pcodagent.is-open .pcodagent-launch { display: none; }

.pcodagent-panel {
  display: flex; flex-direction: column;
  width: 400px; max-width: calc(100vw - 32px);
  height: 600px; max-height: calc(100vh - 40px);
  background: var(--pa-card);
  border: 1px solid var(--pa-line); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(11, 37, 69, .22);
  overflow: hidden;
}
.pcodagent-panel[hidden] { display: none; }

.pcodagent-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px 12px 16px;
  background: var(--pa-navy); color: #fff;
  border-bottom: 3px solid var(--pa-gold);
}
.pcodagent .pcodagent-head .pcodagent-title {
  flex: 1; margin: 0; padding: 0; border: 0;
  font: 600 16px/1.3 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0; text-transform: none; color: #fff;
}
.pcodagent .pcodagent-head .pcodagent-title::after, .pcodagent .pcodagent-head .pcodagent-title::before { content: none; display: none; }
.pcodagent-icon {
  border: 1px solid rgba(255, 255, 255, .35); border-radius: 8px;
  background: transparent; color: #fff;
  padding: 4px 10px; font: 500 13px/1.4 inherit; font-family: inherit; cursor: pointer;
}
.pcodagent-close { font-size: 20px; line-height: 1; padding: 2px 10px 4px; }
.pcodagent-icon:hover { background: rgba(255, 255, 255, .12); }

.pcodagent-log { flex: 1; overflow-y: auto; padding: 16px; background: var(--pa-bg); }
.pcodagent-msg {
  max-width: 88%; margin: 0 0 12px; padding: 10px 14px;
  border-radius: 14px; overflow-wrap: anywhere; font-size: 15px;
}
.pcodagent-msg p { margin: 0 0 8px; }
.pcodagent-msg p:last-child, .pcodagent-msg ul:last-child { margin-bottom: 0; }
.pcodagent-msg ul { margin: 0 0 8px; padding-left: 20px; }
.pcodagent-msg li { margin: 2px 0; }
.pcodagent-msg a { color: var(--pa-blue); text-decoration: underline; }
.pcodagent-assistant { background: var(--pa-card); border: 1px solid var(--pa-line); border-bottom-left-radius: 4px; }
.pcodagent-user { margin-left: auto; background: var(--pa-blue); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.pcodagent-error { background: #fde8e8; color: var(--pa-err); }

.pcodagent-suggest { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 0 0 12px; }
.pcodagent-chip {
  border: 1px solid var(--pa-blue); border-radius: 999px;
  background: var(--pa-soft); color: var(--pa-navy);
  padding: 6px 12px; font: 500 14px/1.35 inherit; font-family: inherit; text-align: left; cursor: pointer;
}
.pcodagent-chip:hover { background: #d8e3f4; }

.pcodagent-typing { display: inline-flex; gap: 4px; align-items: center; }
.pcodagent-typing span:not(.pcodagent-sr) {
  width: 7px; height: 7px; border-radius: 50%; background: var(--pa-muted);
  animation: pcodagent-dot 1.2s infinite ease-in-out;
}
.pcodagent-typing span:nth-child(2) { animation-delay: .15s; }
.pcodagent-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes pcodagent-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .pcodagent-typing span { animation: none !important; } }
.pcodagent-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.pcodagent-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--pa-line); background: var(--pa-card); }
.pcodagent-input {
  flex: 1; resize: none; min-height: 44px; max-height: 120px; overflow-y: auto; scrollbar-width: thin;
  padding: 10px 12px; border: 1px solid #c5cedb; border-radius: 8px;
  font: 16px/1.4 inherit; font-family: inherit; color: var(--pa-ink); background: #fff;
}
.pcodagent-send {
  border: 0; border-radius: 8px; padding: 0 16px; min-height: 44px;
  background: var(--pa-gold); color: var(--pa-navy); font: 700 15px/1 inherit; font-family: inherit; cursor: pointer;
}
.pcodagent-send:hover { background: #a8851a; color: #fff; }
.pcodagent-send:disabled { opacity: .6; cursor: wait; }
.pcodagent-note { margin: 0; padding: 0 12px 10px; font-size: 12px; color: var(--pa-muted); background: var(--pa-card); }

@media (max-width: 520px) {
  .pcodagent { right: 12px; bottom: 12px; left: 12px; }
  .pcodagent.is-open { top: 12px; }
  .pcodagent-panel { width: 100%; max-width: none; height: 100%; max-height: none; }
  .pcodagent-launch-text { font-size: 14px; }
  .pcodagent:not(.is-open) { left: auto; }
}
@media print { .pcodagent { display: none !important; } }
