/* ══════════════════════════════════════════════
   FreeMeaner · diagnosis-chat.css
   AI 코치 챗 UI — 기존 디자인 시스템 기반
══════════════════════════════════════════════ */

/* ── 챗 섹션 래퍼 ── */
.chat-section {
  margin: 2rem 0;
  background: var(--white);
  border: 0.5px solid rgba(199,199,204,0.5);
  border-radius: 1.25rem;
  padding: 2rem 2rem 1.5rem;
}

.chat-eyebrow {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.chat-title {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 300;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 0.6rem;
}

.chat-title em {
  font-style: italic;
  color: var(--gold);
}

.chat-desc {
  font-size: 0.82rem;
  color: var(--mist);
  line-height: 1.7;
  margin-bottom: 1.4rem;
}

/* ── 시작 버튼 ── */
.chat-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 0.6rem;
  padding: 0.8rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.chat-start-btn:hover {
  background: var(--ink-soft);
  transform: translateY(-1px);
}

.chat-start-icon {
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── 챗 박스 ── */
.chat-box {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0.5rem;
}

/* ── 메시지 영역 ── */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-height: 380px;
  overflow-y: auto;
  padding: 1rem 0;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 3px;
}
.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(184,147,90,0.3);
  border-radius: 2px;
}

/* ── 메시지 버블 ── */
.chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.chat-msg--user {
  flex-direction: row-reverse;
}

.chat-bubble {
  max-width: 78%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.82rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.chat-msg--assistant .chat-bubble {
  background: var(--gold-pale);
  color: var(--ink);
  border-bottom-left-radius: 0.25rem;
  border: 0.5px solid rgba(184,147,90,0.2);
}

.chat-msg--user .chat-bubble {
  background: var(--ink);
  color: var(--paper);
  border-bottom-right-radius: 0.25rem;
}

/* ── 타이핑 인디케이터 ── */
.typing-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 50%;
  margin: 0 2px;
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

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

/* ── 입력 영역 ── */
.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 0.5px solid rgba(199,199,204,0.4);
}

.chat-input {
  flex: 1;
  background: var(--paper);
  border: 0.5px solid rgba(199,199,204,0.6);
  border-radius: 0.7rem;
  padding: 0.7rem 0.9rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink);
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  min-height: 42px;
  max-height: 120px;
  line-height: 1.55;
}

.chat-input::placeholder {
  color: var(--silver);
}

.chat-input:focus {
  border-color: var(--gold);
}

.chat-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: var(--gold);
  border: none;
  border-radius: 0.6rem;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.chat-send-btn:hover {
  background: #a07e4a;
  transform: translateY(-1px);
}

.chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ── 안내 문구 ── */
.chat-notice {
  font-size: 0.68rem;
  color: var(--silver);
  text-align: center;
  margin-top: 0.8rem;
  letter-spacing: 0.02em;
}

/* ── 모바일 ── */
@media (max-width: 600px) {
  .chat-section {
    padding: 1.5rem 1.2rem 1.2rem;
    border-radius: 1rem;
  }

  .chat-title {
    font-size: 1.3rem;
  }

  .chat-messages {
    max-height: 300px;
  }

  .chat-bubble {
    max-width: 88%;
    font-size: 0.8rem;
  }
}
