/* style.css */

/* 공통 초기화 */
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;  /* 원하는 폰트로 변경 가능 */
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

/* 전체 컨테이너: 부드러운 그라디언트 배경 */
.container {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #FFD1DC 0%, #FFEE93 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* 챗 박스 */
.chat_box {
  width: 95%;
  max-width: 600px;
  height: 90%;
  margin: 0 auto;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px;
}

/* New Header Styles */
.chat_header {
  left: 6px;
  display: flex; /* Use flexbox to align items horizontally */
  align-items: center; /* Vertically center items in the flex container */
  justify-content: center; /* Center the content horizontally */
  width: 100%; /* Take full width */
  gap: 15px; /* Add some space between the text and the image */
  margin-bottom: 20px; /* Space below the header */
  padding-bottom: 10px; /* Optional: add some padding below if needed */
  position: relative; /* Keep for potential future absolute positioning if needed */
}

.chat_header h1 {
font-size: 1.7em; /* 글자 크기 조정 (필요시) */
  font-weight: bold; /* 굵은 글씨체 */
  font-family: 'Malgun Gothic', sans-serif; /* 예시 폰트, 이미지와 비슷한 폰트로 변경 가능 */
  color: #fff; /* 주황색 계열 (Coral) - 이미지 색상에 맞게 조정 */
  margin: 0;
  padding: 0;
  white-space: nowrap;
  text-shadow: 1px 4px #FFF0E5;
  -webkit-text-stroke: 1px #FF7F50;
}

.chat_header h1 .underline-target {
  /* 밑줄 스타일 */
  border-bottom: 2px solid #FFABAB; /* 분홍색 밑줄 */
  padding-bottom: 5px; /* 텍스트와 밑줄 사이 간격 */
  display: inline-block; /* border가 적용되도록 */
}

.header-avatar {
  height: 80px;
}

.chat_box {
  padding: 20px;
}

/* 채팅 영역 */
#chatArea {
  width: 100%;
  flex: 1;
  background-color: #fdfdfd;
  padding: 20px;
  border-radius: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 스크롤바 스타일(선택사항) */
#chatArea::-webkit-scrollbar {
  width: 8px;
}
#chatArea::-webkit-scrollbar-track {
  background: #f0f0f0;
}
#chatArea::-webkit-scrollbar-thumb {
  background-color: #bbb;
  border-radius: 8px;
}

/* 메시지 말풍선 (공통) */
#chatArea .system,
#chatArea .user {
  width: fit-content;
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 15px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: 0.95rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 시스템(챗봇) 메시지 */
#chatArea .system {
  background-color: #f0f0f0;
  color: #333;
  border-radius: 0 15px 15px 15px;
  align-self: flex-start;
}

/* 사용자 메시지 */
#chatArea .user {
  background-color: #FFABAB;
  color: #fff;
  border-radius: 15px 0 15px 15px;
  align-self: flex-end;
}

/* 입력 영역 (텍스트 + 버튼) */
.inputArea {
  width: 100%;
  display: flex;
  gap: 10px;
}

/* 입력창 */
#userInput {
  flex: 1;
  height: 50px;
  border: none;
  background-color: #fdfdfd;
  border-radius: 10px;
  padding: 0 20px;
  outline: none;
  font-size: 16px; /* 명시적으로 16px 이상으로 설정 */
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
  transition: box-shadow 0.2s ease;
}

#userInput:focus {
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.15);
}

/* 전송 버튼 */
#sendBtn {
  width: 60px;
  height: 50px;
  background-color: #FF7070;
  color: #fff;
  border-radius: 10px;
  border: none;
  font-size: 1em;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

#sendBtn:hover {
  background-color: #ff5555;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
#sendBtn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* 시스템 메시지 (에러 등) */
#systemMessage {
  width: 100%;
  text-align: center;
  position: absolute;
  font-size: 12px;
  color: #b02d2d;
  bottom: 2%;
  left: 0;
}

/* 반응형 */
@media screen and (max-width: 600px) {
  body {
    font-size: 14px;
  }
  #chatArea .system,
  #chatArea .user {
    max-width: 90%;
  }
}

/* 로딩 오버레이 전체를 어둡게 덮는 레이어 */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5); /* 살짝 반투명 검정 배경 */
    display: none; /* 기본은 숨김 */
    justify-content: center;
    align-items: center;
    z-index: 9999; /* 가장 위에 표시 */
}

/* 로딩창(오버레이) 내부에 표시할 컨테이너 */
.loading-content {
    background-color: #fff;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-align: center;
}

/* 간단한 로딩 스피너 */
.spinner {
    margin: 0 auto 1rem;
    border: 4px solid #f3f3f3;      /* 회색 테두리 */
    border-top: 4px solid #333;     /* 윗부분만 진한색 */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 퀵 버튼 스타일 추가 */
.quick-buttons {
    padding: 10px 0;
    /*text-align: center; !* 버튼 가운데 정렬 *!*/
    border-bottom: 1px solid #eee; /* 구분선 */
    margin-bottom: 10px;
}
.quick-btn {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 8px 15px;
    margin: 0 5px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s, color 0.3s;
}
.quick-btn:hover {
    background-color: #e0e0e0;
}
.quick-btn.selected {
    background-color: #007bff; /* 선택된 버튼 스타일 */
    color: white;
    border-color: #0056b3;
}
.message.system.info { /* 안내 메시지 스타일 */
    font-style: italic;
    color: #555;
    text-align: center;
    margin-top: 5px;
}
/* 입력창 비활성화 시 스타일 */
#userInput:disabled, #sendBtn:disabled {
    background-color: #f8f8f8;
    cursor: not-allowed;
    opacity: 0.7;
}