body {
  font-family: Arial, sans-serif;
  text-align: center;
}

form {
  margin: 10px auto;
  padding: 10px;
  border: 0px solid #ccc;
  border-radius: 10px;
  width: 90%;
  max-width: 1200px;
}

input[type="file"] {
  display: none;
}

input[type="text"],
input[type="submit"],
label {
  display: block;
  margin-bottom: 10px;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.parent-element {
  text-align: center;
  /* 子要素を水平方向に中央揃え */
}

.gallery-item {
  display: flex;
  box-sizing: border-box;
  position: relative;
  cursor: pointer;
  position: relative;
  /* 相対位置指定 */
  width: 150px;
  /* 画像とチェックの余白を考慮して幅を調整 */
  height: auto;
  margin: auto;
  display: inline-block;
  /* 画像とチェックを横並びにするため */
}

.gallery-item img {
  width: 150px;
  height: auto;
  display: block;
  margin: auto;
  /* 上下左右に自動マージンを設定して中央揃え */
  border-radius: 5%;
}

.gallery-item.selected::after {
  content: "✔";
  position: absolute;
  top: 5px;
  /* 画像の上からの位置 */
  right: 10px;
  /* 画像の右からの位置 */
  font-size: 20px;
  width: 24px;
  height: 24px;
  /* サイズを指定 */
  color: rgb(101, 90, 255);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  padding: 3px;
  z-index: 1;
  /* 画像よりも上のレイヤーに配置 */
  text-align: center;
  /* ✔を中央に配置 */
  line-height: 25px;
  /* ✔を垂直方向に中央に配置 */
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.384);
  display: none;
  /* 初期状態では非表示 */
}

.gallery-item:hover .overlay {
  display: block;
  /* マウスオーバー時に表示 */
}

.user-item {
  margin-bottom: 15px;
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: center;
  justify-content: left;
  margin: 5px;
  padding: 5px;
  border: 0px;
  border-radius: 5px;
}

.user-item:hover {
  background-color: rgb(240, 240, 240);
}

/* 送信ボタンのガラス風デザイン */
.button1 {
  background: rgba(74, 144, 226, 0.8);
  border: 1px solid rgba(74, 144, 226, 0.9);
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
  font-size: 15px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.button1:hover {
  background: rgba(74, 144, 226, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.button1:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(74, 144, 226, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* カメラ/ギャラリー選択ボタンのコンテナ */
.image-source-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  width: 100%;
}

/* カメラ/ギャラリー選択ボタン */
.source-btn {
  flex: 0 0 auto;
  width: 130px;
  height: 55px;
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
}

.source-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.source-btn:hover::before {
  left: 100%;
}

.source-btn.active {
  background: rgba(74, 144, 226, 0.4);
  border-color: rgba(74, 144, 226, 0.6);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(74, 144, 226, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.source-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.source-btn.active:hover {
  background: rgba(74, 144, 226, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(74, 144, 226, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.source-btn img {
  width: 40px;
  height: 40px;
  transition: opacity 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

hr.style14 {
  border: 0;
  height: 1px;
  background-image: -webkit-linear-gradient(left, #f0f0f0, #8c8b8b, #f0f0f0);
  background-image: -moz-linear-gradient(left, #f0f0f0, #8c8b8b, #f0f0f0);
  background-image: -ms-linear-gradient(left, #f0f0f0, #8c8b8b, #f0f0f0);
  background-image: -o-linear-gradient(left, #f0f0f0, #8c8b8b, #f0f0f0);
}

.plus-icon {
  background-color: rgba(0, 123, 255, 0.3);
  opacity: 0; /* 非表示状態 */
  pointer-events: none; /* 非表示時は操作を無効にする */
  position: fixed;
  bottom: 50px;
  left: 50%;
  width: 50px;
  height: 50px;
  transform: translateX(-50%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, transform 0.3s ease, background-color 0.3s ease;
}

.plus-icon.visible {
  opacity: 1; /* 表示状態 */
  pointer-events: auto; /* 表示時は操作可能にする */
}

.plus-icon:hover {
  background-color: rgba(105, 105, 105, 0.5);
  transform: translateX(-50%) scale(1.1);
}

/* ポップアップのスタイル */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 9999;
  justify-content: center;
  align-items: center; /* 縦横中央に配置 */
  transition: opacity 0.3s ease; /* スムーズなフェードイン */
  opacity: 0; /* 初期状態で非表示 */
  overflow: hidden; /* 背景でのスクロール無効化 */
}

.popup-overlay.show {
  display: flex; /* 表示状態 */
  opacity: 1; /* 表示時に透明度を戻す */
}

.popup-content {
  width: 90%;
  background-color: white;
  padding: 20px;
  border-radius: 2%;
  position: relative;
  max-width: 800px;
  max-height: 90%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  overflow: auto;
}

.close-popup {
  color: #aaa;
  font-size: 24px;
  font-weight: bold;
  position: absolute;
  right: 10px;
  top: 5px;
  cursor: pointer;
}

#photoDisplay {
  max-width: 200px;
  max-height: 150px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: block;
  margin: 0 auto;
}

/* 画像選択エリアのガラス風デザイン */
#photoLabel {
  display: block;
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px dashed rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.9);
  width: 100%;
  margin-bottom: 10px;
}

#photoLabel:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(74, 144, 226, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#photoLabelText {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  margin-top: 10px;
  display: block;
}

/* エラーメッセージのスタイル */
.error_message {
  background: rgba(220, 53, 69, 0.2);
  border: 1px solid rgba(220, 53, 69, 0.4);
  color: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin: 5px 0;
}

/* 成功メッセージのスタイル */
.success_message {
  background: rgba(40, 167, 69, 0.2);
  border: 1px solid rgba(40, 167, 69, 0.4);
  color: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin: 5px 0;
}

/* レスポンシブ対応 */
@media (max-width: 800px) {
  .popup-content {
    width: 100%;
    max-width: none;
    border-radius: 20px 20px 0 0;
    margin: 0;
  }
}

@media (max-width: 480px) {
  .popup-content {
    padding: 15px;
  }

  .source-btn {
    padding: 10px 15px;
    font-size: 13px;
  }
}
