/* MP-2163: 상담 모드 — admin(상담자)과 view(고객)가 함께 쓰는 언어 선택·시작·종료 화면. */

/* 덮개는 페이지 머리·패널 위에, 모달·연결 상태 표시 아래에 둔다.
   배경은 비치지 않게 한다 — 뒤에는 앞 고객의 대화가 남아 있을 수 있다 */
.consultation-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
  background: #0f172a;
  color: #f8fafc;
}

.consultation-overlay[hidden],
.consultation-end-bar[hidden] {
  display: none;
}

.consultation-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: min(960px, 100%);
  max-height: 100%;
}

.consultation-panel__title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
}

.consultation-panel__subtitle {
  margin: -0.5rem 0 0;
  color: #cbd5e1;
  text-align: center;
}

.consultation-panel__client,
.consultation-panel__status,
.consultation-panel__summary {
  margin: 0;
  color: #cbd5e1;
  font-size: 1.05rem;
  text-align: center;
}

.consultation-panel__message {
  margin: 0;
  color: #fca5a5;
  font-size: 1rem;
  text-align: center;
}

/* 언어 선택 — 그 언어 자신의 이름을 크게, 한국어 이름을 작게 */
.consultation-picker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  min-height: 0;
}

.consultation-picker__search {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid #475569;
  border-radius: 10px;
  background: #0f172a;
  color: inherit;
  font-size: 1rem;
}

.consultation-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
  max-height: 55vh;
  overflow-y: auto;
}

.consultation-picker__language {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.8rem 0.5rem;
  border: 2px solid #334155;
  border-radius: 12px;
  background: #1e293b;
  color: inherit;
  cursor: pointer;
}

.consultation-picker__language[hidden] {
  display: none;
}

.consultation-picker__language:hover {
  border-color: #64748b;
}

.consultation-picker__language.is-suggested {
  border-color: #60a5fa;
}

.consultation-picker__language.is-selected {
  border-color: #fee500;
  background: #3f3a12;
}

.consultation-picker__native {
  font-size: 1.15rem;
  font-weight: 600;
}

.consultation-picker__korean {
  color: #94a3b8;
  font-size: 0.8rem;
}

/* 검색에 맞는 언어가 없을 때의 한 줄 */
.consultation-picker__empty {
  margin: 0;
  color: #cbd5e1;
  text-align: center;
}

/* 큰 시작 버튼 — 뮤트 알림 배지와 비슷한 크기 */
.consultation-start {
  padding: 1.5rem 2.5rem;
  border: none;
  border-radius: 16px;
  background: #16a34a;
  color: #ffffff;
  font-size: 1.75rem;
  font-weight: 700;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.consultation-start:disabled {
  opacity: 0.6;
  cursor: progress;
}

.consultation-link {
  border: none;
  background: none;
  color: #93c5fd;
  font-size: 0.95rem;
  text-decoration: underline;
  cursor: pointer;
}

.consultation-note-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.consultation-note-button {
  padding: 0.75rem 1.5rem;
  border: 1px solid #fee500;
  border-radius: 10px;
  background: transparent;
  color: #fee500;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
}

/* 통역 중 하단 종료 막대 */
.consultation-end-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.85);
}

/* 종료 버튼 옆의 안내 한 줄 — 종료하는 중이거나, 다른 화면의 상담을 지켜보는 중일 때 */
.consultation-end-status {
  margin: 0;
  color: #f8fafc;
  font-size: 1.05rem;
}

/* 상담 화면에서는 현장 도우미 패널을 덮개 위에 둔다 — 마이크가 끊겨 저절로 열린 안내가 상담을
   끝낸 뒤 덮개에 가리면, 여는 버튼이 있는 헤더도 숨겨져 있어 다시 볼 길이 없다. 패널은 닫기로 닫는다 */
body.consultation-mode .ops-assistant-panel {
  z-index: 1600;
}

/* 종료 막대가 떠 있는 동안 현장 도우미 패널을 그 위로 올린다 — 입력 칸이 막대에 가리지 않게.
   막대 높이는 말풍선 영역의 아래 여백(5rem)과 같게 본다 */
body:has(.consultation-end-bar:not([hidden])) .ops-assistant-panel {
  bottom: calc(16px + 5rem);
  max-height: min(70vh, 640px, calc(100vh - 16px - 5rem - 16px));
}

.consultation-end-button {
  padding: 0.8rem 2.5rem;
  border: none;
  border-radius: 12px;
  background: #dc2626;
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
}

.consultation-end-button:disabled {
  opacity: 0.55;
  cursor: default;
}

/* admin — 상담 모드에서는 말풍선만 남기고 운영 도구를 숨긴다 (설정은 /settings 로 연다).
   새 말 안내는 남긴다 — 위를 보느라 멈춘 따라가기로 돌아가는 길이다 */
body.consultation-mode .header,
body.consultation-mode .multi-language-options,
body.consultation-mode #nextSessionBanner,
body.consultation-mode #adminPanel,
body.consultation-mode #viewerStatusPanel,
body.consultation-mode .interim-toggle-btn,
body.consultation-mode #translationStyleBtn,
body.consultation-mode .merge-status-badge {
  display: none !important;
}

/* 자막 줄을 누르면 열리는 STT 교정창은 운영자 도구다 */
body.consultation-mode #interim-translation {
  pointer-events: none;
}

body.consultation-mode .transcription-panel {
  padding-bottom: 5rem;
}

/* view — 상담 화면에서는 헤더·메뉴를 숨긴다. 설정을 다시 읽을 때마다 인라인 스타일이 다시 써지므로 클래스로 누른다 */
body.consultation-view .header,
body.consultation-view #menuToggle,
body.consultation-view .menu-dropdown {
  display: none !important;
}
