/* AI 채팅 버튼 */
.chat-toggle {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 500;
  background: #19191a;
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 12px 18px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  transition: background 0.3s, transform 0.3s;
}
.chat-toggle:hover {
  background: #000;
  transform: translateY(-50%) scale(1.05);
}

/* 채팅 패널 */
.chat-panel {
  position: fixed;
  top: 0;
  right: -51%;
  width: 50%;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  z-index: 400;
  display: flex;
  flex-direction: column;
  transition: right 0.4s ease;
  border-left: 1px solid #eee;
}
.chat-panel.open { right: 0; }

/* 채팅 헤더 */
.chat-header {
  background: #19191a;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  border-bottom: 1px solid #000;
}
.chat-header button {
  background: none;
  color: #fff;
  font-size: 18px;
  border: none;
  cursor: pointer;
}

/* 채팅 본문 */
.chat-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.5;
}


/* 입력창 */
.chat-input {
  border-top: 1px solid #eee;
  padding: 12px;        /* 조금 넉넉하게 */
  display: flex;
  gap: 8px;
  align-items: stretch;  /* textarea와 버튼 높이 맞춤 */
}
.chat-input textarea {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 10px;
  resize: none;      /* 사용자가 크기 조절 못하게 */
  font-size: 0.95rem;
  line-height: 1.4;
  min-height: 90px;  /* 최소 높이 */
  max-height: 240px; /* 최대 높이 */
  overflow-y: auto;  /* 내용 많으면 스크롤 */
}

.chat-input button {
  padding: 0 24px;      /* 좌우 여백 늘림 */
  font-size: 1.05rem;   
  font-weight: 700;
  border-radius: 16px;
  min-width: 80px;
  background: #19191a;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-input button:hover {
  background: #000;
  transform: scale(1.05);    /* 살짝 커지는 효과 */
}

/* 패널 리사이즈 핸들 */
.chat-resizer {
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
  z-index: 10;
}
.chat-resizer:hover { background: rgba(0,0,0,0.05); }





.chat-message { margin-bottom: 12px; padding: 10px 14px; border-radius: 10px; max-width: 100%; }
/* AI 메시지: ChatGPT 스타일, 가로 100%, 배경 제거 */
.chat-message.ai {
  background: none;           /* 배경 제거 */
  color: #111;                /* 텍스트 진하게 */
  align-self: flex-start;     
  border-radius: 0;           /* 둥글기 제거 */
  padding: 12px 0;            /* 위아래 여백만 */
  width: 100%;                /* 가로 100% */
  box-shadow: none;           /* 그림자 제거 */
  font-family: "Inter", "Noto Sans KR", Arial, sans-serif;
  line-height: 1.6;
  white-space: pre-wrap;      /* 줄바꿈 유지 */
  word-break: break-word;     /* 긴 URL, 데이터 줄바꿈 */
}

/* 사용자 메시지 */
.chat-message.user {
  align-self: flex-end;         /* 오른쪽 정렬 */
  background: #f1f1f1;
  color: #111;
  border-radius: 12px;
  padding: 10px 14px;
  margin-left: auto;
  display: flex;
  flex-direction: column;       /* 텍스트와 timestamp 수직 배치 */
  width: fit-content;
  max-width: 75%;
  min-width: 60px;
  font-size: 0.95rem;
  line-height: 1.5;
  font-weight: 500;
  word-break: break-word;
  position: relative;
}

/* timestamp */
.chat-message .timestamp,
.chat-message .timestamp-ai {
  font-size: 0.65rem;
  color: #888;
  margin-top: 4px;
  text-align: right;           /* 오른쪽 하단 */
}


/* AI 메시지 내부 콘텐츠 스타일 */
.ai-content {
  width: 100%;               /* 가로 100% */
  background: none;          /* 배경 없음 */
  color: #111;               /* 기본 텍스트 색상 */
  font-size: 0.95rem;
  line-height: 1.5;
  word-break: break-word;    /* 긴 단어 줄바꿈 */
  white-space: pre-wrap;     /* 줄바꿈 유지 */
}

.ai-content img {
  max-width: 100%;           /* 이미지 크기 가로폭 맞춤 */
  height: auto;
  display: block;
  margin: 6px 0;
}

.ai-content a {
  color: #1976D2;            /* 링크 색상 */
  text-decoration: underline;
}
