/**
 * 🧱 hospice-web-pwa / components.css
 * 상단 헤더 및 하단 GNB 네비게이션 바 전용 스타일 컴포넌트
 * 네이버 스타일 1.8px 라인형 아이콘 및 클린 화이트 레이아웃
 */

/* 1. 상단 56px 고정 헤더 */
.app-top-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max-width);
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-header);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.header-inner {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.bi-emblem {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.bi-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bi-fallback {
  color: #ffffff;
  font-weight: 800;
  font-size: 16px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--sage-deep);
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.brand-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--sage-primary);
  background: var(--sage-pale);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-top: 2px;
  width: fit-content;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  border: none;
  background: #f1f5f9;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-switch-btn:hover {
  background: #e2e8f0;
  color: var(--color-primary, #3E6553);
}

.mode-switch-btn.active-patient {
  background: var(--color-tertiary-pale, #FCF6EA);
  border: none;
  color: var(--color-tertiary-dark, #9E7027);
  font-weight: 800;
}

.btn-mypage {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: #f1f5f9;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-mypage:hover {
  border-color: var(--sage-primary);
  color: var(--sage-primary);
  background: var(--sage-bg);
}

.btn-mypage-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8px;
  fill: none;
}

.btn-emergency {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--red-bg);
  background: var(--red-bg);
  color: var(--red-urgent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.btn-emergency:hover {
  background: #fecaca;
}

/* 2. 하단 60px 고정 네이버식 GNB */
.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max-width);
  height: var(--nav-height);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  box-shadow: var(--shadow-nav);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
}

.nav-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  gap: 3px;
  transition: all 0.18s ease;
  user-select: none;
}

/* 3중 활성 피드백 1: 상단 2.5px 인디케이터 점등 바 */
.nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2.5px;
  background: var(--sage-dark);
  border-radius: 0 0 2px 2px;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
  color: var(--sage-primary);
}

.nav-item:active {
  transform: scale(0.95);
}

/* 3중 활성 피드백 2 & 3: 색상 반전 + 텍스트 Bold 800 + 인디케이터 확장 */
.nav-item.active {
  color: var(--sage-dark);
  font-weight: 800;
}

.nav-item.active::before {
  width: 32px;
}

/* 3중 활성 피드백 4: 아이콘 선 두께 1.8px -> 2.2px 볼드화 및 정위치 강조 */
.nav-icon-svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.8px;
  fill: none;
  transition: stroke-width 0.15s ease, transform 0.15s ease;
}

.nav-item.active .nav-icon-svg {
  stroke-width: 2.2px;
  transform: translateY(-1px);
}

.nav-label {
  font-size: 11px;
  line-height: 1;
  letter-spacing: -0.2px;
  transition: font-weight 0.15s ease;
}

/* 3. 내비게이션 상시 유지 원칙: 환우 모드에서도 하단 GNB 100% 항상 표시 */
body.mode-patient .app-bottom-nav {
  display: flex; /* 상시 노출 유지 */
}

