/* 채팅봇 플로팅 버튼 스타일 */
.chatbot-float-button {
  position: fixed !important;
  bottom: 100px !important; /* 기존 fixed-contact-btn 위에 배치 */
  right: 30px !important;
  width: 60px !important;
  height: 60px !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border-radius: 50% !important;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s ease !important;
  z-index: 99999 !important;
  border: none !important;
  outline: none !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.chatbot-float-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.chatbot-float-button:active {
  transform: scale(0.95);
}

.chatbot-float-button svg {
  width: 30px;
  height: 30px;
  fill: white;
}

/* 채팅봇 모달 오버레이 */
.chatbot-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.chatbot-modal-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 채팅봇 모달 컨테이너 */
.chatbot-modal {
  width: 90%;
  max-width: 500px;
  height: 700px;
  max-height: 85vh;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 채팅봇 헤더 */
.chatbot-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.chatbot-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ChatKit 컨테이너 */
.chatbot-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

#chatkit-container {
  width: 100%;
  height: 100%;
}

/* 다크 테마 커스터마이징 */
.chatbot-modal.dark-theme #chatkit-container {
  background: #1a1a1a;
  color: #ffffff;
}

/* 로딩 스피너 */
.chatbot-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.chatbot-loading-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.chatbot-loading-text {
  color: #666;
  font-size: 14px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .chatbot-modal {
    width: 95%;
    height: 90vh;
    max-height: 90vh;
    border-radius: 15px;
  }

  .chatbot-float-button {
    bottom: 90px !important; /* 모바일에서도 기존 버튼 위에 */
    right: 20px;
    width: 55px;
    height: 55px;
  }

  .chatbot-float-button svg {
    width: 26px;
    height: 26px;
  }
}

@media (max-width: 480px) {
  .chatbot-modal {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .chatbot-header {
    padding: 15px;
  }

  .chatbot-header h3 {
    font-size: 16px;
  }
}

/* 에러 메시지 스타일 */
.chatbot-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 20px;
  max-width: 80%;
}

.chatbot-error-icon {
  font-size: 48px;
  color: #e74c3c;
  margin-bottom: 10px;
}

.chatbot-error-text {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

/* reCAPTCHA 검증 화면 */
.recaptcha-verification {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: #1a1a1a;
  padding: 20px;
}

.recaptcha-content {
  text-align: center;
  max-width: 400px;
}

.recaptcha-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.recaptcha-title {
  color: #e0e0e0;
  font-size: 24px;
  margin-bottom: 10px;
  font-weight: 600;
}

.recaptcha-description {
  color: #999;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.recaptcha-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  min-height: 78px; /* Invisible reCAPTCHA를 위한 최소 높이 */
}

#recaptcha-invisible {
  /* Invisible reCAPTCHA는 보이지 않음 */
}

.recaptcha-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
}

/* 채팅 인터페이스 스타일 */
.chat-interface {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #1a1a1a;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.chat-message {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.chat-message.user-message {
  justify-content: flex-end;
}

.chat-message.bot-message {
  justify-content: flex-start;
}

.message-content {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  word-wrap: break-word;
  line-height: 1.5;
  background-color: #ffffff;
}

.user-message .message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.bot-message .message-content {
  background: #2d2d2d;
  color: #e0e0e0;
  border-bottom-left-radius: 4px;
}

/* 타이핑 인디케이터 */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #667eea;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-10px);
  }
}

/* 채팅 입력 영역 */
.chat-input-container {
  display: flex;
  gap: 10px;
  padding: 15px 20px;
  background: #2d2d2d;
  border-top: 1px solid #3d3d3d;
  align-items: flex-end;
}

.chat-attach-btn {
  background: #3d3d3d;
  border: none;
  color: #e0e0e0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-attach-btn:hover {
  background: #4d4d4d;
}

.chat-input {
  flex: 1;
  background: #3d3d3d;
  border: none;
  color: #e0e0e0;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  line-height: 1.5;
}

.chat-input:focus {
  outline: none;
  background: #4d4d4d;
}

.chat-input::placeholder {
  color: #888;
}

.chat-send-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  padding: 0 20px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chat-send-btn:active {
  transform: translateY(0);
}

/* 스크롤바 스타일 */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #4d4d4d;
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #5d5d5d;
}
