/* ════════════════════════════════════════════════════════════════
   Chat Page — 5명 샤먼별 컬러 테마
   ════════════════════════════════════════════════════════════════ */

.chat-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
  background: linear-gradient(180deg, #0a0a14 0%, #060611 100%);
  position: relative;
}

/* 샤먼별 컬러 변수 (data-shaman 속성으로 토글) */
body[data-shaman="yeon"]   { --c-acc: #a855f7; --c-acc-soft: rgba(168,85,247,.12); --c-acc-bd: rgba(168,85,247,.35); --c-bg-tint: rgba(168,85,247,.05); }
body[data-shaman="halmae"] { --c-acc: #c084fc; --c-acc-soft: rgba(192,132,252,.12); --c-acc-bd: rgba(192,132,252,.35); --c-bg-tint: rgba(76,29,149,.06); }
body[data-shaman="baek"]   { --c-acc: #f59e0b; --c-acc-soft: rgba(245,158,11,.12); --c-acc-bd: rgba(245,158,11,.35); --c-bg-tint: rgba(120,53,15,.05); }
body[data-shaman="wolha"]  { --c-acc: #ec4899; --c-acc-soft: rgba(236,72,153,.12); --c-acc-bd: rgba(236,72,153,.35); --c-bg-tint: rgba(131,24,67,.05); }
body[data-shaman="chae"]   { --c-acc: #06b6d4; --c-acc-soft: rgba(6,182,212,.12); --c-acc-bd: rgba(6,182,212,.35); --c-bg-tint: rgba(8,51,68,.05); }

.chat-page { background: linear-gradient(180deg, var(--c-bg-tint, rgba(168,85,247,0.04)) 0%, #060611 80%); }

/* ─── 채팅 상단바 (샤먼 정보) ─── */
.chat-topbar {
  position: sticky;
  top: 56px;
  z-index: 50;
  padding: 12px 0;
  background: rgba(10, 10, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.chat-topbar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
}
.ct-back {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  color: white;
  text-decoration: none;
  font-size: 18px;
  flex-shrink: 0;
  transition: background 0.15s;
}
.ct-back:hover { background: rgba(255, 255, 255, 0.1); }

.ct-shaman {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-grow: 1;
  min-width: 0;
}
.ct-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--c-acc, #a855f7);
  flex-shrink: 0;
}
.ct-meta { min-width: 0; flex-grow: 1; }
.ct-line1 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ct-line1 strong {
  font-size: 15px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.01em;
}
.ct-tag {
  padding: 2px 9px;
  background: var(--c-acc-soft, rgba(168,85,247,.12));
  color: var(--c-acc, #a855f7);
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--c-acc-bd, rgba(168,85,247,.35));
}
.ct-model {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  background: rgba(0, 0, 0, 0.3);
  color: #6ee7b7;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.ct-dot {
  width: 6px; height: 6px;
  background: #10b981;
  border-radius: 50%;
}
.ct-line2 {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 3px;
}
.ct-online {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #10b981;
}
.online-dot {
  width: 6px; height: 6px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
}

.ct-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.ct-icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  color: white;
  border-radius: 50%;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s;
}
.ct-icon-btn:hover { background: rgba(255, 255, 255, 0.1); }

/* ─── 메시지 스트림 ─── */
.chat-stream {
  flex-grow: 1;
  padding: 28px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
}

.chat-msg {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 85%;
}
.chat-msg-bot {
  align-self: flex-start;
}
.chat-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.cm-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.cm-bubble {
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: white;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.chat-msg-bot .cm-bubble {
  border-top-left-radius: 4px;
}
.chat-msg-user .cm-bubble {
  background: var(--c-acc-soft, rgba(168,85,247,.18));
  border-color: var(--c-acc-bd, rgba(168,85,247,.35));
  border-top-right-radius: 4px;
}

/* 타이핑 인디케이터 */
.chat-msg-typing .cm-bubble {
  display: flex;
  gap: 4px;
  padding: 14px 18px;
}
.chat-msg-typing .cm-bubble span {
  width: 7px; height: 7px;
  background: var(--c-acc, #a855f7);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
}
.chat-msg-typing .cm-bubble span:nth-child(2) { animation-delay: 0.2s; }
.chat-msg-typing .cm-bubble span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ─── 추천 질문 ─── */
.chat-suggest {
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
  padding: 8px 24px 16px;
}
.cs-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.cs-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cs-chip {
  padding: 8px 14px;
  background: var(--c-acc-soft, rgba(168,85,247,.12));
  color: var(--c-acc, #a855f7);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--c-acc-bd, rgba(168,85,247,.35));
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, background 0.15s;
}
.cs-chip:hover {
  transform: translateY(-1px);
  background: var(--c-acc, #a855f7);
  color: white;
}

/* ─── 입력 영역 ─── */
.chat-input-wrap {
  position: sticky;
  bottom: 0;
  padding: 12px 0 16px;
  background: rgba(10, 10, 20, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.chat-input-inner {
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}
.chat-input {
  flex-grow: 1;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: white;
  font-size: 14px;
  font-family: inherit;
}
.chat-input::placeholder { color: #6b7280; }
.chat-input:focus {
  outline: none;
  border-color: var(--c-acc, #a855f7);
  box-shadow: 0 0 0 3px var(--c-acc-soft);
}

.chat-send {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-acc, #a855f7);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.2s;
}
.chat-send:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px var(--c-acc-soft);
}
.chat-send svg { width: 18px; height: 18px; }

.chat-foot {
  text-align: center;
  font-size: 11px;
  color: #6b7280;
  margin-top: 8px;
}

/* ─── 라이트 모드 ─── */
body.light .chat-page {
  background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
}
body.light .chat-topbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: rgba(168, 85, 247, 0.12);
}
body.light .ct-line1 strong { color: #1f1937; }
body.light .ct-line2 { color: #6b7280; }
body.light .ct-back,
body.light .ct-icon-btn {
  background: rgba(168, 85, 247, 0.06);
  color: #1f1937;
}
body.light .cm-bubble {
  background: white;
  border-color: rgba(168, 85, 247, 0.12);
  color: #1f1937;
  box-shadow: 0 2px 8px rgba(76, 29, 149, 0.04);
}
body.light .chat-input-wrap {
  background: rgba(255, 255, 255, 0.92);
  border-top-color: rgba(168, 85, 247, 0.12);
}
body.light .chat-input {
  background: white;
  border-color: rgba(168, 85, 247, 0.18);
  color: #1f1937;
}
body.light .chat-input::placeholder { color: #9ca3af; }

@media (max-width: 600px) {
  .ct-line1 { gap: 6px; }
  .ct-line1 strong { font-size: 14px; }
  .ct-tag, .ct-model { font-size: 9px; padding: 2px 7px; }
  .chat-msg { max-width: 92%; }
}
