/**
 * アプリ更新通知バー
 *
 * 上部に固定表示する通知バー。サーバ側の BUILD_ID が初期値と異なるときだけ表示する。
 * C-HUB のアクセント色を流用、ライト/ダーク両対応。
 * 関連設計書: docs/design/2026-04-29_app_update_notification_design.md §5.1
 */

.app-update-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-app-update-bar);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  min-height: 40px;
  padding: 4px 20px;
  background: var(--color-accent-strong);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.32);
  transform: translateY(-100%);
  transition: transform 300ms ease-out;
}

.app-update-bar--visible {
  transform: translateY(0);
  animation: app-update-bar-drop 460ms ease-out both;
}

/* 登場時に軽く弾ませて視線を引く（動きを抑える設定では無効化） */
@keyframes app-update-bar-drop {
  0% {
    transform: translateY(-100%);
  }
  70% {
    transform: translateY(3px);
  }
  85% {
    transform: translateY(-2px);
  }
  100% {
    transform: translateY(0);
  }
}

.app-update-bar__message {
  flex: 0 1 auto;
  line-height: 1.4;
  opacity: 0.95;
}

.app-update-bar__message-mobile {
  display: none;
}

.app-update-bar__button {
  flex: 0 0 auto;
  min-width: 72px;
  min-height: 26px;
  padding: 3px 14px;
  background: #ffffff;
  color: var(--color-accent-strong);
  border: 1.5px solid var(--color-error);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    transform 80ms ease,
    box-shadow 120ms ease;
}

.app-update-bar__button:hover {
  background: #eef1fb;
  border-color: var(--color-error-hover);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.34);
  transform: translateY(-1px);
}

.app-update-bar__button:active {
  background: #e0e5f7;
  border-color: var(--color-error-hover);
  transform: translateY(0);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.app-update-bar__button:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.6);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .app-update-bar__message-pc {
    display: none;
  }

  .app-update-bar__message-mobile {
    display: inline;
  }

  /* スマホは画面領域を圧迫しないよう 24px に圧縮 */
  .app-update-bar {
    padding: 1px 12px;
    gap: 8px;
    font-size: 11px;
    min-height: 24px;
  }

  .app-update-bar__button {
    min-width: 60px;
    min-height: 20px;
    padding: 0 10px;
    font-size: 11px;
    border-radius: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-update-bar {
    transition: none;
  }

  .app-update-bar--visible {
    animation: none;
  }

  .app-update-bar__button {
    transition: none;
  }
}
