#gpt-toggle-button {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #284b8f;
  border: 3px solid #6fa9ff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  color: #fff;
  cursor: pointer;
  z-index: 9999;
  transition: all 0.3s ease;
}

#gpt-toggle-button:hover {
  transform: scale(1.07);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

#gpt-toggle-button::after {
  content: "060KC × GPT 지식 파트너";
  position: absolute;
  bottom: 70px;
  left: 0;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

/* PC - hover로 표시 */
@media (hover: hover) {
  #gpt-toggle-button:hover::after {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 모바일 - 클래스 show-label 시 표시 */
@media (hover: none), (max-width: 768px) {
  #gpt-toggle-button {
    transform: scale(1); /* ✅ 기본 크기 명시 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  #gpt-toggle-button.show-label {
    transform: scale(1.07);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }

  #gpt-toggle-button.show-label::after {
    opacity: 1;
    transform: translateY(0);
  }
}
#gpt-toggle-button img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  border-radius: 50%;
}

#gpt-chat-box {
  position: fixed;
  bottom: 100px;
  left: 20px;
  width: 340px;
  max-height: 500px;
  background: #fff;
  color: #000;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: none;
  flex-direction: column;
  z-index: 9999;
  font-family: 'IBM Plex Sans KR', sans-serif;
}

#gpt-chat-header {
  background: #284b8f;
  color: white;
  padding: 16px;
  font-weight: bold;
  font-size: 16px;
}

#gpt-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f6f8fc;
}

#gpt-chatbot {
  position: fixed;
  bottom: 100px;
  left: 20px;
  width: 400px;
  max-height: 500px;
  overflow: hidden; 
  background: #d6e4f6;
  color: #1a1f24;
  border-radius: 16px;
  border: 1px solid #a4c6ff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column; 
  padding: 20px;
  z-index: 9998;
}

#gpt-chatbot.active {
  display: flex;
}

.chat-messages {
  width: 100%;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex-grow: 1;    
  min-height: 0;   
  gap: 12px;
  padding: 10px 0;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background-color: rgba(100, 100, 100, 0.4);
  border-radius: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background-color: transparent;
}

.message {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.6;
  position: relative;
  word-break: break-word;
}

.message.gpt {
  align-self: flex-start;
  background: linear-gradient(145deg, #2e497d, #1f355c);
  color: #f0f4ff;
  box-shadow: 0 4px 14px rgba(40, 85, 160, 0.3);
  position: relative;
  padding-left: 40px;
  border-radius: 18px;
}

.message.gpt::before {
  content: '';
  background: url("../img/robot-icon.png");
  background-size: cover;
  width: 25px;
  height: 25px;
  position: absolute;
  top: 6px;
  left: 6px;
  border-radius: 50%;
  background-color: #4f78c7; /* 진한 파란 아이콘 배경 */
  border: 2px solid #a4c6ff; /* 밝은 파란 테두리 */
}

.message.user {
  align-self: flex-end;
  background: linear-gradient(145deg, #4992f3, #3479d3);
  color: #fff;
  padding-left: 40px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.message.user::before {
  content: '';
  background: url("../img/user-icon.png");
  background-size: cover;
  width: 25px;
  height: 25px;
  position: absolute;
  top: 6px;
  left: 6px;
  border-radius: 50%;
  background-color: #4f78c7;
  border: 2px solid #a4c6ff;
}

#gpt-chat-input {
  display: flex;
  border-top: 1px solid #ccc;
  flex-shrink: 0;
}

#gpt-chat-input input {
  flex: 1;
  padding: 12px;
  border: none;
  font-size: 14px;
  outline: none;
}

#chat-input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 4px;
  border: none;
  font-size: 15px;
}

#chat-input::placeholder {
  color: #888;
}

button.send {
  padding: 8px 16px;
  background: #4992f3;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

button.send:hover {
  background: #2e70d1;
}

    .chat-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 480px;
  margin: 100px auto 60px auto;
  background-color: #f9f9f9;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  font-family: 'IBM Plex Sans KR', sans-serif;
}

@media (max-width: 768px) {
  #gpt-chatbot {
    width: 80vw;
    max-height: 80vh; /* ✅ 최대 높이만 제한 */
    min-height: 10vh; /* ✅ 기본 높이 설정 */
    bottom: 80px;
    left: 5vw;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
  }

  .chat-messages {
    flex-grow: 1; /* ✅ 공간이 생기면 메시지 영역이 확장됨 */
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 10px;
  }

  #gpt-chat-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    gap: 8px;
    box-sizing: border-box;
  }

  #gpt-chat-input input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
  }

  button.send {
    align-self: flex-end;
    padding: 10px 14px;
    font-size: 12px;
    border-radius: 6px;
    background-color: #4992f3;
    color: white;
    border: none;
    cursor: pointer;
  }
   }

