/**
 * トップに戻るボタン用スタイル
 * 他のページでも使用できる独立したスタイルシート
 */

.page-top-link {
  position: fixed;
  top: 400px;
  /* 表の横、上部に近い位置 */
  right: 150px;
  /* 表の右横に配置 */
  width: 50px;
  height: 50px;
  background-color: #4A90E2;
  /* 水色 */
  color: white;
  border-radius: 50%;
  /* 円形にする */
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  z-index: 9998;
  /* 翻訳ボタンより少し下に */
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s ease-in-out;
  transform: translateY(20px);
}

/* 画面幅が狭い場合の調整 */
@media (max-width: 1280px) {
  .page-top-link {
    right: 20px;
    /* 通常の右寄せに */
    top: auto;
    bottom: 100px;
    /* 翻訳ボタンの上に */
  }
}

.page-top-link.show {
  opacity: 0.9;
  /* よりはっきり見えるように */
  visibility: visible;
  transform: translateY(0);
}

.page-top-link i {
  font-size: 20px;
}

.page-top-link:hover {
  background-color: #357ABD;
  /* 少し暗めの水色 */
  opacity: 1;
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* 異なるテーマ向けのカスタマイズオプション */
.page-top-link.blue-theme {
  background-color: #4A90E2;
  /* 青系テーマ */
}

.page-top-link.blue-theme:hover {
  background-color: #357ABD;
  /* 青系テーマのホバー色 */
}

.page-top-link.green-theme {
  background-color: #107c10;
  /* 緑系テーマ */
}

.page-top-link.green-theme:hover {
  background-color: #0b5e0b;
  /* 緑系テーマのホバー色 */
}

/* モバイル向け調整 */
@media (max-width: 768px) {
  .page-top-link {
    width: 45px;
    height: 45px;
    top: auto;
    /* モバイルではtopを無効化 */
    bottom: 90px;
    /* モバイルでも翻訳ボタンの上に */
    right: 20px;
    /* モバイルでは右寄せ */
  }

  .page-top-link i {
    font-size: 18px;
  }
}

/* 新しいback-to-topボタンスタイル */
.back-to-top {
  position: fixed;
  right: 80px;
  /* 翻訳ボタンと重ならないよう調整 */
  bottom: 40px;
  width: 50px;
  height: 50px;
  background-color: #5DB8E8;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(93, 184, 232, 0.3);
  z-index: 9999;
  /* アニメーションより上に表示 */
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: #4CA8D8;
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(93, 184, 232, 0.4);
}

.back-to-top i {
  color: white;
}

/* モバイル対応 */
@media (max-width: 768px) {
  .back-to-top {
    right: 70px;
    bottom: 30px;
    width: 45px;
    height: 45px;
    font-size: 20px;
  }
}

/* 大画面でコンテンツの右側に配置 */
@media (min-width: 1400px) {
  .back-to-top {
    right: calc((100vw - 1200px) / 2 - 60px);
  }
}

/* 既存の.page-top-linkを非表示 */
.page-top-link {
  display: none;
}