/* ========================================
   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: 6px 14px;
  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: auto;
  height: 36px;
  min-width: auto;
  min-height: 36px;
  /* max-width: auto; */
  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-text-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.tab-text-label + .tab-label {
  display: none;
}

.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 {
  max-width: calc(100vw - 24px);
  padding-right: 58px;
}

/* ========================================
   Login Status
   ======================================== */

.sc-login-status {
  position: fixed;
  top: 50%;
  left: 0;
  z-index: 1002;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.9);
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.sc-login-button {
  position: fixed;
  top: 50%;
  left: 0;
  z-index: 1002;
  transform: translateY(-50%);
}

.sc-login-status summary,
.sc-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 30px;
  min-height: 92px;
  padding: 10px 6px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(12, 14, 18, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  writing-mode: vertical-rl;
}

.sc-login-status summary {
  list-style: none;
}

.sc-login-status summary::-webkit-details-marker {
  display: none;
}

.sc-login-button::before {
  content: "login";
  font-family: "Material Icons";
  font-size: 16px;
  font-weight: normal;
  line-height: 1;
  writing-mode: horizontal-tb;
}

.sc-login-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  background: #49e68b;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(73, 230, 139, 0.8);
}

.sc-login-text {
  white-space: nowrap;
}

.sc-login-menu {
  position: absolute;
  top: 50%;
  left: calc(100% + 8px);
  z-index: 10;
  display: grid;
  gap: 10px;
  min-width: min(84vw, 280px);
  padding: 12px;
  background: rgba(12, 14, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.36);
  transform: translateY(-50%);
}

.sc-login-email {
  min-width: 0;
  max-width: 240px;
  margin: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-login-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  text-decoration: none;
}

.sc-login-logout:hover {
  color: #ffffff;
}

@media (max-width: 720px) {
  .sc-login-status summary,
  .sc-login-button {
    min-height: 82px;
    padding: 9px 5px;
    font-size: 12px;
  }

  .sc-login-menu {
    left: calc(100% + 6px);
  }
}

.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;
}

.camera-reload-button {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(180deg, #ffae25 0%, #ff7a1a 100%);
  box-shadow: 0 6px 16px rgba(255, 128, 24, 0.45);
  cursor: pointer;
  z-index: 2;
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.camera-reload-button .material-icons {
  font-size: 20px;
  line-height: 1;
}

.camera-reload-text {
  margin-top: -2px;
  font-size: 7px;
  font-weight: 800;
  line-height: 1;
}

.camera-reload-button:hover {
  transform: translateY(-50%) scale(1.04);
}

.camera-reload-button:active {
  transform: translateY(-50%) scale(0.98);
}

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

@media (max-width: 430px) {
  .tab-navigation.has-labels {
    padding-right: 50px;
  }

  .tab-navigation.has-labels .tab-button {
    min-width: 64px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .camera-reload-button {
    right: 5px;
    width: 38px;
    height: 38px;
  }

  .camera-reload-button .material-icons {
    font-size: 18px;
  }

  .camera-reload-text {
    font-size: 6.5px;
  }
}
