/* ═══════════════════════════════════════════════════════════════════════
   NANI — Chat Styles
   Chat area, messages, input, steps, rating
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Chat area ───────────────────────────────────────────────────────── */
#chat-area { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 24px 40px;
  display: flex; flex-direction: column; gap: 16px;
}

.welcome {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
}
.welcome h1 {
  font-size: 42px; font-weight: 800; letter-spacing: 8px;
  color: #fff;
}
.welcome-sub { font-size: 15px; color: var(--text-dim); }
.welcome-hint { font-size: 13px; color: var(--text-muted); margin-top: 16px; }

/* ── Messages ────────────────────────────────────────────────────────── */
.msg-row { display: flex; gap: 12px; max-width: 780px; width: 100%; margin: 0 auto; }
.msg-row.user { justify-content: flex-end; }

.msg {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  max-width: 75%;
}
.msg.user {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-l);
  border-bottom-right-radius: 2px;
}
.msg.assistant {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 2px;
}

/* ── Steps progress ──────────────────────────────────────────────────── */
.steps-area { margin-top: 10px; }

.step-line {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-dim); padding: 3px 0;
}
.step-line .step-icon { width: 16px; display: flex; align-items: center; justify-content: center; }
.step-line .step-icon svg { width: 14px; height: 14px; }
.step-line.pending .step-icon { animation: pulse 1s ease-in-out infinite; }
.step-line.done .step-icon { color: var(--accent); }

@keyframes pulse { 0%,100%{opacity:.3} 50%{opacity:1} }

.result-label {
  display: inline-block;
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--accent); margin-bottom: 6px; font-weight: 600;
}

.translation-text { font-size: 16px; line-height: 1.7; }

.total-duration {
  font-size: 11px; color: var(--text-muted); margin-top: 8px;
}

/* ── Rating ──────────────────────────────────────────────────────────── */
.rating-widget { display: flex; align-items: center; gap: 8px; margin-top: 10px; }

.stars { display: flex; gap: 3px; }
.stars .star {
  font-size: 20px; cursor: pointer; color: var(--border-l);
  transition: color .12s; user-select: none;
}
.stars .star.filled { color: var(--accent); }
.stars .star:hover { color: var(--accent-dim); }

.model-answer-box { margin-top: 8px; }
.model-answer-box textarea { min-height: 50px; margin-bottom: 6px; }
.rating-saved { font-size: 11px; color: var(--success); }

/* ── Chat input ──────────────────────────────────────────────────────── */
.chat-input-area {
  padding: 12px 40px 20px;
  flex-shrink: 0;
}

.input-wrap {
  max-width: 780px; margin: 0 auto;
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border-l);
  border-radius: 14px;
  padding: 8px 12px;
  transition: border-color .2s;
}
.input-wrap:focus-within { border-color: var(--accent); }

.input-wrap textarea {
  flex: 1;
  background: none; border: none; outline: none;
  color: var(--text); font-family: var(--font); font-size: 14px;
  resize: none; max-height: 120px;
  line-height: 1.5;
}

.send-btn {
  background: #fff; color: #111; border: none;
  width: 36px; height: 36px; border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .2s;
  flex-shrink: 0;
}
.send-btn svg { width: 18px; height: 18px; }
.send-btn:hover { opacity: .85; }
.send-btn:disabled { opacity: .4; cursor: not-allowed; }

.stop-btn {
  background: #fff; color: #111; border: none;
  width: 36px; height: 36px; border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .2s;
  flex-shrink: 0;
}
.stop-btn svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.stop-btn:hover { opacity: .85; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .chat-messages { padding: 16px; }
  .chat-input-area { padding: 8px 16px 12px; }
}
