/* ==============================
   Reborn Customer Common Styles
   - customer 페이지 공통 스타일
   - 향후 페이지 확장 시 이 파일에 추가
   ============================== */

/* 공통 스타일 */
main {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

nav {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: #fff;
  border-top: 1px solid #e1e2ec;
  padding: 10px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.input-wrap {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 5rem;
  max-width: 600px;
  width: 100%;
  margin: 0;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border-top: 1px solid #f1f5f9;
  z-index: 40;
}

/* 하단 추천 질문 칩 */
.suggestion-chips {
  display: flex;
  gap: 5px;
  padding: 16px;
  overflow-x: auto;
}

.suggestion-chip {
  white-space: nowrap;
  padding: 5px 7px;
  border-radius: 9999px;
  background: rgba(90, 90, 90, 0.10);
  color: #808080;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
  backdrop-filter: blur(2px);
}

.suggestion-chip:hover {
  background: rgba(100, 116, 139, 0.28);
  color: #1e293b;
}

.suggestion-chip:active {
  transform: scale(0.95);
}

/* 하단 입력 바 */
.chat-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 16px;
}

.chat-icon-btn {
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.chat-icon-btn:active {
  transform: scale(0.9);
}

.chat-icon-btn-plus {
  background: #e1e2ec;
  color: #424654;
}

.chat-icon-btn-mic {
  background: #0056d2;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 86, 210, 0.25);
}

.chat-input-box {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid #c3c6d6;
  background: #f2f3fe;
}

.chat-input-field {
  width: 100%;
  border: 0;
  background: transparent !important;
  outline: none;
  color: #191b23;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 1rem;
  line-height: 1.35;
  border: 0 !important;
  min-height: 24px;
  max-height: 120px;
  resize: none;
  overflow-y: auto;
  padding: 4px 0;
}

.chat-input-field::placeholder {
  color: #737785;
}

.chat-input-field.is-loading {
  opacity: 0.7;
}

.chat-emoji-btn {
  border: 0;
  background: transparent;
  color: #0040a1;
  transition: transform 0.2s ease;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-emoji-btn:active {
  transform: scale(0.9);
}

/* 아이콘 폰트 기본 설정 */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* 챗 버블 공통 */
.chat-bubble-ai {
  position: relative;
  background: #ffffff;
  border: 1px solid #e1e2ec;
}

.chat-bubble-user {
  position: relative;
  background: #fae100;
  color: #3c1e1e;
}

/* 수평 스크롤 영역 스크롤바 숨김 */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 기본 레이아웃 높이 */
body {
  min-height: max(884px, 100dvh);
}

.scroll-latest-btn {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 160px;
  z-index: 45;
  border: 0;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
}

.scroll-latest-btn.d-none {
  display: none;
}

/* voice home (index.php) */
.voice-home {
  max-width: 600px;
  margin: 0 auto;
  padding: 12px 20px 32px;
}

/* 음성 홈: 모바일에서 마이크·안내·칩을 하단 탭(h-20 + safe-area) 바로 위에 고정 */
.voice-thumb-dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.voice-hero {
  text-align: center;
  padding-top: 18px;
}

.voice-mode-label {
  margin: 0 0 14px;
  font-size: 14px;
  color: #111827;
}

.voice-title {
  margin: 0;
  font-family: "Noto Sans KR", sans-serif;
  font-weight: 800;
  font-size: 42px;
  line-height: 1.15;
  color: #1847b8;
}

.voice-subtitle {
  margin: 14px 0 0;
  font-size: 30px;
  line-height: 1.25;
  color: #4b5563;
  font-weight: 600;
}

.voice-mic-wrap {
  width: 350px;
  height: 350px;
  margin: 44px auto 0;
  border: 0;
  border-radius: 9999px;
  background: radial-gradient(circle at center, rgba(24, 71, 184, 0.08), rgba(24, 71, 184, 0.04));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.voice-mic-wrap:active {
  transform: scale(0.98);
}

.voice-mic-core {
  width: 242px;
  height: 242px;
  border-radius: 9999px;
  background: linear-gradient(165deg, #3e7dff, #1b4ecf);
  border: 6px solid #3b73e0;
  box-shadow: 0 18px 40px rgba(25, 72, 187, 0.32);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.voice-mic-wrap.is-listening .voice-mic-core {
  animation: voicePulse 1.3s infinite;
}

.voice-mic-wrap.is-processing .voice-mic-core {
  background: linear-gradient(165deg, #64748b, #334155);
  border-color: #64748b;
}

.voice-mic-wrap.is-speaking .voice-mic-core {
  background: linear-gradient(165deg, #16a34a, #15803d);
  border-color: #16a34a;
}

.voice-mic-core .material-symbols-outlined {
  font-size: 88px;
  color: #f8fafc;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 48;
}

.voice-example {
  margin: 40px 0 0;
  font-size: 22px;
  color: #9ca3af;
  font-style: italic;
}

/* 모바일: column-reverse → 시각 순서 = 칩 → 안내 문구 → 마이크(탭과 가장 가까움) */
@media (max-width: 639.98px) {
  .voice-home {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px) + 360px);
  }

  .voice-thumb-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(5rem + env(safe-area-inset-bottom, 0px) + 10px);
    z-index: 40;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 50px 16px;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
  }

  .voice-thumb-dock > * {
    pointer-events: auto;
  }

  .voice-thumb-dock .voice-mic-wrap {
    width: min(220px, 58vw);
    height: min(220px, 58vw);
    margin: 0;
  }

  .voice-thumb-dock .voice-mic-core {
    width: 68%;
    height: 68%;
    border-width: 5px;
  }

  .voice-thumb-dock .voice-mic-core .material-symbols-outlined {
    font-size: 56px;
  }

  .voice-thumb-dock .voice-example {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    padding: 20px 8px;
    max-width: 100%;
  }

  .voice-thumb-dock-chips.suggestion-chips {
    padding: 8px 0 0;
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .voice-thumb-dock .suggestion-chip {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 0.8125rem;
  }

  /* 답변 카드가 열리면 도크를 고정 해제 → 본문 아래에 붙여 스크롤로 전부 읽기 가능 */
  .voice-home.voice-home--result-visible {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px) + 28px);
  }

  .voice-hero--has-result .voice-thumb-dock {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    margin-top: 1.25rem;
    padding: 0 4px 8px;
    pointer-events: auto;
  }

  .voice-hero--has-result .voice-result-card {
    margin-top: 0;
  }
}

.voice-tip-card {
  margin: 54px auto 0;
  max-width: 470px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  border-radius: 18px;
  border: 1px solid #d7dce7;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  padding: 18px 18px;
}

.voice-tip-card .material-symbols-outlined {
  color: #3569d6;
  font-size: 22px;
  margin-top: 2px;
}

.voice-tip-card p {
  margin: 0;
  font-size: 24px;
  line-height: 1.4;
  color: #111827;
  font-weight: 600;
}

.voice-result-card {
  margin: 22px auto 0;
  max-width: 470px;
  border-radius: 16px;
  border: 1px solid #d4dbe8;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  padding: 14px 14px;
  text-align: left;
}

.voice-result-label {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
}

.voice-result-heard,
.voice-result-answer {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: #0f172a;
}

.voice-result-heard-head {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.voice-result-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.voice-result-heard-title {
  margin: 0;
  font-size: 13px;
  color: #334155;
  font-weight: 700;
}

.voice-stop-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.voice-stop-btn .material-symbols-outlined {
  font-size: 18px;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.voice-icon-svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: inline-block;
  flex: 0 0 auto;
}

.voice-result-divider {
  margin: 10px 0;
  height: 1px;
  background: #e2e8f0;
}

.voice-result-actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

/* 한 줄: 다시 읽기 + 정지 */
.voice-result-actions-row {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.voice-result-actions-row .voice-action-btn {
  flex: 1;
  min-width: 0;
}

.voice-action-btn {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-sizing: border-box;
}

.voice-action-btn-primary {
  flex: none;
  width: 100%;
  max-width: 100%;
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

.voice-action-btn-stop {
  min-width: 0;
}

.voice-action-btn-replay {
  margin-left: 0;
}

@keyframes voicePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 115, 224, 0.45);
  }
  70% {
    box-shadow: 0 0 0 24px rgba(59, 115, 224, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 115, 224, 0);
  }
}

@media (max-width: 600px) {
  .voice-title {
    font-size: 24px;
  }

  .voice-subtitle {
    font-size: 18px;
  }

  .voice-mic-wrap {
    width: min(84vw, 300px);
    height: min(84vw, 300px);
    margin-top: 34px;
  }

  .voice-mic-core {
    width: min(54vw, 220px);
    height: min(54vw, 220px);
  }

  .voice-mic-core .material-symbols-outlined {
    font-size: 68px;
  }

  .voice-example {
    font-size: 18px;
    margin-top: 28px;
  }

  .voice-tip-card {
    margin-top: 34px;
    max-width: 92%;
  }

  .voice-tip-card p {
    font-size: 18px;
  }

}

/* 간편예약 booking.php — 선택 상태(Tailwind CDN이 JS 전용 클래스를 못 쓸 때 대비) */
.booking-doctor-card.is-selected,
.booking-hospital-card.is-selected {
  border-color: #0040a1 !important;
  box-shadow: 0 0 0 3px rgba(0, 64, 161, 0.12);
}

.booking-hospital-card--filtered-out {
  display: none !important;
}

.booking-slot.is-selected {
  background-color: #0040a1 !important;
  color: #fff !important;
  border-color: #0040a1 !important;
}

.booking-slot:not(.is-selected):not(:disabled) {
  background-color: #fff;
  color: #0f172a;
  border-color: #e2e8f0;
}

.booking-reason.is-selected {
  background-color: #eff6ff !important;
  border-color: #0040a1 !important;
  color: #0040a1 !important;
}

.booking-reason.is-selected .material-symbols-outlined {
  color: #0040a1 !important;
}

.booking-reason:not(.is-selected) {
  background-color: #fff;
  border-color: #e2e8f0;
  color: #334155;
}

.booking-reason:not(.is-selected) .material-symbols-outlined {
  color: #64748b;
}
