/* Veridyne Academy — AI assistant widget */

.ai-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 18px;
  border: 1px solid rgba(180, 99, 42, 0.5);
  border-radius: 999px;
  background: var(--ember-bright);
  color: #1a120a;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(180, 99, 42, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.ai-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(180, 99, 42, 0.45); }
.ai-fab:active { transform: translateY(0); }

.ai-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 950;
  width: min(400px, calc(100vw - 32px));
  height: min(600px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg, 22px);
}

.ai-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--glass-border);
}
.ai-head .ai-title { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.ai-head .ai-sub { font-size: 0.72rem; color: var(--bone-50); }

.ai-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-msg { max-width: 88%; padding: 11px 14px; border-radius: 16px; font-size: 0.9rem; line-height: 1.5; }
.ai-msg.user { align-self: flex-end; background: var(--ember-soft); border: 1px solid rgba(180, 99, 42, 0.35); border-bottom-right-radius: 5px; }
.ai-msg.bot { align-self: flex-start; background: rgba(18, 18, 20, 0.5); border: 1px solid var(--bone-08); border-bottom-left-radius: 5px; }
.ai-msg.bot.err { border-color: rgba(200, 90, 70, 0.4); color: #e7b7ad; }
.ai-msg p { margin: 0 0 8px; }
.ai-msg p:last-child { margin-bottom: 0; }
.ai-msg ul { margin: 4px 0 8px; padding-left: 18px; }
.ai-msg li { margin: 2px 0; }
.ai-msg a { color: var(--ember-bright); text-decoration: underline; word-break: break-word; }
.ai-msg code { font-family: var(--font-mono); font-size: 0.85em; background: rgba(0, 0, 0, 0.28); padding: 1px 5px; border-radius: 5px; }

.ai-empty { margin: auto; text-align: center; color: var(--bone-50); font-size: 0.88rem; padding: 20px; }
.ai-chip {
  display: inline-block; margin: 4px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--glass-border); background: rgba(235, 235, 240, 0.05); color: var(--bone-70);
  font-size: 0.8rem; font-family: inherit; transition: border-color 0.15s, color 0.15s;
}
.ai-chip:hover { border-color: rgba(180, 99, 42, 0.5); color: var(--bone); }

.ai-dots span { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--bone-50); animation: ai-blink 1.2s infinite both; }
.ai-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.ai-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--glass-border); }
.ai-input {
  flex: 1; resize: none; max-height: 120px; padding: 11px 13px; border-radius: 13px;
  border: 1px solid var(--glass-border); background: rgba(18, 18, 20, 0.5); color: var(--bone);
  font-family: inherit; font-size: 0.9rem; outline: none; line-height: 1.4;
}
.ai-input:focus { border-color: rgba(180, 99, 42, 0.5); }
.ai-send {
  flex-shrink: 0; width: 44px; border: none; border-radius: 13px; cursor: pointer;
  background: var(--ember-bright); color: #1a120a; display: grid; place-items: center;
}
.ai-send:disabled { opacity: 0.45; cursor: default; }

.ai-disclaimer { padding: 0 14px 10px; font-size: 0.68rem; color: var(--bone-50); text-align: center; }

/* Where the bottom nav shows (<=980) lift the FAB above it so they don't collide */
@media (max-width: 980px) {
  .ai-fab { bottom: 84px; right: 16px; padding: 12px; }
  .ai-fab .ai-fab-label { display: none; }
}
/* On phones the assistant panel becomes a full-width bottom sheet */
@media (max-width: 720px) {
  .ai-panel { right: 0; left: 0; bottom: 0; width: 100vw; height: 82vh; border-radius: 22px 22px 0 0; }
}
