/* ===== 챗봇 위젯 전용 CSS (공유) ===== */
:root {
  --card: #1a1a28;
  --surface: #12121a;
  --accent1: #7c6aff;
  --accent2: #ff6ab0;
  --accent3: #6affda;
  --sub: #7a7a9a;
  --glow1: rgba(124,106,255,0.4);
  --glow2: rgba(255,106,176,0.4);
  --glow3: rgba(106,255,218,0.3);
}

/* ===== 챗봇 위젯 ===== */
#chat-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 360px;
  height: 520px;
  z-index: 30;
  display: none;
  flex-direction: column;
  border-radius: 24px;
  overflow: visible;
  background: transparent;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

.widget-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid #2a2a3e;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03);
}

#chat-widget.appear {
  transform: translateY(0);
  opacity: 1;
}

.widget-header {
  background: var(--card);
  border-bottom: 1px solid #2a2a3e;
  display: grid;
  grid-template-columns: 140px 1fr;
  height: 110px;
  position: relative;
  overflow: visible;
}

.header-char-col {
  position: relative;
  overflow: visible;
}

.header-info-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 1rem 0 2.5rem;
  gap: 0.25rem;
}

.widget-char-popup {
  position: absolute;
  left: 8px;
  bottom: 410px;
  top: auto;
  width: 140px;
  height: 320px;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.widget-char-popup img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 8px 24px var(--char-shadow, rgba(124,106,255,0.4)));
  animation: charBob 3s ease-in-out infinite;
  background: transparent;
  mix-blend-mode: normal;
}

.widget-char-popup img.white-bg {
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
}

.widget-char-popup .char-emoji-fallback {
  font-size: 4.5rem;
  animation: charBob 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 16px var(--char-shadow, rgba(124,106,255,0.4)));
  line-height: 1;
  align-self: flex-end;
}

@keyframes charBob {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.widget-name { font-weight: 700; font-size: 0.95rem; color: #e8e8f0; }
.widget-status {
  font-size: 0.72rem;
  color: var(--sub);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.1rem;
}

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4eff91;
  box-shadow: 0 0 6px #4eff91;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  scrollbar-width: thin;
  scrollbar-color: #2a2a3e transparent;
}

.msg {
  max-width: 85%;
  padding: 0.65rem 0.9rem;
  border-radius: 16px;
  font-size: 0.85rem;
  line-height: 1.5;
  animation: msgIn 0.3s ease;
  color: #e8e8f0;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg.bot {
  background: var(--card);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.msg.user {
  background: var(--accent1);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  color: white;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 0.7rem 1rem;
  background: var(--card);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
}

.typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sub);
  animation: typing 1.2s infinite;
}

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

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

.chat-input-area {
  padding: 0.8rem;
  background: var(--card);
  border-top: 1px solid #2a2a3e;
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid #2a2a3e;
  border-radius: 14px;
  padding: 0.6rem 0.9rem;
  color: #e8e8f0;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.85rem;
  resize: none;
  outline: none;
  max-height: 80px;
  transition: border-color 0.2s;
}

.chat-input:focus { border-color: var(--accent1); }
.chat-input::placeholder { color: var(--sub); }

.send-btn {
  width: 38px; height: 38px;
  border-radius: 12px;
  border: none;
  background: var(--accent1);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  font-size: 1rem;
}

.send-btn:hover { background: #6a58ee; transform: scale(1.05); }
.send-btn:active { transform: scale(0.95); }
