/* ============================================
   tab-bar.css — 하단 고정 탭 네비게이션
   - 모바일 우선 (60px 높이)
   - safe-area-inset 대응 (iOS 노치)
   - 5탭: Home / Intro / Characters / Content / MyInfo
   ============================================ */

/* 탭바 점유 영역 처리
   - .app은 100dvh - 탭바 높이로 축소 (내부 flex 자식들이 정확한 영역에서 스크롤)
   - body padding-bottom은 .app 외부 콘텐츠용 (보통 비어있음, 안전장치)
   - 탭바 60px + safe-area (iOS 노치) */
body.has-tab-bar {
  padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
}
body.has-tab-bar .app {
  height: calc(100dvh - 60px - env(safe-area-inset-bottom, 0px));
}

/* 탭바 컨테이너 */
.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  z-index: 1000;
  font-family: -apple-system, BlinkMacSystemFont, 'Noto Sans KR', 'Noto Sans JP', sans-serif;
}

/* 통화 중일 때 탭바 숨김 */
body.in-call .bottom-tab-bar,
body.modal-open .bottom-tab-bar {
  display: none;
}

/* 각 탭 버튼 */
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 500;
  transition: color 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  position: relative;
}

.tab-item:hover {
  color: #6b7280;
}

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

/* 활성 탭 */
.tab-item.active {
  color: #4FC3F7;
}

.tab-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: #4FC3F7;
  border-radius: 0 0 3px 3px;
}

/* 아이콘 */
.tab-item .tab-icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* 라벨 */
.tab-item .tab-label {
  line-height: 1;
  white-space: nowrap;
}

/* 잠금 표시 (게스트 제한 기능) */
.tab-item .tab-lock {
  position: absolute;
  top: 6px;
  right: 50%;
  margin-right: -18px;
  width: 12px;
  height: 12px;
  background: #fbbf24;
  border-radius: 50%;
  border: 2px solid #fff;
  display: none;
}

.tab-item.locked .tab-lock {
  display: block;
}

/* 데스크톱에서는 너비 제한 */
@media (min-width: 768px) {
  .bottom-tab-bar {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    border-radius: 12px 12px 0 0;
  }
}

/* 다크 모드 대응 (선택) */
@media (prefers-color-scheme: dark) {
  .bottom-tab-bar {
    background: #1f2937;
    border-top-color: #374151;
  }
  .tab-item {
    color: #6b7280;
  }
  .tab-item.active {
    color: #4FC3F7;
  }
}
/* ===== R066 (2026-10-18): 5탭 -> 6탭, 4글자 라벨 줄바꿈 방지 ===== */
.bottom-tab-bar .tab-item .tab-label {
  white-space: nowrap;
  letter-spacing: -0.3px;
}
@media (max-width: 380px) {
  .bottom-tab-bar .tab-item { padding: 6px 2px; }
  .bottom-tab-bar .tab-item .tab-label { font-size: 10px; }
  .bottom-tab-bar .tab-item .tab-icon { width: 22px; height: 22px; }
}
/* ===== R067 (2026-10-18): 내정보 하단 소개 진입 버튼 ===== */
.myinfo-intro-entry {
  padding: 8px 16px 28px;
  text-align: center;
}
.myinfo-intro-entry .myinfo-intro-btn {
  width: 100%;
  max-width: 420px;
  padding: 13px 16px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fff;
  color: #555;
  font-size: 14px;
  cursor: pointer;
}
.myinfo-intro-entry .myinfo-intro-btn:active {
  background: #f3f3f3;
}
/* ===== R069 2026-10-18: 헤더 '서비스 소개' 라벨형 버튼 ===== */
.intro-label-btn{
  width:auto !important;
  min-width:0 !important;
  padding:0 10px !important;
  border-radius:16px !important;
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  gap:4px;
  font-size:12px;
  font-weight:600;
  line-height:1;
  white-space:nowrap;
}
.intro-label-btn .ilb-ico{ font-size:13px; }
.intro-label-btn:active{ transform:scale(.96); }
@media (max-width:360px){
  .intro-label-btn{ padding:0 8px !important; font-size:11px; }
  .intro-label-btn .ilb-ico{ font-size:12px; }
}

/* ===== R070 2026-10-18: 헤더 로고 홈 이동 ===== */
.home-link{ cursor:pointer; -webkit-tap-highlight-color:transparent; }
.home-link:active{ transform:scale(.97); }
.home-link:focus-visible{ outline:2px solid rgba(255,255,255,.6); outline-offset:2px; border-radius:8px; }
