/* ============================================
   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;
  }
}