/*=================================================================================================
// AI 검색창 CSS 2025-10-11
//=================================================================================================*/

/* ============================================
   챗봇 모달 스타일 - 챗봇 UI
   ============================================ */

/* Q&A 팝업 버튼 */
.qa-float-btn {
  position: fixed;
  bottom: 200px;
  right: 40px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 999;
}

.qa-float-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.qa-float-btn span {
  color: white;
  font-size: 28px;
  font-weight: bold;
}

/* 모달 오버레이 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 챗봇 모달 컨테이너 */
.qa-modal {
  background: white;
  border-radius: 15px;
  width: 90%;
  max-width: 400px;
  height: 700px;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  overscroll-behavior: contain; /* 배경 스크롤 체인 방지 */
  position: fixed;
  bottom: 34px;
  right: 100px;
}

/* 챗봇 헤더 */
.qa-modal-header {
  background: white;
  color: #333;
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.qa-modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
}

.qa-modal-close {
  background: none;
  border: none;
  color: #333;
  font-size: 24px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  background: url(../images/chatbot_close.png) no-repeat center / cover;
}

.qa-modal-close:hover {
  color: #666;
}

/* 챗봇 메시지 영역 */
.qa-modal-body {
  flex: 1;
  overflow-y: auto;
  background-color: #f8f8f8;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  overscroll-behavior: contain; /* 배경 스크롤 체인 방지 */
}

/* 챗봇 메시지 컨테이너 */
.chat-message {
  display: flex;
  margin-bottom: 15px;
  animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 챗봇 메시지 (왼쪽 정렬) */
.chat-message.bot {
  justify-content: flex-start;
}

.chat-message.bot .message-content {
  background: white;
  color: #333;
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-message.bot>div{
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  max-width: 80%;
}

/* 사용자 메시지 (오른쪽 정렬) */
.chat-message.user {
  justify-content: flex-end;
}

.chat-message.user .message-content {
  background: #20B2AA;
  color: white;
  border-radius: 18px 18px 4px 18px;
}

.chat-message.user>div{
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  max-width: 80%;
}

/* 메시지 헤더 (챗봇만) */
.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.message-header .avatar {
  display: block;
  background: url('../images/chatbot_profile.png') center / cover no-repeat,
  linear-gradient(#63b3ff, #3ca0ff);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
}

.message-header .name {
  color: #666;
  font-size: 16px;
  font-weight: 600;
  line-height: 26px;
}

/* 메시지 내용 */
.message-content {
  padding: 12px 16px;
  line-height: 1.4;
  font-size: 18px;
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* 메시지 시간 */
.message-time {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
  text-align: right;
}

.chat-message.bot .message-time {
  text-align: left;
}

/* 입력 영역 */
.chat-input-area {
  padding: 15px 20px;
  background: white;
  border-top: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 15px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  font-size: 16px;
  resize: none;
  min-height: 20px;
  max-height: 100px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.chat-input:focus {
  outline: none;
  border-color: #20B2AA;
  background: white;
}

.chat-input::placeholder {
  color: #999;
}

.send-button {
  width: 40px;
  height: 40px;
  background: #20B2AA;
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.send-button:hover {
  background: #1a9b96;
  transform: scale(1.05);
}

.send-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.send-button::before {
  content: '✈';
  font-size: 16px;
}

/* 로딩 메시지 */
.chat-loading {
  display: none;
  /*justify-content: flex-start;*/
  /*margin-bottom: 15px;*/
}

.chat-loading.show {
  display: flex;
  justify-content: center;
}

.chat-loading>.message-content {
  background: white;
  color: #666;
  /*border-radius: 18px 18px 18px 4px;*/
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  /*box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);*/
}

.loading-dots {
  display: flex;
  gap: 3px;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  background: #999;
  border-radius: 50%;
  animation: loadingDot 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingDot {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* ============================================
   반응형 디자인 (모바일)
   ============================================ */
@media (max-width: 768px) {
  .qa-float-btn {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
  }

  .qa-float-btn span {
    font-size: 24px;
  }

  .qa-modal {
    width: 95%;
    height: 90vh;
    max-width: none;

    position: unset;
    bottom: unset;
    right: unset;
  }

  .qa-modal-header {
    padding: 15px;
  }

  .qa-modal-header h2 {
    font-size: 1.1rem;
  }

  .qa-modal-body {
    padding: 15px;
  }

  .chat-message .message-content {
    max-width: 85%;
    font-size: 15px;
  }

  .chat-message .message-time {
    font-size: 12px;
  }

  .message-header .avatar::before {
    font-size: 15px;
  }

  .message-header .name {
    font-size: 15px;
  }

  .chat-input-area {
    padding: 12px 15px;
  }

  .chat-input {
    font-size: 15px;
    padding: 15px 14px;
  }

  .send-button {
    width: 36px;
    height: 36px;
  }

  .send-button::before {
    font-size: 14px;
  }
}

