/* グラフエリア：高さを確保し、左寄せにする */
.chart-container {
  width: 100%;
  max-width: 700px; /* メイン画面での適正サイズ */
  height: 400px; /* Canvasは親に高さがないと表示されません */
  margin: 20px 0; /* 上下20px、左右は0（左寄せ） */
  position: relative;
}

/* モーダル本体：ヘッダー(99999)より前面に出す */
.modal {
  display: none;
  position: fixed;
  z-index: 100000; /* ★ヘッダーより大きい値を設定 */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 1);
}

/* ポップアップコンテンツ本体 */
.modal-content {
  /* background-color: #fff; */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 95vw;
  height: 90vh; /* 画面高さの9割 */

  /* グラフを最大化するため、内側の余白を最小限に */
  padding: 20px;
  border-radius: 12px;
  box-sizing: border-box;

  /* 縦並びのレイアウトを強制 */
  display: flex;
  flex-direction: column;
}

/* グラフを囲むラッパー：ここが重要！ */
.modal-chart-wrapper {
  flex: 1; /* 残りの高さをすべて使う */
  width: 100%;
  min-height: 0; /* flexbox内での縮小バグ防止 */
  overflow-x: auto;
  overflow-y: hidden;
  display: block;
}

/* 閉じるボタンがグラフに重なるのを防ぐために、右上に浮かせる */
.close-btn {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 36px;
  z-index: 100005;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  user-select: none;
}

.close-btn:hover {
  background: rgba(200, 30, 30, 0.85);
  color: #fff;
}

.chart-guide {
  font-size: 0.8rem;
  color: #666;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* 棒グラフ用のコンテナ（少し横長に） */
.chart-container--bar {
  max-width: 1000px;
  height: 450px;
}

/* 全幅グラフ用（最大幅制限なし・縦長） */
.chart-container--full {
  max-width: 100%;
  height: 520px;
}
/* プログラム全体のコンテナ */
.program-schedule {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  font-family: "Noto Sans JP", sans-serif;
  color: #333;
  line-height: 1.6;
}

/* 左右のカラム */
.program-column {
  flex: 1;
  min-width: 300px;
}

/* 各日程のアイテム */
.program-item {
  display: flex;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 15px;
  padding-bottom: 10px;
  align-items: stretch;
}

/* 左側の「〇日目」部分 */
.program-day-box {
  width: 70px;
  background-color: #f0f6fb; /* 基本色 */
  display: flex;
  flex-direction: column;
  justify_content: center;
  align-items: center;
  padding: 10px 5px;
  margin-right: 15px;
  flex-shrink: 0;
}

.program-day-num {
  font-size: 1.5rem;
  font-weight: bold;
  color: #003f8e;
}

.program-day-text {
  font-size: 0.875rem;
  font-weight: bold;
  color: #003f8e;
}

.program-status {
  font-size: 0.75rem;
  margin-top: 5px;
}

/* 特定の日程の色変更 */
.day-online {
  background-color: #d8f3e0;
}
.day-online .program-day-num,
.day-online .program-day-text,
.day-online .program-status {
  color: #007d3c;
}

.day-10 {
  background-color: #dce7f2;
}

/* 右側の内容部分 */
.program-content {
  flex: 1;
}

.program-title {
  font-size: 1.125rem;
  font-weight: bold;
  color: #007d3c;
  margin-bottom: 8px;
  display: block;
}

.program-blue-title {
  color: #003f8e;
  text-decoration: none;
}

/* タグ（講義・学習など） */
.prog-tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 3px;
  margin-right: 8px;
  vertical-align: middle;
  color: #fff;
  font-weight: normal;
}

.tag-blue {
  background-color: #5ca0d3;
}
.tag-navy {
  background-color: #003f8e;
}

.target-person {
  font-weight: bold;
  color: #003f8e;
  margin-left: 5px;
}

.prog-desc {
  font-size: 0.875rem;
  margin: 5px 0;
}

/* 自己研鑽日（特殊枠） */
.self-study-row {
  background-color: #eee;
  text-align: center;
  font-weight: bold;
  padding: 10px;
  margin: 10px 0;
}

/* レスポンシブ：スマホ表示 */
@media (max-width: 768px) {
  .program-schedule {
    flex-direction: column;
  }
  .program-column {
    min-width: 0;
    width: 100%;
  }
}

/* 2カラムレイアウトのコンテナ */
.program-details-row {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 40px;
  font-family: "Noto Sans JP", sans-serif;
}

/* 各ボックスのスタイル */
.program-detail-box {
  flex: 1;
  min-width: 300px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 見出し部分 */
.program-detail-box h4 {
  background-color: #f0f6fb;
  color: #003f8e;
  margin: 0;
  padding: 15px 20px;
  font-size: 1.125rem;
  border-bottom: 2px solid #003f8e;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* アイコン（擬似要素で表現） */
.program-detail-box h4::before {
  content: "\f51b"; /* FontAwesomeの講義アイコン例 */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

.pic1::before {
  content: "\f51b";
} /* 講義 */
.pic2::before {
  content: "\f1ad";
} /* 訪問 */

/* テキストエリア */
.program-detail-box .txt-content {
  padding: 20px;
  font-size: 0.95rem;
  line-height: 1.8;
  color: #333;
  flex-grow: 1;
}

/* 画像エリア */
.program-detail-box .img-wrapper {
  width: 100%;
  margin-top: auto;
}

.program-detail-box .img-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* スマホ対応 */
@media (max-width: 768px) {
  .program-details-row {
    flex-direction: column;
  }
  .program-detail-box {
    min-width: 0;
    width: 100%;
  }
  .program-detail-box.half {
    flex: 1 1 100%;
  }
}

/* アイコン設定の追加 */
.pic3::before {
  content: "\f11e";
} /* 広島・長崎（旗・平和） */
.pic4::before {
  content: "\f3c5";
} /* 地方（マップピン） */
.pic5::before {
  content: "\f0ac";
} /* 国際・報告（地球） */

/* グラフ種別切り替えトグル */
.chart-type-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  align-items: center;
}
.chart-type-btn {
  padding: 4px 13px;
  font-size: 0.78rem;
  border: 1.5px solid #bbb;
  background: #fff;
  border-radius: 20px;
  cursor: pointer;
  transition: all .15s;
  font-family: 'Noto Sans JP', sans-serif;
  display: flex;
  align-items: center;
  gap: 4px;
}
.chart-type-btn.active {
  background: #444;
  border-color: #444;
  color: #fff;
  font-weight: 700;
}
.chart-type-btn:hover:not(.active) {
  border-color: #555;
  color: #333;
}

/* 横スクロールヒント（デスクトップでは非表示） */
.modal-scroll-hint {
  display: none;
}

/* --- モバイル：グラフ高さ縮小 + スクロールヒント表示 --- */
@media (max-width: 768px) {
  .chart-container       { height: 280px; }
  .chart-container--bar  { height: 260px; }
  .chart-container--full { height: 320px; }

  .modal-scroll-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #888;
    padding: 4px 0 8px;
    flex-shrink: 0;
  }

  .modal-scroll-hint i {
    animation: hint-slide 1.2s ease-in-out infinite alternate;
    font-size: 0.7rem;
  }

  .modal-scroll-hint i:first-child {
    animation-direction: alternate-reverse;
  }

  @keyframes hint-slide {
    from { transform: translateX(-3px); opacity: 0.5; }
    to   { transform: translateX(3px);  opacity: 1; }
  }
}
