/* 横スクロールの無効化 */
html,
body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
	background-color: #f7f7f7;
}

/* 背景色とフォント設定 */
.profit-calculation {
  background-color: #f7f7f7;
  font-family: 'Noto Sans JP', sans-serif;
}

/* ビューポート幅を超えないように設定 */
.profit-calculation-page {
  position: relative;
  max-width: 800px;
  margin: 40px auto 0;
  padding: 30px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  overflow-x: hidden;
}

/* アイテムコンテナの設定 */
.container,
.profit-calculation-page .item-container {
  max-width: 700px;
  box-sizing: border-box;
  padding: 0 16px;
  margin: 40px auto;
}

/* 入力フィールドのスタイル */
.profit-calculation-page input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
  box-sizing: border-box;
}
.profit-calculation-page input[type='number']::-webkit-inner-spin-button,
.profit-calculation-page input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.profit-calculation-page input,
.profit-calculation-page select,
.profit-calculation-page .custom-select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  margin-top: 5px;
  box-sizing: border-box;
}

/* 見出しのスタイル */
.profit-calculation-page h1 {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
}

/* 必須アイコンのスタイル */
.profit-calculation-page .required-icon {
  vertical-align: middle;
  width: 24px;
  height: 24px;
}

/* フォームグループのスタイル */
.profit-calculation-page .form-group {
  margin-bottom: 20px;
}

/* ラベルとオプショナルタグのスタイル */
.profit-calculation-page label {
  display: flex;
  align-items: center;
  font-weight: bold;
  margin-bottom: 5px;
}
.profit-calculation-page .optional-tag {
  display: inline-block;
  background-color: #e0e0e0;
  color: #666;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  margin-left: 8px;
  line-height: 1.4;
}

/* ツールチップのスタイル */
.profit-calculation-page .tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
  background-color: #888;
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  text-align: center;
  line-height: 18px;
  font-size: 12px;
  margin-left: 8px;
}
.profit-calculation-page .tooltip .tooltiptext {
  visibility: hidden;
  width: 140px;
  background-color: #555;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  white-space: normal;
}
.profit-calculation-page .tooltip .tooltiptext::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #555 transparent transparent transparent;
}
.profit-calculation-page .tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* ヒントテキストのスタイル */
.profit-calculation-page .hint {
  color: #555;
  font-size: 12px;
  margin-top: 5px;
}

/* ネガティブ数値のスタイル */
.profit-calculation-page .result-container .negative {
  color: red !important;
}

/* 計算ボタンのスタイル */
.profit-calculation-page .calculate-button {
  width: 100%;
  padding: 15px;
  background-color: #303536;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  margin-top: 20px;
  text-align: center;
  box-sizing: border-box;
}
.profit-calculation-page button:hover {
  opacity: 0.8;
}

/* 結果表示のスタイル */
.profit-calculation-page .result {
  margin-top: 30px;
  padding: 20px;
  background-color: #f7f7f7;
  border-radius: 4px;
}
.profit-calculation-page .result .negative {
  color: red;
}
.profit-calculation-page .result .positive {
  color: green;
}
.profit-calculation-page .result .currency,
.profit-calculation-page .result .percentage {
  font-weight: bold;
}

/* 結果コンテナのスタイル */
.profit-calculation-page .result-container {
  position: relative;
  margin-top: 20px;
  padding-bottom: 20px;
}
.profit-calculation-page #result {
  background-color: #f7f7f7;
  border-radius: 4px;
  padding: 20px;
  display: none;
}

/* コピー通知のスタイル */
.profit-calculation-page #copy-notification {
  position: absolute;
  bottom: 50px;
  right: 10px;
  background-color: #6c6c6c;
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.3s,
    transform 0.3s;
  font-size: 0.9em;
  visibility: hidden;
}
.profit-calculation-page #copy-notification.show {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

/* 著作権表示のスタイル */
.profit-calculation-page .copyright {
  text-align: center;
  font-size: 0.8em;
  color: #666;
  margin-bottom: 20px;
}

/* ボタンコンテナのスタイル */
.profit-calculation-page .button-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.profit-calculation-page #copy-option {
  font-size: 0.9em;
  padding: 5px;
  height: 30px;
  border-radius: 5px;
  border: 1px solid #ccc;
}
.profit-calculation-page .copy-button,
.profit-calculation-page #reset-button {
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 1.2em;
  height: 40px;
  margin-top: 12px;
  border: none;
  white-space: nowrap;
  min-width: 80px;
}
.profit-calculation-page .copy-button {
  background-color: #3a5ab1;
  color: #fff;
  text-align: center;
  justify-content: center;
  min-width: 50px;
}
.profit-calculation-page #reset-button {
  background-color: #b23e5d;
  color: #fff;
}
.profit-calculation-page .copy-button:hover,
.profit-calculation-page #reset-button:hover {
  opacity: 0.8;
}

/* カスタムセレクトのスタイル */
.profit-calculation-page .custom-select {
  position: relative;
  display: inline-block;
  width: 100%;
}
.profit-calculation-page .custom-select select {
  display: none;
}
.profit-calculation-page .select-selected {
  background-color: #fff;
}
.profit-calculation-page .select-selected:after {
  position: absolute;
  content: '';
  top: 14px;
  right: 10px;
  border: 6px solid transparent;
  border-color: #000 transparent transparent transparent;
}
.profit-calculation-page .select-selected.select-arrow-active:after {
  border-color: transparent transparent #000 transparent;
  top: 7px;
}
.profit-calculation-page .select-items div,
.profit-calculation-page .select-selected {
  color: #000;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  user-select: none;
}
.profit-calculation-page .select-items {
  position: absolute;
  background-color: #fff;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 99;
}
.profit-calculation-page .select-hide {
  display: none;
}
.profit-calculation-page .select-items div:hover,
.profit-calculation-page .same-as-selected {
  background-color: rgba(0, 0, 0, 0.1);
}

/* ヘッダーコンテナのスタイル */
.header-container {
  position: relative;
}
/* サウンドトグルアイコンのスタイル */
.profit-calculation-page .sound-toggle {
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SVGアイコンの基本スタイル */
.profit-calculation-page .sound-toggle svg {
  width: 32px;
  height: 32px;
  fill: #333;
  display: none; /* 初期状態では非表示 */
}

/* サウンドオン状態のアイコンを表示 */
.profit-calculation-page .sound-toggle.sound-on svg#sound-on {
  display: block;
}

/* サウンドオフ状態のアイコンを表示 */
.profit-calculation-page .sound-toggle.sound-off svg#sound-off {
  display: block;
}

/* GIFオーバーレイのスタイル */
.gif-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  pointer-events: none;
  overflow: hidden;
}
.gif-overlay img {
  max-width: 100%;
  max-height: 100%;
  position: absolute;
}
.confetti {
  width: 900px;
}
.confetti-right {
  right: 0;
  transform: scaleX(-1);
}

/* カラースタイル */
.profit-yellow {
  color: #ffd700 !important; /* 黄色 */
}
.profit-green {
  color: #008000 !important; /* 緑色 */
}
.profit-blue {
  color: #0000ff !important; /* 青色 */
}

/* ラベルコンテナのスタイル */
.profit-calculation-page .label-container {
  display: flex;
  align-items: center;
}
.profit-calculation-page .label-group {
  display: inline-block;
}
.profit-calculation-page .label-text,
.profit-calculation-page .label-subtext {
  display: inline-block;
  font-family: inherit;
  color: inherit;
  font-weight: bold;
}

/* スマートフォン向けのスタイル */
@media (max-width: 767px) {
  .container {
    margin: 0;
    padding: 20px 8px;
  }
  .profit-calculation-page .label-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 4px;
  }
  .profit-calculation-page .label-text,
  .profit-calculation-page .label-subtext {
    display: block;
  }
  .profit-calculation-page .label-subtext {
    font-size: 0.9em;
    color: #666;
  }
  .profit-calculation-page .tooltip {
    align-self: flex-start;
    margin-top: 4px;
  }
  .confetti {
    width: 400px;
    height: 400px;
  }
  .profit-calculation-page .button-container {
    flex-wrap: wrap;
  }
  .profit-calculation-page #copy-option {
    width: 100%;
    margin-bottom: 10px;
  }
}

/* シェアコンテナのスタイル */
.share-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background-color: #f8f9fa;
  border-radius: 8px;
  width: 100%;
  max-width: 800px;
  margin: 40px auto;
  box-sizing: border-box;
}
.share-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: #fff;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  cursor: pointer;
  color: #495057;
  font-size: 13px;
  flex: 1;
  min-width: 70px;
  white-space: nowrap;
  transition: all 0.2s;
}
.share-button:hover {
  background-color: #e9ecef;
  transform: translateY(-1px);
}
.share-icon,
.share-button img {
  width: 20px;
  height: 20px;
}

.share-icon {
  fill: #495057; /* 通常時のカラー */
  transition: fill 0.3s ease; /* 色変更をスムーズに */
}

.share-button.copy:hover .share-icon {
  fill: #fff; /* ホバー時のカラー（玄哉の色に変更） */
}

/* 各SNSボタンのスタイル */
.twitter {
  border-color: #1da1f2;
  /* color: #1da1f2; */
}
.facebook {
  border-color: #4267b2;
  /* color: #4267b2; */
}
.line {
  border-color: #06c755;
  /* color: #06c755; */
}
.copy {
  border-color: #495057;
  /* color: #495057; */
}
/* ホバー時のスタイル */
.twitter:hover {
  background-color: #1da1f2;
  color: #fff;
}
.facebook:hover {
  background-color: #4267b2;
  color: #fff;
}
.line:hover {
  background-color: #06c755;
  color: #fff;
}

.copy:hover {
  background-color: #495057;
  color: #fff;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .share-container {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    margin: 20px auto;
  }
  .share-button {
    min-width: calc(50% - 8px);
    padding: 6px 12px;
    font-size: 12px;
  }
}

.line-button-container {
  width: 100%;
  text-align: center;
  margin-top: 20px;
  font-family: 'Arial', sans-serif;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 800px; /* お好みの最大幅を設定 */
  margin: 40px auto; /* 中央寄せ */
  overflow: hidden;
}

.video-container::before {
  content: '';
  display: block;
  padding-top: 56.25%; /* 16:9 のアスペクト比 */
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.line-guide {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.guide-text {
  padding: 8px 15px;

  border-radius: 20px;
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

.arrow-container {
  margin-top: 10px;
}

.arrow {
  width: 30px;
  height: 30px;
  fill: #00b900;
}

.line-share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  color: #00b900;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
}

.line-share-button:hover {
  background-color: #05b54c;
  color: white;
}

.line-icon {
  width: 24px;
  height: 24px;
  margin-right: 8px;
  vertical-align: middle;
}

.line-share-button span {
  line-height: 1;
  vertical-align: middle;
}

.share-button .share-icon {
  width: 24px;
  height: 24px;
  margin-right: 8px;
}

/* ヘッダーコンテナの更新 */
.header-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
}

.page-title {
  font-size: 24px;
  font-weight: bold;
  color: #333;
  margin-bottom: 20px;
  margin-top: 40px;
}

/* ボタンコントロールコンテナ */
.button-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* モード切り替えボタン */
.mode-toggle-button {
  background: #f8f9fa;
  color: #495057;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mode-toggle-button:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  color: #212529;
}

.mode-toggle-button:active {
  background: #dee2e6;
  border-color: #6c757d;
}

/* DDP専用フィールドの表示/非表示制御 */
.ddp-only {
  display: none;
}

.ddp-mode .ddp-only {
  display: block;
}

.ddu-mode .ddp-only {
  display: none;
}

/* DDP結果表示の制御 */
.ddp-results {
  display: none;
}

.ddp-mode .ddp-results {
  display: block;
}

.ddu-mode .ddp-results {
  display: none;
}
