/* ========================================
   Tab Navigation
   ======================================== */

.tab-navigation {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  padding: 0 20px;
  margin-top: env(safe-area-inset-top);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  padding: 8px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  min-width: 150px;
}

/* PWAモード時は縦向きのみナビゲーションを60px下げる */
@media (orientation: portrait) {
  .mode-pwa .tab-navigation {
    top: 10px; /* 20px + 60px */
  }
}
/* 横向き時は通常位置 */
@media (orientation: landscape) {
  .mode-pwa .tab-navigation {
    top: 0px;
  }
}

.tab-button {
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 20px;
  font-family: "Sniglet", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-weight: normal;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: rgba(255, 255, 255, 0.7);
  position: relative;
  overflow: hidden;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
}

.tab-button .material-icons {
  font-size: 18px;
  line-height: 1;
}

.tab-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #007AFF, #5856D6);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.tab-button:hover {
  color: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.tab-button.active {
  color: #ffffff;
  background: linear-gradient(135deg, #007AFF, #5856D6);
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0, 122, 255, 0.4);
  transform: translateY(0px);
}

.tab-button.active::before {
  opacity: 1;
}

.tab-button:not(.active):hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

/* ========================================
   Tab Navigation with Labels
   ======================================== */
.tab-navigation.has-labels {
  /* adjust if needed */
}

.tab-navigation.has-labels .tab-button {
  width: auto;
  min-width: 70px;
  max-width: initial;
  aspect-ratio: auto;
  border-radius: 20px;
  padding: 6px 14px;
  flex-direction: row;
  gap: 6px;
  height: 40px;
  max-height: 40px;
}

.tab-navigation.has-labels .tab-button .material-icons {
  font-size: 16px;
}

.tab-label {
  font-size: 13px;
  line-height: 1;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  white-space: nowrap;
}
