/* ============================================================
   Scroll To Top – Floating Button
   対象: チケット詳細ページ (/issues/:id)
   ============================================================ */

#scroll-to-top-btn {
  /* 位置 */
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9999;

  /* サイズ・形状 */
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;

  /* 色 – Redmine のデフォルト配色に合わせたダークグレー */
  background-color: #3e4349;
  color: #ffffff;

  /* シャドウ */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);

  /* アイコン中央揃え */
  display: flex;
  align-items: center;
  justify-content: center;

  /* 初期状態: 非表示 */
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);

  /* トランジション */
  transition:
    opacity     0.3s ease,
    visibility  0.3s ease,
    transform   0.3s ease,
    background-color 0.2s ease,
    box-shadow  0.2s ease;
}

/* 表示状態 */
#scroll-to-top-btn.stt-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ホバー */
#scroll-to-top-btn:hover {
  background-color: #2b6cb0;
  box-shadow: 0 6px 18px rgba(43, 108, 176, 0.45);
  transform: translateY(-2px);
}

/* フォーカス（キーボードアクセシビリティ） */
#scroll-to-top-btn:focus-visible {
  outline: 3px solid #63b3ed;
  outline-offset: 3px;
}

/* クリック時の押し込み感 */
#scroll-to-top-btn:active {
  transform: translateY(0) scale(0.93);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* SVGアイコンのサイズ */
#scroll-to-top-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ツールチップ */
#scroll-to-top-btn::after {
  content: 'ページ上部へ';
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
  white-space: nowrap;
  background: rgba(30, 30, 30, 0.88);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#scroll-to-top-btn:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* モバイル調整 */
@media (max-width: 600px) {
  #scroll-to-top-btn {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
  }

  /* モバイルではツールチップ非表示 */
  #scroll-to-top-btn::after {
    display: none;
  }
}
