/* chat-widget.css — floating chat bubble + panel for the AYCs national site.
   Uses the site's own CSS variables (defined in theme.css) so it matches
   automatically: --navy-1, --blue-2, --paper-2, --line, --font-display. */

.ayc-chat-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: var(--font-body, Inter, sans-serif);
}

.ayc-chat-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--grad-brand, var(--navy-1));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px -8px rgba(39, 40, 99, 0.5);
  transition: transform 0.2s ease;
}
.ayc-chat-toggle:hover { transform: translateY(-2px) scale(1.03); }
.ayc-chat-icon-close { display: none; }
.ayc-chat-root.is-open .ayc-chat-icon-open { display: none; }
.ayc-chat-root.is-open .ayc-chat-icon-close { display: block; }

.ayc-chat-panel {
  position: absolute;
  bottom: 74px;
  right: 0;
  width: 340px;
  max-width: calc(100vw - 48px);
  height: 460px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px -12px rgba(39, 40, 99, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.ayc-chat-root.is-open .ayc-chat-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ayc-chat-header {
  background: var(--grad-brand, var(--navy-1));
  color: #fff;
  padding: 16px 18px;
  flex-shrink: 0;
}
.ayc-chat-header-title {
  display: block;
  font-family: var(--font-display, inherit);
  font-size: 1.05rem;
  font-weight: 600;
}
.ayc-chat-header-sub {
  display: block;
  font-size: 0.78rem;
  opacity: 0.85;
  margin-top: 2px;
}

.ayc-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--paper-2, #f5f6fa);
}

.ayc-chat-bubble {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 0.87rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.ayc-chat-bubble-user {
  align-self: flex-end;
  background: var(--blue-2, #3ab8ea);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ayc-chat-bubble-model {
  align-self: flex-start;
  background: #fff;
  color: var(--navy-1, #272863);
  border: 1px solid var(--line, #e3e6ee);
  border-bottom-left-radius: 4px;
}

.ayc-chat-typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 3px;
  border-radius: 50%;
  background: var(--navy-1, #272863);
  opacity: 0.4;
  animation: ayc-chat-bounce 1.2s infinite ease-in-out;
}
.ayc-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.ayc-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ayc-chat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 0.9; }
}

.ayc-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line, #e3e6ee);
  background: #fff;
  flex-shrink: 0;
}
.ayc-chat-input {
  flex: 1;
  border: 1px solid var(--line, #e3e6ee);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.87rem;
  font-family: inherit;
  outline: none;
}
.ayc-chat-input:focus { border-color: var(--blue-2, #3ab8ea); }
.ayc-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: var(--navy-1, #272863);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.ayc-chat-send:hover { background: var(--blue-2, #3ab8ea); }

@media (max-width: 480px) {
  .ayc-chat-root { bottom: 16px; right: 16px; }
  .ayc-chat-panel { width: calc(100vw - 32px); height: calc(100vh - 120px); }
}
