/* ============================================
   Chatbot Widget - Standalone CSS
   Purple Theme (AI 튜터 맑은샘)

   독립적으로 사용 가능한 챗봇 위젯 스타일
   다른 프로젝트에서 이 파일만 import하여 사용 가능
   ============================================ */

/* ============================================
   CSS Variables (독립 사용을 위한 변수)
   ============================================ */

:host {
  /* Purple Palette (Chat) */
  --chatbot-primary: #7C3AED;
  --chatbot-primary-light: #A78BFA;
  --chatbot-secondary: #6D28D9;
  --chatbot-bg: #FFFFFF;
  --chatbot-bg-alt: #F9FAFB;
  --chatbot-accent: #8B5CF6;
  --chatbot-text: #1F2937;
  --chatbot-text-secondary: #6B7280;
  --chatbot-border: #E5E7EB;
  --chatbot-user-bg: #1F2937;

  /* 호스트 페이지 상속 속성 차단 */
  color: var(--chatbot-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: normal;
  word-spacing: normal;
  text-transform: none;
  text-indent: 0;
  text-shadow: none;
  text-align: left;
  font-style: normal;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fallback for non-Shadow DOM usage (admin dashboard) */
:root {
  --chatbot-primary: #7C3AED;
  --chatbot-primary-light: #A78BFA;
  --chatbot-secondary: #6D28D9;
  --chatbot-bg: #FFFFFF;
  --chatbot-bg-alt: #F9FAFB;
  --chatbot-accent: #8B5CF6;
  --chatbot-text: #1F2937;
  --chatbot-text-secondary: #6B7280;
  --chatbot-border: #E5E7EB;
  --chatbot-user-bg: #1F2937;
}

/* ============================================
   Chat Window - Cool Blue Style
   ============================================ */

/* CSS Reset - Shadow DOM 내부 기본 스타일 초기화 */
.chatbot *, .chatbot *::before, .chatbot *::after,
.chat-fab, .chat-fab *, .chat-fab::before, .chat-fab::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.chatbot {
  position: fixed;
  bottom: 100px;
  right: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  border: none;
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.2);
  background-color: var(--chatbot-bg);
  color: var(--chatbot-text);
  font-size: 14px;
  line-height: 1.5;
  z-index: 999;
}

.chatbot:hover {
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.25);
}

/* Purple Chat Header */
.chatbot .chatbot-header {
  background: var(--chatbot-primary);
  border: none;
  border-radius: 20px 20px 0 0;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot .chatbot-header h5,
.chatbot .chatbot-header .chatbot-title {
  color: white;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chatbot .chatbot-header .chatbot-title-icon {
  font-size: 1.1rem;
}

/* Header Actions */
.chatbot .chatbot-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chatbot .chatbot-header-btn {
  background-color: rgba(255, 255, 255, 0.25);
  border: none;
  color: white;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 0.85rem;
}

.chatbot .chatbot-header-btn i {
  pointer-events: none;
}

.chatbot .chatbot-header-btn:hover {
  background-color: rgba(255, 255, 255, 0.35);
}

/* Close Button */
.chatbot .chatbot-close {
  background-color: rgba(255, 255, 255, 0.25);
  border: none;
  color: white;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
  z-index: 10;
}

.chatbot .chatbot-close i {
  pointer-events: none;
}

.chatbot .chatbot-close:hover {
  background-color: rgba(255, 255, 255, 0.35);
}

/* Tab Navigation */
.chatbot .chatbot-tabs {
  border-bottom: none;
  background-color: var(--chatbot-bg);
  display: flex;
  padding: 0;
  margin: 0 16px;
  border-bottom: 1px solid var(--chatbot-border);
}

.chatbot .chatbot-tab {
  flex: 1;
  color: var(--chatbot-text-secondary);
  border: none;
  background: none;
  border-radius: 0;
  padding: 14px 8px 12px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.chatbot .chatbot-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--chatbot-text);
  transition: width 0.2s ease;
}

.chatbot .chatbot-tab:hover {
  color: var(--chatbot-text);
}

.chatbot .chatbot-tab.active {
  color: var(--chatbot-text);
  font-weight: 600;
}

.chatbot .chatbot-tab.active::after {
  width: calc(100% - 16px);
}

/* Fixed Tabs */
.chatbot .nav-tabs {
  flex: 0 0 auto;
}

/* Scrollable Body Wrapper (Tab Content + Messages) */
.chatbot-body {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Tab Content */
.chatbot-content {
  flex: 0 0 auto;
  background-color: var(--chatbot-bg);
  border-bottom: 1px solid var(--chatbot-border);
  padding: 16px;
  margin: 0 16px;
}

.chatbot-content h6 {
  color: var(--chatbot-text);
  margin: 0 0 12px 0;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chatbot-content h6 i {
  color: var(--chatbot-text);
}

.chatbot-content .text-muted {
  color: var(--chatbot-text-secondary);
}

.chatbot-content p {
  margin: 0;
  line-height: 1.6;
  color: var(--chatbot-text);
  font-size: 0.9rem;
}

.chatbot .tab-content {
  display: none;
}

.chatbot .tab-content.active {
  display: block;
}

/* Blue Chat Messages */
.chatbot-messages {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 150px;
  background-color: var(--chatbot-bg);
  padding: 16px;
}

.chatbot-msg {
  display: flex;
  max-width: 85%;
}

.chatbot-msg--user {
  align-self: flex-end;
}

.chatbot-msg--assistant {
  align-self: flex-start;
}

.chatbot-msg--system {
  align-self: center;
  max-width: 100%;
}

.chatbot-msg-content {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
}

/* User Message - Dark */
.chatbot-msg--user .chatbot-msg-content {
  background: var(--chatbot-user-bg);
  color: white;
  border-bottom-right-radius: 4px;
}

/* Assistant Message - Light */
.chatbot-msg--assistant .chatbot-msg-content {
  background: var(--chatbot-bg-alt);
  color: var(--chatbot-text);
  border: 1px solid var(--chatbot-border);
  border-bottom-left-radius: 4px;
}

/* System Message */
.chatbot-msg--system .chatbot-msg-content {
  background: var(--chatbot-bg-alt);
  color: var(--chatbot-text);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 12px;
  opacity: 0.9;
}

/* Typing Indicator */
.chatbot-msg--typing .chatbot-msg-content {
  display: flex;
  gap: 4px;
  padding: 14px 20px;
}

.chatbot-typing-dot {
  width: 8px;
  height: 8px;
  background: var(--chatbot-primary-light);
  border-radius: 50%;
  animation: chatbot-typing 1.4s ease-in-out infinite;
}

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

@keyframes chatbot-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Chat Input */
.chatbot-footer {
  background-color: var(--chatbot-bg);
  border-top: 1px solid var(--chatbot-border);
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chatbot-footer .chatbot-input {
  flex: 1;
  border: none;
  background-color: var(--chatbot-bg-alt);
  border-radius: 18px;
  padding: 10px 18px;
  font-size: 14px;
  outline: none;
  transition: box-shadow 0.2s ease;
  resize: none;
  overflow-y: auto;
  line-height: 1.5;
  max-height: calc(1.5em * 5 + 20px);
  font-family: inherit;
}

.chatbot-footer .chatbot-input::placeholder {
  color: var(--chatbot-text-secondary);
}

.chatbot-footer .chatbot-input:focus {
  box-shadow: 0 0 0 2px var(--chatbot-primary-light);
}

/* Purple Send Button */
.chatbot-footer .chatbot-send {
  background: var(--chatbot-primary);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chatbot-footer .chatbot-send svg {
  margin-left: 2px;
}

.chatbot-footer .chatbot-send:hover {
  background: var(--chatbot-secondary);
  transform: scale(1.05);
}

.chatbot-footer .chatbot-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Custom Scrollbar */
.chatbot-body::-webkit-scrollbar {
  width: 6px;
}

.chatbot-body::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-body::-webkit-scrollbar-thumb {
  background: var(--chatbot-border);
  border-radius: 3px;
}

.chatbot-body::-webkit-scrollbar-thumb:hover {
  background: var(--chatbot-primary-light);
}

/* ============================================
   Floating Action Button (FAB)
   ============================================ */

.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--chatbot-primary);
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

.chat-fab:active {
  transform: scale(0.95);
}

.chat-fab-icon,
.chat-fab-close {
  position: absolute;
  transition: all 0.3s ease;
}

.chat-fab-icon {
  opacity: 1;
  transform: rotate(0deg);
}

.chat-fab-close {
  opacity: 0;
  transform: rotate(-90deg);
}

.chat-fab.active .chat-fab-icon {
  opacity: 0;
  transform: rotate(90deg);
}

.chat-fab.active .chat-fab-close {
  opacity: 1;
  transform: rotate(0deg);
}

.chat-fab.active {
  background: linear-gradient(135deg, #64748b 0%, #94a3b8 100%);
}

/* FAB Loading State */
.chat-fab.loading {
  pointer-events: none;
}

.chat-fab.loading .chat-fab-icon {
  opacity: 0;
}

.chat-fab.loading::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: fab-spin 0.8s linear infinite;
}

@keyframes fab-spin {
  to { transform: rotate(360deg); }
}

/* Pulse Animation */
.chat-fab::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  animation: chatbot-pulse 2s ease-out infinite;
  z-index: -1;
}

.chat-fab.active::before {
  animation: none;
}

@keyframes chatbot-pulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ============================================
   Utilities
   ============================================ */

.chatbot[hidden] {
  display: none !important;
}

.chatbot [hidden] {
  display: none !important;
}

/* ============================================
   Inline Mode - 컨테이너 안에 배치
   ============================================ */

.chatbot--inline {
  position: relative !important;
  bottom: auto !important;
  right: auto !important;
  left: auto !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  z-index: auto;
  border: 1px solid var(--chatbot-border);
  box-shadow: none !important;
}

.chatbot--inline .chatbot-header {
  display: none;
}

.chatbot--inline .chatbot-close {
  display: none;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 991.98px) {
  .chatbot {
    width: 100%;
    max-width: 450px;
  }
}

@media (max-width: 575.98px) {
  .chatbot {
    right: 12px;
    bottom: 80px;
    left: 12px;
    width: auto;
    max-width: none;
  }

  .chat-fab {
    right: 16px;
    bottom: 16px;
    width: 52px;
    height: 52px;
    font-size: 20px;
  }
}

/* ============================================
   Bootstrap 호환 스타일 (기존 마크업 지원)
   ============================================ */

/* Bootstrap card 구조 호환 */
.chatbot.card {
  border-radius: 20px !important;
  border: none !important;
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.2) !important;
}

.chatbot .card-header {
  background: var(--chatbot-primary) !important;
  border: none !important;
  border-radius: 20px 20px 0 0 !important;
  padding: 14px 20px !important;
}

.chatbot .card-header h5 {
  color: white !important;
}

.chatbot .btn-light {
  background-color: rgba(255, 255, 255, 0.25) !important;
  border: none !important;
  color: white !important;
  border-radius: 8px !important;
}

.chatbot .btn-light:hover {
  background-color: rgba(255, 255, 255, 0.35) !important;
}

/* Bootstrap nav-tabs 호환 */
.chatbot .nav-tabs {
  border-bottom: 1px solid var(--chatbot-border) !important;
  background-color: var(--chatbot-bg);
  padding: 0 8px;
}

.chatbot .nav-link {
  color: var(--chatbot-text-secondary);
  border: none;
  border-radius: 0;
  padding: 14px 8px 12px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.chatbot .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--chatbot-primary);
  transition: width 0.2s ease;
}

.chatbot .nav-link:hover {
  color: var(--chatbot-primary);
  background-color: transparent;
}

.chatbot .nav-link.active {
  color: var(--chatbot-primary);
  background-color: transparent;
  font-weight: 600;
}

.chatbot .nav-link.active::after {
  width: 100%;
}

/* Bootstrap card-footer 호환 */
.chatbot .card-footer {
  background-color: var(--chatbot-bg) !important;
  border-top: 1px solid var(--chatbot-border) !important;
  padding: 12px 16px !important;
}

.chatbot .card-footer .form-control {
  border: none !important;
  background-color: var(--chatbot-bg-alt) !important;
  border-radius: 24px !important;
  padding: 12px 18px !important;
}

.chatbot .card-footer .form-control:focus {
  box-shadow: 0 0 0 2px var(--chatbot-primary-light) !important;
}

.chatbot .card-footer .btn-primary {
  background: var(--chatbot-primary) !important;
  border: none !important;
  border-radius: 50% !important;
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.chatbot .card-footer .btn-primary:hover {
  background: var(--chatbot-secondary) !important;
  transform: scale(1.05);
}

/* ============================================
   Quiz Styles
   ============================================ */

.chatbot-quiz {
  font-size: 0.9rem;
}

.chatbot-quiz-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.chatbot-quiz-progress .chatbot-quiz-count {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  background: var(--chatbot-text);
  border: none;
  color: white;
}

.chatbot-quiz-progress .chatbot-quiz-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
}

.chatbot-quiz-progress .chatbot-quiz-type-badge.choice {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #6EE7B7;
}

.chatbot-quiz-progress .chatbot-quiz-type-badge.ox {
  background: #FEF3C7;
  color: #D97706;
  border: 1px solid #FCD34D;
}

.chatbot-quiz-question {
  padding: 0;
  background: transparent;
  line-height: 1.6;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.chatbot-quiz-question strong {
  color: var(--chatbot-text);
}

.chatbot-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chatbot-quiz-option {
  padding: 14px 16px;
  background: white;
  border: 1px solid var(--chatbot-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.chatbot-quiz-option:hover {
  border-color: var(--chatbot-primary-light);
}

.chatbot-quiz-option.selected {
  background: rgba(124, 58, 237, 0.05);
  border-color: var(--chatbot-primary);
  border-width: 2px;
}

.chatbot-quiz-option .chatbot-option-num {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  background: #ECFDF5;
  color: #059669;
  border: 1.5px solid #6EE7B7;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-right: 12px;
  flex-shrink: 0;
}

.chatbot-quiz-option.selected .chatbot-option-num {
  background: var(--chatbot-primary);
  color: white;
  border-color: var(--chatbot-primary);
}

.chatbot-quiz-ox-options {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 8px 0;
}

.chatbot-quiz-option.chatbot-quiz-ox {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  border-radius: 12px;
  padding: 0;
}

.chatbot-quiz-option.chatbot-quiz-ox.selected {
  border-width: 3px;
}

.chatbot-quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.chatbot-quiz-nav-buttons {
  display: flex;
  gap: 8px;
}

.chatbot-quiz-result {
  padding: 12px 16px;
  border-radius: 12px;
  margin-top: 12px;
}

.chatbot-quiz-result.correct {
  background: #ECFDF5;
}

.chatbot-quiz-result.wrong {
  background: #FEF2F2;
}

.chatbot-quiz-result .chatbot-result-icon {
  font-size: 1rem;
  margin-right: 4px;
}

.chatbot-quiz-result .chatbot-result-correct {
  color: #059669;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.chatbot-quiz-result .chatbot-result-wrong {
  color: #DC2626;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.chatbot-quiz-result .chatbot-result-explanation {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--chatbot-text-secondary);
  line-height: 1.5;
}

/* ============================================
   Embed Widget - Standalone Components
   Bootstrap 없이 동작하는 자체 스타일
   ============================================ */

/* Tab content (embed용 malgn- 접두어) */
.malgn-tab-content {
  display: none;
}

.malgn-tab-content.active {
  display: block;
}

/* Buttons */
.chatbot-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chatbot-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chatbot-btn-primary {
  background: var(--chatbot-primary);
  color: white;
  border-color: var(--chatbot-primary);
}

.chatbot-btn-primary:hover:not(:disabled) {
  background: var(--chatbot-secondary);
  border-color: var(--chatbot-secondary);
}

.chatbot-btn-outline {
  background: white;
  color: var(--chatbot-text);
  border-color: var(--chatbot-border);
}

.chatbot-btn-outline:hover:not(:disabled) {
  background: var(--chatbot-bg-alt);
  border-color: var(--chatbot-text);
  color: var(--chatbot-text);
}

/* Badges */
.chatbot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 11px;
  background: var(--chatbot-text-secondary);
  color: white;
  margin-right: 8px;
  flex-shrink: 0;
}

.chatbot-badge-primary {
  background: var(--chatbot-primary);
}

.chatbot-badge-info {
  background: #0dcaf0;
}

.chatbot-badge-warning {
  background: #ffc107;
  color: #212529;
}

.chatbot-badge-choice {
  background: #FEF3C7;
  color: #92400E;
}

.chatbot-badge-ox {
  background: #FCE7F3;
  color: #9D174D;
}

/* Text colors (Bootstrap 대체) */
.chatbot .text-success { color: #198754; }
.chatbot .text-danger { color: #dc3545; }
.chatbot .text-warning { color: #ffc107; }
.chatbot .text-muted { color: #6c757d; }
.chatbot .small { font-size: 0.85em; }

/* Summary item (embed용) */
.chatbot .chatbot-summary-item {
  margin-bottom: 6px;
  padding: 8px 0;
  background: transparent;
  border: none;
  border-radius: 0;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
}

.chatbot .chatbot-summary-item:last-child {
  margin-bottom: 0;
}

.chatbot .chatbot-summary-item .chatbot-badge {
  min-width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  font-size: 0.75rem;
  margin-top: 2px;
}

/* Recommend question (embed용) */
.chatbot .chatbot-recommend-item {
  margin-bottom: 10px;
  border: 1.5px solid var(--chatbot-primary-light);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.chatbot .chatbot-recommend-item:last-child {
  margin-bottom: 0;
}

.chatbot .chatbot-recommend-item:hover {
  border-color: var(--chatbot-primary);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
}

.chatbot .chatbot-recommend-question {
  padding: 14px 16px;
  background: rgba(124, 58, 237, 0.04);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  line-height: 1.5;
}

.chatbot .chatbot-recommend-question:hover {
  background: rgba(124, 58, 237, 0.08);
}

.chatbot .chatbot-recommend-q-text {
  flex: 1;
}

.chatbot .chatbot-recommend-toggle {
  font-size: 0.7rem;
  color: var(--chatbot-text-secondary);
  margin-left: 8px;
}

.chatbot .chatbot-recommend-answer {
  padding: 12px 16px 14px;
  background: rgba(124, 58, 237, 0.02);
  border-top: 1px solid var(--chatbot-border);
  color: var(--chatbot-text-secondary);
  font-size: 0.9em;
  line-height: 1.6;
}

.chatbot .chatbot-recommend-a-label {
  font-weight: 600;
  color: var(--chatbot-primary);
  margin-right: 4px;
}

.chatbot .chatbot-recommend-question .chatbot-badge {
  min-width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  background: var(--chatbot-primary);
  color: white;
  font-size: 0.8rem;
}

#malgn-tab-recommend h6,
#malgn-tab-recommend h6 i,
#tab-recommend h6,
#tab-recommend h6 i {
  color: var(--chatbot-primary);
}

/* Quiz spacing (embed용) */
.chatbot .chatbot-quiz-progress { margin-bottom: 12px; }
.chatbot .chatbot-quiz-question { margin-bottom: 16px; }
.chatbot .chatbot-quiz-nav { margin-top: 16px; }
.chatbot .chatbot-quiz-result { margin-top: 12px; }

/* Markdown Styles */
.chatbot-msg-content .chatbot-h {
  display: block;
  margin: 8px 0 4px;
}

.chatbot-msg-content .chatbot-h1 { font-size: 1.1em; }
.chatbot-msg-content .chatbot-h2 { font-size: 1.05em; }
.chatbot-msg-content .chatbot-h3 { font-size: 1em; }
.chatbot-msg-content .chatbot-h4 { font-size: 0.95em; }

.chatbot-msg-content .chatbot-list {
  margin: 6px 0;
  padding-left: 20px;
}

.chatbot-msg-content .chatbot-list li {
  margin-bottom: 4px;
  line-height: 1.6;
}

.chatbot-msg-content .chatbot-inline-code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "SF Mono", "Consolas", "Menlo", monospace;
  font-size: 0.9em;
}

.chatbot-msg-content .chatbot-code-block {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 12px 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
  font-family: "SF Mono", "Consolas", "Menlo", monospace;
  font-size: 0.85em;
  line-height: 1.5;
}

.chatbot-msg-content .chatbot-code-block code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.chatbot-msg-content .chatbot-hr {
  border: none;
  border-top: 1px solid var(--chatbot-border);
  margin: 8px 0;
}

/* Text colors */
.chatbot .text-success { color: #059669 !important; }
.chatbot .text-danger { color: #DC2626 !important; }
