/* ============================================================
   GoLiveIQ — Ask GoLiveIQ chat interface
   ============================================================ */

/* ---- screen shell ------------------------------------------ */
.chat-screen {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 49px);
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
}

.chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 40px 28px 20px;
  scroll-behavior: smooth;
}

/* ---- welcome state ----------------------------------------- */
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 16px 32px;
  animation: chatFadeUp 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.chat-welcome__logomark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 12px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.chat-welcome__title {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.chat-welcome__sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 32px;
  max-width: 400px;
  line-height: 1.65;
}

/* chip grid: two columns, compact */
.chat-welcome__chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  max-width: 580px;
}

.chat-chip {
  text-align: left;
  padding: 11px 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.12s;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.chat-chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--accent-wash);
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  transform: translateY(-1px);
}

.chat-chip:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ---- messages ---------------------------------------------- */
.chat-msg {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  animation: chatFadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.chat-msg--user {
  justify-content: flex-end;
  gap: 0;
}

.chat-avatar {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* ---- bubbles ----------------------------------------------- */
.chat-bubble {
  line-height: 1.65;
  font-size: 0.9rem;
}

.chat-bubble--user {
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  max-width: 68%;
  border-radius: 14px;
  border-bottom-right-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.55;
  box-shadow: 0 2px 8px rgba(232,93,45,0.25);
}

.chat-bubble--ai {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px 18px 14px;
  flex: 1;
  min-width: 0;
  border-radius: 14px;
  border-top-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.chat-bubble--thinking {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
  flex: none;
}

.chat-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: chatBounce 1.3s ease-in-out infinite;
}
.chat-dot:nth-child(2) { animation-delay: 0.18s; }
.chat-dot:nth-child(3) { animation-delay: 0.36s; }

/* ---- answer content ---------------------------------------- */
.chat-bubble--ai .search-modal__summary {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin: 0 0 12px;
  line-height: 1.65;
  font-weight: 500;
}

.chat-bubble--ai .search-modal__list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-bubble--ai .search-modal__item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--bg-secondary);
  flex-wrap: wrap;
  transition: background 0.14s;
}

.chat-bubble--ai .search-modal__item--link { cursor: pointer; }
.chat-bubble--ai .search-modal__item--link:hover { background: var(--accent-wash); }

.chat-bubble--ai .search-modal__item-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-primary);
  flex: none;
}

.chat-bubble--ai .search-modal__item-detail {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.chat-bubble--ai .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
  align-self: center;
}
.dot--green  { background: var(--status-ok); }
.dot--blue   { background: #3B82F6; }
.dot--red    { background: var(--status-blocked); }
.dot--orange { background: var(--status-progress); }
.dot--grey   { background: var(--status-idle); }

/* ---- source attribution ------------------------------------ */
.answer-source {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}
.answer-source svg { flex: none; opacity: 0.6; }

/* ---- nav button -------------------------------------------- */
.chat-bubble--ai .search-modal__nav-btn {
  margin-top: 12px;
  font-size: 0.8rem;
  padding: 6px 13px;
}

/* ---- composer ---------------------------------------------- */
.chat-composer {
  flex: none;
  padding: 12px 28px 24px;
}

.chat-composer__inner {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 10px 10px 10px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.04);
}

.chat-composer__inner:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash), 0 1px 4px rgba(0,0,0,0.06);
}

.chat-composer__mark {
  flex: none;
  color: var(--text-primary);
  margin-bottom: 5px;
  opacity: 0.7;
}

.chat-composer__input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  resize: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-primary);
  max-height: 140px;
  padding: 2px 0;
}

.chat-composer__input::placeholder { color: var(--text-tertiary); }

.chat-composer__send {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: none;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.14s, transform 0.12s, box-shadow 0.14s;
  box-shadow: 0 2px 6px rgba(232,93,45,0.3);
}
.chat-composer__send:hover {
  opacity: 0.9;
  transform: scale(1.04);
  box-shadow: 0 3px 10px rgba(232,93,45,0.35);
}
.chat-composer__send:active { transform: scale(0.96); opacity: 1; }

.chat-composer__hint {
  text-align: center;
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  margin: 8px 0 0;
  line-height: 1.5;
}

/* ---- animations -------------------------------------------- */
@keyframes chatFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes chatBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

/* ---- responsive -------------------------------------------- */
@media (max-width: 720px) {
  .chat-stream { padding: 24px 16px 16px; }
  .chat-composer { padding: 8px 16px 20px; }
  .chat-welcome { padding: 32px 8px 24px; }
  .chat-welcome__title { font-size: 1.5rem; }
  .chat-welcome__chips { grid-template-columns: 1fr; }
  .chat-bubble--user { max-width: 85%; }
}
