/* =========================================================================
   ZENI — ASK ZENI DEMO
   Net-new styles only. Reuses tokens from styles.css.
   ========================================================================= */

/* -------------------------------------------------------------------------
   INTRO SCENE — solid black, no bg image
   ------------------------------------------------------------------------- */
.ask-intro {
  background: var(--space-black);
}

.ask-intro .scene__content {
  max-width: 720px;
}

/* -------------------------------------------------------------------------
   CHAT SURFACE
   ------------------------------------------------------------------------- */
.ask {
  background: var(--space-black);
  padding: 64px 24px 96px;
  display: flex;
  justify-content: center;
}

.ask__inner {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* -------------------------------------------------------------------------
   CHAT LOG — scrolls internally; page itself stays calm
   ------------------------------------------------------------------------- */
.chat__log {
  max-height: 60vh;
  min-height: 320px;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--ghost-border);
  border-radius: var(--radius-sharp);
  background: rgba(0, 0, 0, 0.4);
  scroll-behavior: smooth;
}

.chat__log::-webkit-scrollbar {
  width: 6px;
}

.chat__log::-webkit-scrollbar-thumb {
  background: var(--ghost-border);
  border-radius: 3px;
}

.chat__log::-webkit-scrollbar-track {
  background: transparent;
}

/* -------------------------------------------------------------------------
   MESSAGES
   ------------------------------------------------------------------------- */
.chat__msg {
  display: flex;
  width: 100%;
}

.chat__msg--user {
  justify-content: flex-end;
}

.chat__msg--zeni {
  justify-content: flex-start;
}

.chat__bubble {
  max-width: 80%;
  padding: 14px 20px;
  border: 1px solid var(--ghost-border);
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.55;
  color: var(--spectral-white);
  letter-spacing: var(--track-micro);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.chat__bubble strong {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--track-display);
}

/* USER — right-aligned, ghost-white surface, uppercase */
.chat__msg--user .chat__bubble {
  background: var(--ghost-surface);
  text-transform: uppercase;
  letter-spacing: var(--track-nav);
  border-bottom-right-radius: 8px;
}

/* ZENI — left-aligned, slightly stronger contrast, sentence case for readability */
.chat__msg--zeni .chat__bubble {
  background: rgba(240, 240, 250, 0.16);
  border-color: rgba(240, 240, 250, 0.42);
  text-transform: none;
  letter-spacing: normal;
  border-bottom-left-radius: 8px;
}

/* Reveal animation for new messages */
.chat__msg.is-entering {
  opacity: 0;
  transform: translateY(8px);
}

.chat__msg {
  opacity: 1;
  transform: none;
  transition: opacity 300ms ease, transform 300ms ease;
}

/* -------------------------------------------------------------------------
   TYPING INDICATOR — three staggered dots
   ------------------------------------------------------------------------- */
.chat__typing {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.chat__typing-label {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: var(--track-micro);
  color: var(--spectral-white);
  opacity: 0.7;
}

.chat__dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chat__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--spectral-white);
  opacity: 0.35;
  animation: chat-dot-pulse 1.2s ease-in-out infinite;
}

.chat__dot:nth-child(2) {
  animation-delay: 0.15s;
}

.chat__dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chat-dot-pulse {
  0%, 80%, 100% {
    opacity: 0.25;
    transform: scale(0.85);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* -------------------------------------------------------------------------
   SUGGESTED PROMPTS
   ------------------------------------------------------------------------- */
.ask__prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ask__prompt {
  padding: 12px 20px;
  font-size: 12px;
  flex: 0 1 auto;
}

.ask__prompt[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* -------------------------------------------------------------------------
   INPUT ROW
   ------------------------------------------------------------------------- */
.ask__form {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.ask__field {
  flex: 1 1 auto;
  display: block;
  position: relative;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ask__input {
  width: 100%;
  padding: 18px 24px;
  background: var(--ghost-surface);
  color: var(--spectral-white);
  border: 1px solid var(--ghost-border);
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: var(--track-nav);
  text-transform: uppercase;
  transition: border-color 200ms ease, background-color 200ms ease;
}

.ask__input::placeholder {
  color: rgba(240, 240, 250, 0.55);
  text-transform: uppercase;
  letter-spacing: var(--track-nav);
}

.ask__input:hover {
  border-color: rgba(240, 240, 250, 0.5);
}

.ask__input:focus {
  outline: none;
  border-color: rgba(240, 240, 250, 0.65);
  background: rgba(240, 240, 250, 0.14);
}

.ask__input:focus-visible {
  outline: 2px solid rgba(240, 240, 250, 0.55);
  outline-offset: 3px;
}

.ask__send {
  flex: 0 0 auto;
}

/* -------------------------------------------------------------------------
   REDUCED MOTION
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .chat__log {
    scroll-behavior: auto;
  }

  .chat__msg {
    transition: none;
  }

  .chat__dot {
    animation: none;
    opacity: 0.7;
  }
}

/* -------------------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .ask {
    padding: 40px 16px 64px;
  }

  .chat__log {
    padding: 16px;
    max-height: 55vh;
  }

  .chat__bubble {
    max-width: 88%;
    font-size: 13px;
    padding: 12px 16px;
  }

  .ask__prompts {
    gap: 8px;
  }

  .ask__prompt {
    padding: 10px 14px;
    font-size: 11px;
  }

  .ask__form {
    flex-direction: column;
    gap: 10px;
  }

  .ask__send {
    width: 100%;
  }

  .ask__input {
    padding: 16px 20px;
  }
}
