/* フラッシュ効果用のCSS */
#flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease-out; /* フラッシュ効果の時間を500msに設定 */
  z-index: 10001; /* 最前面に表示するために最大の値に設定 */
}

#flash.flash-active {
  opacity: 1;
  transition: opacity 0.5s ease-in;
}

/* カメラ選択エリアを画面外に隠すスタイル */
#cameraSelect {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 100; /* フラッシュ効果の下、他の要素の上に表示 */
  background-color: rgba(255, 255, 255, 0.8);
  padding: 10px;
  border-radius: 5px;
  display: none; /* 初期状態で非表示 */
}

/* カメラ選択エリアを表示するスタイル */
#cameraSelect.visible {
  display: block;
}

/* プレビュー画面を画面いっぱいに表示するスタイル */
#video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 1;
}

/* トグルボタンとキャプチャボタンのデフォルトスタイル（非表示） */
#toggleButton,
#captureButton {
  display: none; /* デフォルトでは非表示 */
}

/* 画面幅が1024px以下の場合にボタンを表示 */
@media (max-width: 1024px) {
  #toggleButton {
      display: block !important; /* トグルボタンを表示 */
  }
  #captureButton {
      display: flex !important; /* キャプチャボタンを表示 */
  }
}

/* トグルボタンのスタイル */
#toggleButton {
  position: absolute;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  top: 10px;
  right: 10px;
}

/* キャプチャボタンのスタイル */
#captureButton {
  position: fixed;
  z-index: 100;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px; /* ボタンの大きさを調整 */
  height: 70px; /* ボタンの大きさを調整 */
  background-color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* カメラアイコンのスタイル */
#captureButton img {
  width: 40px; /* アイコンの大きさを調整 */
  height: 40px; /* アイコンの大きさを調整 */
  pointer-events: none; /* 画像がクリックイベントを受け取らないようにする */
}

/* QRコードのモーダルスタイル */
#qrcodeModal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%; /* 画面幅が狭い場合は80%の大きさに設定 */
  max-width: 400px; /* 最大幅を設定 */
  height: auto;
  background-color: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 10002; /* フラッシュ効果のさらに上に表示 */
  display: none; /* 初期状態は非表示 */
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* QRコードモーダルの内部要素のスタイル */
#qrcodeCanvas {
  width: 100%; /* 親要素に合わせる */
  height: auto; /* 高さを自動調整して正方形を維持 */
  max-width: 300px; /* QRコードの最大幅を設定 */
  max-height: 300px; /* QRコードの最大高さを設定 */
}

/* モーダル内の閉じるボタンのスタイル */
#closeModalButton {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

/* メディアクエリで画面幅に応じてモーダルのサイズを調整 */
@media (max-width: 600px) {
  #qrcodeModal {
      width: 90%; /* 画面幅が狭い場合は90%に設定 */
  }
}


/* QRコードの説明文のスタイル */
#qrcodeText {
  margin-bottom: 10px;
  font-size: 16px;
  text-align: center;
}

