/* KaTeX 수식 폰트 색상을 현재 부트스트랩 테마 글자색과 일치시킴 */
.markdown-content .katex {
    color: inherit !important;
    font-size: 1.05em; /* 수식 글자 크기 살짝 보정 */
}

/* 부트스트랩 라이트/다크모드 자동 연동 마크다운 스타일 */
.markdown-content {
  /* 글자색과 폰트를 부트스트랩의 현재 테마 색상으로 고정 */
  color: var(--bs-body-color) !important;
  line-height: 1.6;
}

/* 1. 일반 텍스트 및 제목 */
.markdown-content p,
.markdown-content h1, 
.markdown-content h2, 
.markdown-content h3, 
.markdown-content h4, 
.markdown-content h5, 
.markdown-content h6 {
  color: var(--bs-body-color) !important;
  margin-bottom: 0;
}

.markdown-content h1, .markdown-content h2 {
  border-bottom: 1px solid var(--bs-border-color);
  padding-bottom: 0.3em;
  margin-top: 1em;
}

/* 2. 인라인 코드 (문장 중간의 `code`) */
.markdown-content :not(pre) > code {
  background-color: var(--bs-tertiary-bg) !important;
  color: var(--bs-danger) !important; /* 부트스트랩 강조 색상 사용 */
  padding: 0.2em 0.4em;
  border-radius: var(--bs-border-radius-sm);
  font-size: 0.875em;
}

/* 3. 코드 블록 전체 (Highlight.js 영역) */
.markdown-content pre {
  padding: 1rem;
  border-radius: var(--bs-border-radius);
  border: 1px solid var(--bs-border-color);
  overflow-x: auto;
  margin-bottom: 1rem;
}

/* 4. 표 (Table) - 라이트/다크 자동 전환 */
.markdown-content table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
  color: var(--bs-body-color);
}

.markdown-content th, 
.markdown-content td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--bs-border-color);
}

.markdown-content th {
  background-color: var(--bs-tertiary-bg) !important;
  font-weight: 600;
}

/* 5. 인용구 (Blockquote) */
.markdown-content blockquote {
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--bs-primary);
  color: var(--bs-secondary-color);
  background-color: var(--bs-tertiary-bg);
  border-radius: 0 var(--bs-border-radius) var(--bs-border-radius) 0;
}

/* 6. 리스트 */
.markdown-content ul, 
.markdown-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

/* 7. 구분선 */
.markdown-content hr {
  border-color: var(--bs-border-color);
  opacity: 1;
}



/*****************/



.attach-zone {
    border: 2px dashed #ced4da;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    /* background-color: #f8f9fa; */
}

.attach.dragover {
    /* background-color: #e9f5ff; */
    border-color: #0d6efd;
}

.file-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* 기본 스타일 */
.custom-datalist {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-top: none;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 999;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--bs-box-shadow);
  display: none;
}

.custom-datalist div.option-item {
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  color: var(--bs-body-color);
}

.custom-datalist div.option-item:hover {
  background: var(--bs-tertiary-bg);
}

/* 강조 색상 (기본 밝은 노랑) */
.highlight {
  background-color: rgba(255, 230, 128, 0.7);
  font-weight: 600;
  border-radius: 2px;
  padding: 0 2px;
}

/* 🌙 다크 모드용 조정 */
:root[data-bs-theme="dark"] .highlight {
    background-color: rgba(255, 220, 90, 0.5); /* 눈 아프지 않은 부드러운 노랑 */
    color: #fff; /* 어두운 배경에서 대비 확보 */
}

/* 블러 오버레이 */
#blur-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  backdrop-filter: blur(8px);
  background-color: rgba(0, 0, 0, 0.3);
  display: none;
  z-index: 999;
}

/* 검색 패널 */
#patient-panel,
#disease-panel {
  position: fixed;
  top: 20%; left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  /* background: white; */
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(0,0,0,0.3);
  padding: 20px;
  display: none;
  z-index: 1000;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translate(-50%, -45%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

/* 검색창 */
#disease-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 1.2rem;
}

.result-item {
  padding: 8px 10px;
  /* cursor: pointer; */
}

/* .result-item:hover {
  background: var(--bs-tertiary-bg);
} */

/* 닫기 버튼 */
#patient-close-btn,
#disease-close-btn {
  position: absolute;
  top: 10px; right: 15px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  color: #888;
  cursor: pointer;
}


a {
  text-decoration: underline;
  text-decoration-style: dotted; /* 밑줄 점선 */
  text-underline-offset: 2px; 
  /* color: #007bff; */
}
pre {
  white-space: pre-wrap;     /* 줄바꿈 유지 + 자동 줄바꿈 */
  word-wrap: break-word;     /* 긴 단어도 줄바꿈 */
  line-height: 1.6;
  margin: 0;                 /* pre 기본 여백 제거 */
}

.theme-toggle {
  position: fixed;
  /* top: 1rem; */
  top: 0.3rem;
  right: 1rem;
  z-index: 1080;
  padding: .5rem .75rem;
  border-radius: .75rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

/* Header 배경 이미지 적용 */
/* .header {
  background: url('header_bg.png') no-repeat center center;
  background-size: cover;
  align-items: center;
  position: relative;
  color: white;
} */

/* 헤더 안의 텍스트 가독성을 위해 살짝 그림자 */
.header h2 {
  text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  margin: 0;
  font-family: Arial, sans-serif;
}

.vh-100 {
  height: 100vh;
}

.header {
  flex-shrink: 0;
}

.main {
  display: flex;
  flex-grow: 1;
  overflow: hidden;
}

.sidebar {
  width: 250px;
  /* background-color: #f8f9fa; */
  padding: 15px;
  overflow-y: auto;
  flex-shrink: 0;
}

.content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
}

.main-content {
  flex-grow: 1;
}

.footer {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  padding-top: 10px;
}
#msg {
  resize: none;          /* 수동 크기 조절 핸들 제거 (자동 조절과 충돌) */
  min-height: 0;
}
textarea#msg {
  flex-grow: 1;
}

button#send {
  flex-shrink: 0;
}

/* Add cursor change on hover for radio buttons */
.form-check-input:hover, 
.form-check-label:hover {
  cursor: pointer;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 10px;
}
th, td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}
th {
  background-color: #f4f4f4;
  font-weight: bold;
}

.active-item {
  /* background-color: #6c757d;
  color: #fff;
  border-color: #6c757d; */
  color: var(--bs-list-group-action-hover-color);
  text-decoration: none;
  background-color: var(--bs-list-group-action-hover-bg);
}

/* .btn-outline-secondary {
  --bs-btn-border-color: initial;
} */

/* 닫기 버튼 */
#disease-close-btn {
  position: absolute;
  top: 10px; right: 15px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  color: #888;
  cursor: pointer;
}

.attach-popover {
  max-width: none;
  width: calc(100% - 1rem);
}
.content {
  position: relative;   /* 패널 기준점 */
}

#attach-panel {
  display: none;
  position: absolute;
  left: .5rem;                         /* 점선이 잘리지 않도록 좌우 여백 */
  right: .5rem;
  bottom: var(--footer-h, 140px);
  z-index: 20;
  max-height: 50%;
  overflow-y: auto;

  border: 2px dashed var(--bs-border-color);   /* 둥근 점선 */
  border-radius: 1rem;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, .15);
}

#attach-panel .attach-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
}

.markdown-content img {
  max-width: 100%;
  height: auto;
  border-radius: .5rem;
}