/* ===== 기본 스타일 ===== */
* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
  background: #f8fafc;
}

/* ===== 화면 전환 ===== */
.screen { display: none; }
.screen.active { display: flex; }

/* ===== 채팅 영역 ===== */
#chat-box {
  height: 420px;
  overflow-y: auto;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  scroll-behavior: smooth;
}

.chat-bubble {
  display: flex;
  margin-bottom: 14px;
  animation: fadeIn .25s ease;
}
.chat-bubble.counselor { justify-content: flex-end; }
.chat-bubble.client   { justify-content: flex-start; }

.bubble-inner {
  max-width: 72%;
  padding: 10px 15px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.chat-bubble.counselor .bubble-inner {
  background: #3b82f6;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble.client .bubble-inner {
  background: #fff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}

.bubble-name {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 3px;
}

/* ===== 타이머 ===== */
#timer-display {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

/* ===== 진행바 ===== */
#progress-bar {
  transition: width 1s linear;
}

/* ===== 점수 카드 ===== */
.score-card {
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
.score-bar-bg {
  background: #e5e7eb;
  border-radius: 9999px;
  height: 8px;
  overflow: hidden;
}
.score-bar-fill {
  height: 8px;
  border-radius: 9999px;
  transition: width .8s ease;
}

/* ===== 로딩 도트 ===== */
.dot-flashing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dot-flashing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #9ca3af;
  animation: dotBounce 1.2s infinite ease-in-out;
}
.dot-flashing span:nth-child(2) { animation-delay: .2s; }
.dot-flashing span:nth-child(3) { animation-delay: .4s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: .5; }
  40%           { transform: scale(1.2); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== 시나리오 카드 ===== */
.scenario-card {
  cursor: pointer;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
}
.scenario-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 12px rgba(59,130,246,.15);
}
.scenario-card.selected {
  border-color: #3b82f6;
  background: #eff6ff;
}

/* ===== 시나리오 카테고리 탭 ===== */
.category-tab {
  padding: 8px 18px;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.category-tab:hover { border-color: #93c5fd; }
.category-tab.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

/* ===== 난이도 배지 ===== */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-low    { background: #dcfce7; color: #16a34a; }
.badge-mid    { background: #fef9c3; color: #ca8a04; }
.badge-high   { background: #fee2e2; color: #dc2626; }

/* ===== 관리자 탭 버튼 ===== */
.admin-tab-btn {
  padding: 8px 20px;
  border-radius: 8px 8px 0 0;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: #e5e7eb;
  color: #6b7280;
  transition: background .15s;
}
.admin-tab-btn.active {
  background: #fff;
  color: #7c3aed;
  border-bottom: 2px solid #8b5cf6;
}

.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }

/* ===== 탭 ===== */
.tab-btn {
  padding: 8px 20px;
  border-radius: 8px 8px 0 0;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: #e5e7eb;
  color: #6b7280;
  transition: background .15s;
}
.tab-btn.active {
  background: #fff;
  color: #1d4ed8;
  border-bottom: 2px solid #3b82f6;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== 인증 화면 탭 패널 ===== */
.auth-panel { display: none; }
.auth-panel.active { display: block; }

/* ===== 인증 탭 버튼 ===== */
.auth-tab-btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: #f1f5f9;
  color: #94a3b8;
  transition: background .15s, color .15s;
  border-radius: 0;
}
.auth-tab-btn:first-child { border-radius: 8px 0 0 0; }
.auth-tab-btn:last-child  { border-radius: 0 8px 0 0; }
.auth-tab-btn.active {
  background: #fff;
  color: #1d4ed8;
  border-bottom: 2px solid #3b82f6;
}

/* ===== 보고서 탭 스크롤 ===== */
#screen-report main {
  overflow-y: auto;
}

/* ===== 보고서 이론 카드 ===== */
.theory-card {
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #e5e7eb;
  margin-bottom: 14px;
}

/* ===== 보고서 PDF 버튼 로딩 ===== */
#download-report-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ===== 스크롤바 ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 9999px; }
