body{
    padding: 0;
    margin: 0;
    min-height: 100vh;
    font-family:'Roboto', sans-serif;
    background-color:#121212;
    background: linear-gradient(135deg, #0c367a, #121212); /* ダークグラデーション */
    color: #ffffff;
}

h1 {
    margin-top:20px;
    margin-left:40px;
    border-bottom: 2px solid rgb(218, 224, 231);
}

h2 {
    margin-left: 40px;
    margin-top: 10px;
    font-size: 1.6em;
    color: #d7d7d7;
}

h3 {
    margin-left: 60px;
    margin-top: 20px;
    font-size: 1.2em;
    color: #b5b5b5;
}

.links {
    position: absolute;
    top: 20px;
    right: 50px;
    text-align: right; /* 右側に配置 */
}

.video-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 20px;
    font-weight: bold;
}

.layout-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.arrow-button {
  font-size: 2em;                /* 矢印アイコンを大きく */
  width: 2em;                    /* 横幅を広げてクリック領域を確保 */
  height: 3em;                   /* 高さを広げてクリック領域を確保 */
  color: #ffffff;                /* 矢印の色を白に */
  background-color: rgba(0, 0, 0, 0.3);  /* 半透明の背景を追加（任意） */
  border: none;
  /* border-radius: 50%;            /* 丸ボタンに */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.arrow-button:hover {
  background-color: rgba(255, 255, 255, 0.1);  /* ホバー時に薄い白を重ねる */
}

.arrow-button:active {
  background-color: rgba(255, 255, 255, 0.2);  /* クリック時に少し濃い白を重ねる */
}

.view-container {
  display: flex;
  overflow: hidden;
  width: 1288px;              /* 640px×1列 ＝ カメラ1枚分 */
  height: 430px;
  transition: transform 0.4s ease-in-out;
}

.view {
  flex: 0 0 960px;           /* 1ビュー幅を固定 */
  height: 100%;
}

.camera-grid {
  display: grid;
  grid-template-columns: 640px 640px;
  gap: 8px;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.camera-grid img {
  width: 640px;
  height: 360px;
  object-fit: cover;         /* 重要：縦横比を保って埋める */
  display: block;            /* img の余白を消す */
}

#autoToggleBtn{
  margin-top: 20px;
  margin-right: 40px;
  text-align: right; /* 右側に配置 */
}

#autoToggleBtn.active {
  background-color: #28a745; /* トグルON時は緑系に */
  color: #fff;
}

#popupImg {
    width: 1280px;
    height: 720px;
    object-fit: cover; /* 画像が枠内にフィットする */
}

#popup {
    display: none;
    justify-content: center;
    align-items: center;
    width: 100vw; /* ポップアップを画面全体に広げる */
    height: 100vh; /* ポップアップを画面全体に広げる */
    background-color: rgba(0, 0, 0, 0.8); /* 背景を半透明にする */
    position: fixed; /* 固定位置 */
    top: 0;
    left: 0;
}

.space-left {
    margin-left: 100px;
}

form {
    margin: 20px auto;
    width: 80%;
    text-align: center;
}

.time-button-group {
    display: grid;
    grid-template-columns: repeat(6, auto);
    justify-content: center;
    gap: 8px; /* ボタン間の隙間 */
    margin-top: 18px;
}

.time-button-group button {
    padding: 6px 12px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    cursor: pointer;
    margin: 4px;
}

.time-button-group button.selected {
    background-color: #007bff;
    color: white;
    border: 1px solid #007bff;
}

.time-button-group button:hover {
    background-color: #e0e0e0;
}

.thumbnail-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: 1280px;
  margin: 20px auto;
}

.thumbnail-box {
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2em;
}

.thumbnail-box form {
  display: inline-block;      /* `inline` よりもスタイル制御しやすい */
  margin: 0;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
}

.thumbnail-box p {
  margin: 0.2em 0; /* または margin: 0; で完全除去 */
}

.thumbnail-box .action-buttons {
  display: flex;
  gap: 0.2em;
  justify-content: center;
  align-items: center;
}

.thumbnail-box img {
  width: 100%;
  height: auto;
  border: 1px solid #ccc;
}

.thumbnail-box a,
.thumbnail-box form button {
  display: inline-block;
  white-space: nowrap;        /* 折り返し防止 */
  padding: 0.3em 0.3em;
  margin: 0.3em 0.2em;
  font-size: 0.85em;
  line-height: 1;
  vertical-align: middle;
  border: none;
  border-radius: 4px;
  background-color: #007bff;
  color: white;
  cursor: pointer;
  text-decoration: none;
  min-width: 64px;            /* 最小幅：「再生」などが1行に収まる */
  text-align: center;
  box-sizing: border-box;
  appearance: none;          /* ← ボタンのデフォルト外観をリセット */
  -webkit-appearance: none;
}

.thumbnail-box a:hover,
.thumbnail-box form button:hover {
  background-color: #0056b3;
}


#camera-selector {
  display: none; /* PCでは非表示 */
}

#selected-camera-container {
  display: none;
}

@media screen and (max-width: 768px) {
  .camera {
    margin-bottom: 1em;
    width: 100%;
  }

  h1 {
    font-size: 1.4em;
    margin: 1em 0 0.5em 0; /* 下に余白を追加 */
    text-align: center;
    line-height: 1.4;
  }

  img {
    width:100%;
    height:auto;
    object-fit:cover;
  }

  .links{
    position: static;
    margin-top: 0.5em;
    margin-bottom: 1em;
    text-align: right;
  }

  .video-link {
    font-size: 1em;
  }

  .layout-controls{
    display: none;
  }

  .container {
    display: none;
  }

  #selected-camera-container {
    display: block;
  }

  #camera-selector {
    display: block;
  }

  #selected-camera-img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  .time-button-group {
    grid-template-columns: repeat(3, auto); /* 3列に変更 */
    gap: 6px;
  }

    /* 共通ボタンスタイル */
  .time-button-group button {
    padding: 0.5em 1em;
    font-size: 1em;
    color: #333; /* 通常文字色をダークグレーに */
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
  }

  /* 選択時のスタイル */
  .time-button-group button.selected {
    background-color: #007bff; /* 選択時の背景色（例: ブルー） */
    color: white;               /* 選択されたボタンの文字を白に */
    border-color: #007bff;
  }

  .thumbnail-grid {
    width: 360px;
  }

  .thumbnail-box {
    width: 170px;
  }

  .time-auto-switch{
    display: none;
  }


}


