* {
  margin: 0;
  padding: 0;
  box-sizing: border-box; /* 패딩과 마진을 포함해 요소의 크기를 계산 */
}

body {
  font-family: 'Poppins', Arial, sans-serif;
  background-color: #f4f6f9;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  color: #333;
  overflow-x: hidden; /* 수평 스크롤 숨기기 */
}

.chat-container {
  width: 100%;
  height: 100%; /* 컨테이너가 화면에 꽉 차도록 설정 */
  background: linear-gradient(135deg, #4a90e2, #357ABD);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: #ffffff;
  padding: 10px;
  box-sizing: border-box;
}

.chat-header {
  background: linear-gradient(135deg, #4a90e2, #357ABD);
  color: white;
  padding: 18px 24px;
  text-align: center;
  border-bottom: 2px solid #357ABD;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.chat-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
}

.chat-header p {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 400;
}

.chat-window {
  flex: 1;
  padding: 18px 24px;
  overflow-y: auto;
  background-color: #f9f9f9;
  border-bottom: 1px solid #ddd;
  height: 100%;
}

.message {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
}

.message.user .message-text {
  background-color: #4a90e2;
  color: white;
  margin-left: auto;
  border-radius: 18px;
  padding: 14px 20px;
  max-width: 75%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.message.bot .message-text {
  background-color: #f1f1f1;
  color: #333;
  margin-right: auto;
  border-radius: 18px;
  padding: 14px 20px;
  max-width: 75%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.message-text {
  font-size: 15px;
  line-height: 1.6;
}

.chat-input {
  display: flex;
  border-top: 1px solid #ddd;
  background-color: #fff;
  padding: 12px;
}

.chat-input input {
  flex: 1;
  padding: 16px;
  border: none;
  font-size: 16px;
  border-radius: 25px;
  outline: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  background: #f9f9f9;
  font-family: 'Poppins', sans-serif;
  width: 100%; /* 입력창의 너비를 100%로 설정 */
}

.intro-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  text-align: center;
  width: 100%;
  max-width: 600px;
  height: auto;
}

.intro-container h1 {
  font-size: 28px;
  font-weight: bold;
  color: #4a90e2;
  margin-bottom: 15px;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
}

.intro-container h3 {
  font-size: 16px;
  color: #555;
  margin-bottom: 20px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.intro-container img {
  width: 40%;
  max-width: 120px;
  min-width: 80px;
  border-radius: 50%;
  margin-bottom: 20px;
}

.intro-container input,
.intro-container button {
  font-size: 14px;
  padding: 12px;
  margin: 10px 0;
  border-radius: 8px;
  border: 2px solid #ddd;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.intro-container input[type="text"] {
  background-color: #fff;
  color: #333;
}

.intro-container input[type="text"]:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 5px rgba(74, 144, 226, 0.6);
  outline: none;
}

.intro-container button {
  background-color: #4a90e2;
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  font-weight: bold;
}

.intro-container button:hover {
  background-color: #357ABD;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.chat-container img {
  width: 50%;
  min-width: 150px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px auto;
  font-size: 1.2em;
  color: #007bff;
  max-width: 90%;
  word-wrap: break-word;
  padding: 12px 18px;
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid #ddd;
}

.spinner i {
  margin-right: 8px;
}

.spinner-text {
  font-size: 1em;
  color: #333;
  font-weight: 500;
}

.kakao-ad {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}

#chatWindow {
  height: 400px;
  overflow-y: auto;
  border: 1px solid #ddd;
  padding: 12px;
  background-color: #fff;
  border-radius: 12px;
}

/* Responsive Design */
@media (max-width: 767px) {
  .chat-container {
    padding: 10px; /* 작은 화면에서 padding을 추가하여 요소들 간의 간격 확보 */
  }
  .chat-header h2 {
    font-size: 18px;
  }
  .message-text {
    font-size: 14px;
  }
  .chat-input input {
    padding: 12px;
  }
  .chat-input button {
    padding: 12px 16px;
  }
}
