/* AI assistant widget. Uses the theme variables defined in styles.css. */

.ag-toggle {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 60;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--panel);
  color: var(--accent);
  border: 1px solid rgba(124,245,255,.25);
  border-radius: 999px;
  font-size: 20px;
  cursor: pointer;
  box-shadow:
    0 0 12px rgba(18,226,242,.25),
    0 0 24px rgba(18,226,242,.15);
  transition: transform .25s ease, box-shadow .25s ease;
}
.ag-toggle:hover,
.ag-toggle:focus-visible {
  transform: translateY(-2px);
  box-shadow:
    0 0 20px rgba(18,226,242,.45),
    0 0 30px rgba(18,226,242,.35);
}

.ag-panel {
  position: fixed;
  left: 16px;
  bottom: 76px;
  z-index: 60;
  width: min(380px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 110px));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  color: var(--text);
  border: 1px solid rgba(124,245,255,.25);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ag-panel[hidden] { display: none; }

.ag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(124,245,255,.16);
}
.ag-title {
  font-weight: 600;
  color: var(--accent-2);
}
.ag-close {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 16px;
  padding: 4px 6px;
  cursor: pointer;
}
.ag-close:hover { color: var(--text); }

.ag-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ag-msg {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ag-bot {
  align-self: flex-start;
  background: rgba(18,226,242,.08);
  border: 1px solid rgba(124,245,255,.16);
}
.ag-user {
  align-self: flex-end;
  background: rgba(18,226,242,.2);
}
.ag-error { color: var(--danger); }
.ag-typing {
  color: var(--muted);
  animation: agPulse 1.2s ease-in-out infinite;
}
@keyframes agPulse {
  0%, 100% { opacity: .4; }
  50% { opacity: 1; }
}

.ag-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 10px;
}
.ag-starters[hidden] { display: none; }
.ag-chip {
  background: none;
  color: var(--accent);
  border: 1px solid rgba(124,245,255,.3);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}
.ag-chip:hover { background: rgba(18,226,242,.12); }

.ag-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(124,245,255,.16);
}
.ag-input {
  flex: 1;
  resize: none;
  max-height: 90px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid rgba(124,245,255,.25);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
}
.ag-input:focus {
  outline: none;
  border-color: var(--accent);
}
.ag-send {
  width: 40px;
  background: rgba(18,226,242,.15);
  color: var(--accent);
  border: 1px solid rgba(124,245,255,.35);
  border-radius: 10px;
  cursor: pointer;
}

.ag-note {
  margin: 0;
  padding: 0 14px 10px;
  font-size: 11px;
  color: var(--muted);
}
