@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP&display=swap');

/* 기본 설정 */
body {
  font-family: 'Noto Sans JP', sans-serif;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  background-color: #fff;
}

button {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
}

/* 이미지 컨테이너 */
.image-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: auto;
}

.image-container img {
  width: 100vw;
  height: 100vh;
  object-fit: cover;
}

/* Chatbot 버튼 (오른쪽 하단 고정) */
.chatbot-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 15px 20px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

/* 채팅창 */
.chat-container {
  width: 480px;
  height: 500px;
  border: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  bottom: 80px;
  right: 20px;
  background-color: white;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  z-index: 999;
}

/* 입력창 */
.input-box {
  display: flex;
  padding: 10px;
  border-top: 1px solid #ccc;
  align-items: center;
}

.input-box input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-right: 5px;
}

.mic-button {
  padding: 10px;
  border: none;
  background-color: #d3d3d3 !important;
  color: black;
  cursor: pointer;
  border-radius: 5px;
  margin-right: 5px;
}
.mic-button:hover {
  filter: brightness(70%);
}

.send-button {
  padding: 10px;
  border: none;
  background-color: #4CAF50;
  color: white;
  cursor: pointer;
  border-radius: 5px;
}
.send-button:hover {
  filter: brightness(70%);
}

/* 채팅 내용 */
.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  max-height: 420px;
  scrollbar-width: thin;
}

.chat-box::-webkit-scrollbar {
  width: 6px;
}
.chat-box::-webkit-scrollbar-thumb {
  background-color: #bfbfbf;
  border-radius: 5px;
}
.chat-box::-webkit-scrollbar-track {
  background-color: #f1f1f1;
}

.message {
  max-width: 85%;
  padding: 10px;
  margin: 5px;
  border-radius: 10px;
  word-wrap: break-word;
  position: relative;
}

.message.received {
  background-color: #e0e0e0;
  align-self: flex-start;
  border-radius: 15px 15px 15px 5px;
}
.message.sent {
  background-color: #4CAF50;
  color: white;
  align-self: flex-end;
  border-radius: 15px 15px 5px 15px;
}

.message::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
}
.message.received::after {
  border-width: 10px;
  border-color: transparent #e0e0e0 transparent transparent;
  left: -10px;
  top: 10px;
}
.message.sent::after {
  border-width: 10px;
  border-color: transparent transparent transparent #4CAF50;
  right: -10px;
  top: 10px;
}

/* 썸네일 */
.thumbnail {
  width: 90%;
  max-width: 250px;
  height: auto;
  display: block;
  margin-top: 5px;
  border-radius: 8px;
}

/* 테이블 스타일 */
.message table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 14px;
}
.message th,
.message td {
  border: 1px solid #ccc;
  padding: 12px 16px;
  text-align: left;
}
.message th {
  background-color: #f5f5f5;
}
.message tr:nth-child(even) {
  background-color: #fafafa;
}

/* 로딩 애니메이션 */
.dot {
  animation: blink 1.4s infinite;
  font-size: 20px;
  font-weight: bold;
  margin: 0 2px;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}


/* ------------------- 너비 (Width) ------------------- */

/* 작은 휴대폰 (아이폰 SE 등) */
@media (max-width: 360px) {
  .chat-container {
    width: 330px;
  }
}

/* 보통 휴대폰 (361px ~ 480px) */
@media (min-width: 361px) and (max-width: 480px) {
  .chat-container {
    width: 340px;
  }
}

/* 큰 휴대폰 (481px ~ 600px) */
@media (min-width: 481px) and (max-width: 600px) {
  .chat-container {
    width: 450px;
  }
}

/* 작은 태블릿 (601px ~ 768px) */
@media (min-width: 601px) and (max-width: 768px) {
  .chat-container {
    width: 550px;
  }
}


/* ------------------- 높이 (Height) ------------------- */

/* 작은 휴대폰 (아이폰 SE 등) */
@media (max-height: 640px) {
  .chat-container {
    height: 400px;
  }
}

/* 보통 휴대폰 */
@media (min-height: 641px) and (max-height: 800px) {
  .chat-container {
    height: 500px;
  }
}

/* 큰 휴대폰 */
@media (min-height: 801px) and (max-height: 900px) {
  .chat-container {
    height: 600px;
  }
}

/* 작은 태블릿 */
@media (min-height: 901px) and (max-height: 1100px) {
  .chat-container {
    height: 700px;
  }
}

