* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-size: 20px; /*기본 글꼴 크기*/
}

body {
  background-color: rgb(24, 25, 55); /* Background color */
  color: #fff; /* Text color */
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column; /* 객체 배치를 세로로 설정  */
  justify-content: center;
  align-items: center; /* 가로 위치 가운데 정렬*/
  min-height: 100vh; /* Fixed typo to ensure proper viewport height */
}

.container {
  width: 40%;
  min-width: 344px;
  display: flex;
  flex-direction: column;
  align-items: center; /* 수평 위치를 중앙으로 정렬 */
}

.header {
  margin-top: 10px;
  display: flex;
  justify-content: right;
  align-items: center;
}
.header #language-label {
  margin-right: 15px;
}
.header #language {
  padding: 5px;
  width: 120px;
}

.intro-container {
  margin-top: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.intro-container h1 {
  font-size: 2.5rem; /* 기본 헤더 크기 */
  margin-bottom: 15px;
}
.intro-container h2 {
  font-size: 2rem;
}
.img-box {
  margin-bottom: 15px;
}
.img-box img {
  width: 70%;
  min-width: 300px;
  object-fit: cover;
}
.intro-container label {
  font-size: 1.2rem;
  margin-bottom: 5px;
}
.intro-container input,
.intro-container select {
  margin-bottom: 15px;
  padding: 10px;
  border: none;
  border-radius: 5px;
  outline: none;
  width: 300px;
  max-width: 100%;
}
.intro-container button {
  padding: 10px 20px;
  margin-top: 15px;
  border: 1px solid #fff;
  border-radius: 25px;
  background-color: #007bff;
  color: #fff;
  cursor: pointer;
  outline: none;
  font-weight: 700;
}
.intro-container button:hover {
  background-color: #0056b3;
}

.chat-container {
  margin-top: 50px;
  width: 90%; /* Changed to a percentage for responsive design */
  max-width: 900px; /* Limit maximum width */
  height: auto; /* Let height adjust dynamically */
  min-height: 600px; /* Ensure minimum height for larger devices */
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.messages {
  height: 70%; /* Adjusted height for better flexibility */
  min-height: 300px;
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  color: rgb(24, 25, 55); /* Text color */
  display: flex;
  flex-direction: column;
}
.message {
  margin-bottom: 10px;
}
.message:last-child {
  margin-bottom: 0;
}
.user-message {
  background-color: #0179fa;
  color: #fff;
  border-radius: 5px;
  padding: 10px;
  max-width: 70%;
  align-self: flex-end;
  line-height: 150%;
}
.server-message {
  background-color: #30c859;
  color: #fff;
  border-radius: 5px;
  padding: 10px;
  max-width: 70%;
  align-self: flex-start;
  line-height: 150%;
}

.input-container {
  display: flex;
  padding: 20px;
  border-top: 1px solid #ccc;
}
.input-container input {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 5px;
  outline: none;
  color: rgb(24, 25, 55); /* Text color */
  background-color: #fff; /* Background color */
}
.input-container button {
  padding: 10px 20px;
  margin-left: 10px;
  border: none;
  border-radius: 5px;
  background-color: #007bff;
  color: #fff;
  cursor: pointer;
  outline: none;
}
.input-container button:hover {
  background-color: #0056b3;
}
#loader {
  height: 20px;
}
#loading-icon {
  color: black;
  font-weight: bold;
  text-align: center;
}

.google-ad {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 15px;
  min-width: 350px;
  min-height: 150px;
}
.kakao-ad {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 15px;
  min-width: 350px;
  min-height: 150px;
}

/* Footer styling added to support newly created footer in HTML */
.footer {
  width: 100%;
  text-align: center;
  padding: 20px 10px;
  margin-top: 30px; /* Adds space above the footer */
  display: flex;
  flex-direction: row;
  justify-content: center;
  background-color: rgb(24, 25, 55);
  color: #ffffff;
  font-size: 0.5rem;
}

.footer .privacy-page-link,
.footer .mail-address {
  margin-left: 50px;
  margin-left: 50px;
  color: #ffffff; /* White color for better readability */
  text-decoration: none;
}

.footer .privacy-page-link:hover {
  text-decoration: underline; /* Adds interactivity on hover */
}
.footer .mail-address:hover {
  text-decoration: underline; /* Adds interactivity on hover */
}

/* Responsive design */
/* Responsive design for screen widths less than 400px */
@media screen and (max-width: 400px), screen and (max-height: 700px) {
  /* Reduce font sizes for better fit */
  * {
    font-size: 18px; /* Decrease global font size */
  }

  .container {
    margin-top: 10px; /* Reduce top margin */
  }

  .intro-container {
    margin-top: 10px; /* Reduce top margin */
  }

  .intro-container input,
  .intro-container button {
    padding: 8px; /* Reduced padding for smaller screens */
  }

  .img-box img {
    width: 50%; /* Adjusted image size */
  }

  .chat-container {
    width: 100%; /* Adjust width to 100% for small screens */
    max-height: 500px; /* Set a maximum height */
    margin-top: 20px; /* Adjust margin-top */
    border-radius: 0; /* Remove border-radius for a cleaner look */
  }

  .messages {
    max-height: 300px; /* Limit messages container height */
    overflow-y: auto;
  }

  .img-box img {
    width: 50%; /* Reduce image width */
    min-width: 200px; /* Ensure minimum width */
  }

  .intro-container h1 {
    font-size: 2rem; /* Decrease heading font size */
  }

  .intro-container h2 {
    font-size: 1.5rem; /* Decrease heading font size */
  }

  /* Adjust input and button sizes */
  .intro-container input,
  .intro-container button {
    padding: 8px; /* Reduce padding */
  }

  .input-container {
    padding: 10px; /* Reduce padding */
  }

  .kakao-ad {
    margin-top: 10px; /* Adjust ad margin */
    min-height: 100px; /* Reduce ad minimum height */
  }

  .footer {
    padding: 15px 5px; /* Reduced padding for compact screens */
    font-size: 0.8rem; /* Slightly smaller font size for small screens */
  }
}

@media screen and (max-width: 900px) {
  .chat-container {
    width: 100%; /* Adjust width to 100% for smaller screens */
    border-radius: 0; /* Remove border-radius for a cleaner look */
  }

  .chat-container {
    margin-top: 10px;
  }
  .messages {
    height: 90% - 30px; /* Adjust height for smaller screens */
  }
}

@media screen and (max-width: 350px) {
  * {
    font-size: 16px; /* Decrease global font size */
  }
}
