/* Chatbot Styles */
#chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Floating Button */
.chatbot-float-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.chatbot-float-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chatbot-float-btn:active {
  transform: scale(0.95);
}

/* Chat Window */
.chatbot-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  max-width: calc(100vw - 40px);
  height: 600px; /* 500px → 600px로 증가 */
  max-height: calc(100vh - 120px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: all 0.3s ease;
}

.chatbot-window.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Header */
.chatbot-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px;
}

.chatbot-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.chatbot-title p {
  margin: 4px 0 0 0;
  font-size: 13px;
  opacity: 0.9;
}

/* Messages Area */
.chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafc;
}

.chatbot-message {
  margin-bottom: 16px;
  animation: fadeInUp 0.3s ease;
}

.chatbot-message-content {
  padding: 9px 11px;
  border-radius: 16px;
  max-width: 80%;
  line-height: 1.6; /* 1.4에서 1.6으로 증가 */
  font-size: 12px;
  /* white-space: pre-line; 줄바꿈 보존 */
}
.chatbot-message-content a {
  color: #667eea;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.chatbot-message-content a:hover {
  color: #764ba2;
  border-bottom-color: #764ba2;
}
/* 리스트 스타일 추가 */
.chatbot-message-content strong {
  font-weight: 600;
  color: inherit;
}

.chatbot-message-content ul {
  margin: 8px 0;
  padding-left: 0;
  list-style: none;
}

.chatbot-message-content li {
  margin: 2px 0; /* 4px → 2px로 줄이기 */
  padding-left: 16px;
  position: relative;
}

/* 1레벨 리스트 (기본) */
.chatbot-message-content li:before {
  content: "•";
  color: #667eea;
  font-weight: bold;
  position: absolute;
  left: 0;
}

/* 2레벨 리스트 */
.chatbot-message-content li.nested-list-1 {
  margin: 1px 0; /* 줄 간격 더 줄이기 */
  padding-left: 24px;
  font-size: 13px;
  color: #a6b1c5;
}

.chatbot-message-content li.nested-list-1:before {
  content: "◦";
  color: #9ca3af;
  left: 8px;
}

/* 3레벨 리스트 */
.chatbot-message-content li.nested-list-2 {
  margin: 1px 0; /* 줄 간격 더 줄이기 */
  padding-left: 32px;
  font-size: 12px;
  color: #9ca3af;
}

.chatbot-message-content li.nested-list-2:before {
  content: "▪";
  color: #d1d5db;
  left: 16px;
}

.chatbot-message-content br {
  line-height: 0.5; /* 줄바꿈 간격 줄이기 */
}

/* 리스트 내부의 br 태그는 숨기기 */
.chatbot-message-content ul br {
  display: none;
}

.chatbot-bot-message .chatbot-message-content {
  background: white;
  color: #374151;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chatbot-user-message {
  display: flex;
  justify-content: flex-end;
}

.chatbot-user-message .chatbot-message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

/* Quick Actions - 입력창 위 고정 (4개 한 줄) */
.chatbot-quick-actions-fixed {
  padding: 4px 6px 3px 6px; /* 세로 30% 감소 */
  background: white;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 3px; /* 8px → 4px로 감소 */
}

.chatbot-quick-actions-fixed .chatbot-quick-btn {
  flex: 1;
  padding: 4px 6px; /* 6px 8px → 4px 6px로 더 줄이기 */
  border: 1px solid #e5e7eb;
  border-radius: 8px; /* 12px → 8px로 줄이기 */
  background: #f8fafc;
  color: #374151;
  font-size: 10px; /* 11px → 10px로 줄이기 */
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chatbot-quick-actions-fixed .chatbot-quick-btn:hover {
  background: #f3f4f6;
  border-color: #667eea;
  transform: translateY(-1px);
}

.chatbot-quick-actions-fixed .chatbot-quick-btn:active {
  transform: translateY(0);
}quick-btn:hover {
  background: #f3f4f6;
  border-color: #667eea;
  transform: translateY(-1px);
}

.chatbot-quick-actions-fixed .chatbot-quick-btn:active {
  transform: translateY(0);
}

/* 기존 Quick Actions (메시지 내 인라인) */
.chatbot-quick-actions {
  display: flex;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.chatbot-quick-btn {
  flex: 1;
  padding: 4px 3px; /* 8px 12px → 6px 10px로 줄이기 */
  border: 1px solid #e5e7eb;
  border-radius: 16px; /* 20px → 16px로 줄이기 */
  background: white;
  color: #374151;
  font-size: 10px; /* 12px → 10px로 줄이기 */
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.chatbot-quick-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* Input Area */
.chatbot-input-area {
  padding: 16px;
  background: white;
  border-top: 1px solid #e5e7eb;
}

.chatbot-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

#chatbot-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

#chatbot-input:focus {
  border-color: #667eea;
}

#chatbot-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#chatbot-send:hover {
  transform: scale(1.05);
}

#chatbot-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.chatbot-session-info {
  text-align: center;
  margin-top: 8px;
  color: #6b7280;
}

/* Typing Animation */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.chatbot-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ca3af;
  animation: typingDot 1.4s infinite ease-in-out;
}

.chatbot-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chatbot-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingDot {
  0%, 60%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  30% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 480px) {
  #chatbot-container {
    bottom: 16px;
    right: 16px;
  }
  
  .chatbot-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 120px);
    bottom: 70px;
    right: -8px;
  }
  
  .chatbot-float-btn {
    width: 56px;
    height: 56px;
  }
}

/* Hidden class */
.hidden {
  display: none !important;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .chatbot-window {
    background: #1f2937;
  }
  
  .chatbot-messages {
    background: #111827;
  }
  
  .chatbot-bot-message .chatbot-message-content {
    background: #374151;
    color: #f9fafb;
  }
  
  .chatbot-input-area {
    background: #1f2937;
    border-top-color: #374151;
  }
  
  .chatbot-quick-actions-fixed {
    background: #1f2937;
    border-top-color: #374151;
  }
  
  .chatbot-quick-actions-fixed .chatbot-quick-btn {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
  }
  
  .chatbot-quick-actions-fixed .chatbot-quick-btn:hover {
    background: #4b5563;
    border-color: #667eea;
  }
  
  #chatbot-input {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
  }
  
  #chatbot-input::placeholder {
    color: #9ca3af;
  }
  
  .chatbot-quick-btn {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
  }
  
  .chatbot-quick-btn:hover {
    background: #4b5563;
    border-color: #6b7280;
  }
}
