/* ── Ask Archie page ─────────────────────────────────────────────────────── */

/* ── Hero logo ────────────────────────────────────────────────────────────── */
.ask-hero__logo {
  display: block;
  width: auto;
  max-width: 100px;
  height: auto;
  margin: 0 auto 1rem;
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* ── Suggestion chips ─────────────────────────────────────────────────────── */
.ask-chips {
  max-width: 860px;
  margin: 1.75rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ask-chip {
  background: #fff;
  border: 1.5px solid var(--ugle-blue);
  border-radius: 100px;
  padding: 0.4rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Barlow', sans-serif;
  color: var(--ugle-blue);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ask-chip:hover { background: var(--ugle-blue); color: #fff; }

/* ── Chat wrapper ─────────────────────────────────────────────────────────── */
.ask-outer {
  max-width: 860px;
  margin: 1.75rem auto 0;
  padding: 0 1.5rem 0;
}

#chat-messages {
  background: var(--off-white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  min-height: 280px;
  max-height: 540px;
  overflow-y: auto;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Message rows ─────────────────────────────────────────────────────────── */
.ask-msg {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  animation: ask-fade-up 0.22s ease;
}
@keyframes ask-fade-up {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ask-msg--user { flex-direction: row-reverse; }

/* ── Avatar ───────────────────────────────────────────────────────────────── */
.ask-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
}
.ask-msg--user .ask-avatar           { background: var(--accent); }
.ask-msg--assistant .ask-avatar      { background: transparent; padding: 0; overflow: visible; }
.ask-msg--assistant .ask-avatar img  { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ── Bubbles ──────────────────────────────────────────────────────────────── */
.ask-bubble {
  max-width: 78%;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  font-size: 0.93rem;
  line-height: 1.65;
  font-family: 'Barlow', sans-serif;
}
.ask-msg--user .ask-bubble {
  background: var(--ugle-blue);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.ask-msg--assistant .ask-bubble {
  background: #fff;
  color: var(--text-dark);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
}
.ask-bubble p           { margin: 0 0 0.5em; }
.ask-bubble p:last-child { margin: 0; }
.ask-bubble ul, .ask-bubble ol { margin: 0.4em 0 0.4em 1.2em; }
.ask-bubble li          { margin-bottom: 0.2em; }
.ask-bubble strong      { font-weight: 600; }
.ask-bubble code        { background: var(--off-white); padding: 0.1em 0.3em; border-radius: 3px; font-size: 0.88em; }
.ask-bubble h3          { font-size: 0.97rem; font-weight: 700; margin: 0.7em 0 0.3em; color: var(--ugle-blue); }
.ask-bubble h4          { font-size: 0.92rem; font-weight: 700; margin: 0.6em 0 0.2em; color: var(--ugle-blue); }
.ask-bubble h3:first-child, .ask-bubble h4:first-child { margin-top: 0; }

/* ── Typing indicator ─────────────────────────────────────────────────────── */
.ask-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.65rem 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  border-bottom-left-radius: 3px;
}
.ask-typing span {
  width: 7px;
  height: 7px;
  background: var(--ugle-blue);
  border-radius: 50%;
  animation: ask-blink 1.2s infinite;
}
.ask-typing span:nth-child(2) { animation-delay: 0.2s; }
.ask-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ask-blink {
  0%, 80%, 100% { opacity: 0.2; }
  40%            { opacity: 1; }
}

/* ── Input row ────────────────────────────────────────────────────────────── */
.ask-input-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}
#user-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text-dark);
  resize: none;
  min-height: 48px;
  max-height: 120px;
  line-height: 1.4;
  transition: border-color 0.2s;
}
#user-input:focus { outline: none; border-color: var(--ugle-blue); }

#mic-btn {
  background: var(--ugle-blue);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
#mic-btn:hover        { background: var(--ugle-blue-mid, #1e4a7e); }
#mic-btn.is-listening { background: #c0392b; animation: ask-pulse 1s infinite; }
#mic-btn.is-unsupported { opacity: 0.35; cursor: not-allowed; }
@keyframes ask-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192,57,43,0.4); }
  50%       { box-shadow: 0 0 0 7px rgba(192,57,43,0); }
}

#send-btn {
  background: var(--ugle-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 1.25rem;
  height: 44px;
  font-family: 'Barlow', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
#send-btn:hover    { background: var(--ugle-blue-mid); }
#send-btn:disabled { background: #aaa; cursor: not-allowed; }

/* ── Mic status + voice toggle ────────────────────────────────────────────── */
#mic-status {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
  min-height: 1.1em;
  margin-top: 0.25rem;
}
#mic-status.is-active { color: #c0392b; font-weight: 600; }

#voice-controls {
  text-align: center;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}
#speech-toggle {
  font-size: 0.8rem;
  color: var(--text-light);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  user-select: none;
}
#speech-toggle input { cursor: pointer; }

/* ── Feedback button ──────────────────────────────────────────────────────── */
.ask-feedback {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.ask-feedback__btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.75rem;
  font-family: 'Barlow', sans-serif;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s;
}
.ask-feedback__btn:hover { opacity: 1; color: #c0392b; }
.ask-feedback__thanks { font-size: 0.75rem; color: var(--text-light); font-style: italic; }

/* ── Disclaimer ───────────────────────────────────────────────────────────── */
.ask-disclaimer {
  max-width: 860px;
  margin: 1rem auto 3rem;
  padding: 0 1.5rem;
  font-size: 0.78rem;
  color: var(--text-light);
  text-align: center;
  line-height: 1.6;
}

@media (max-width: 600px) {
  .ask-bubble { max-width: 88%; font-size: 0.88rem; }
  #send-btn span { display: none; }
}
