/* ==========================================================================
   DB Page Styles (White Theme - Clean & Professional)
   ========================================================================== */

/* 全体の枠組み */
.db-white-section {
  background: #fff;
  border: 1px solid #e0e6ed;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
}

/* --- 1. Map Area --- */
.db-map-wrapper {
  width: 100%;
  background: #f0f6fb; /* 爽やかな薄いブルー（海） */
  position: relative;
  border-bottom: 1px solid #e0e6ed;
  min-height: 400px;
}

.google-active-map {
  width: 100%;
  height: 650px;
}

/* ローディング表示 */
.map-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--jilaf);
  font-weight: 700;
}

/* --- 2. Controls Area --- */
.db-controls {
  padding: 50px 40px;
}

/* キーワード検索 */
.db-search-area {
  margin-bottom: 50px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.control-label {
  display: block;
  font-weight: 700;
  color: var(--jilaf);
  margin-bottom: 10px;
  font-size: 1.1rem;
  text-align: center;
}

.db-search-form {
  display: flex;
  gap: 10px;
}

.db-input {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid #e0e6ed;
  border-radius: 4px;
  font-size: 1rem;
  background: #f9f9f9;
  transition: all 0.3s;
}

.db-input:focus {
  background: #fff;
  border-color: var(--jilaf);
  outline: none;
}

.db-submit-btn {
  background: var(--jilaf);
  color: #fff;
  border: none;
  padding: 0 30px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.3s;
  white-space: nowrap;
}

.db-submit-btn:hover {
  opacity: 0.8;
}

/* 区切り線 */
.db-divider {
  display: flex;
  align-items: center;
  margin: 40px 0 30px;
  color: #999;
  font-size: 0.9rem;
  font-weight: 700;
}

.db-divider::before,
.db-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e0e6ed;
}

.db-divider span {
  padding: 0 20px;
  color: var(--jilaf); /* 区切り文字もブルーにして統一感 */
}

/* グリッドレイアウト */
.region-grid {
  display: grid;
  gap: 20px;
}

.region-grid.col-2 {
  grid-template-columns: repeat(2, 1fr);
}

.region-grid.col-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* --- ボタンデザイン（組織） --- */
.region-btn {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e0e6ed;
  padding: 20px;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.region-btn:hover {
  border-color: var(--jilaf);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(22, 88, 160, 0.15);
  color: var(--jilaf);
}

.region-btn .btn-icon {
  font-size: 1.5rem;
  color: #ccc;
  margin-right: 15px;
  width: 30px;
  text-align: center;
  transition: color 0.3s;
}

.region-btn:hover .btn-icon {
  color: var(--jilaf);
}

.region-btn .text {
  flex: 1;
  font-size: 0.95rem;
}

.region-btn .arrow {
  font-size: 0.9rem;
  color: #ccc;
}

/* --- ボタンデザイン（地域・縦型） --- */
.region-btn.vertical {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 30px 15px;
}

.region-btn.vertical .text {
  margin-bottom: 0;
  z-index: 2;
}

/* 背景に薄くアイコンを置く演出 */
.region-btn.vertical .icon-bg {
  position: absolute;
  bottom: -10px;
  right: -10px;
  font-size: 4rem;
  color: #f4f8fb;
  z-index: 1;
  transition: transform 0.3s;
}

.region-btn.vertical:hover .icon-bg {
  transform: scale(1.1);
  color: #eaf4fd;
}

/* --- スマホ対応 --- */
@media screen and (max-width: 768px) {
  .google-active-map {
    height: 300px;
  }

  .db-controls {
    padding: 25px 15px;
  }

  /* 検索エリア */
  .db-search-area {
    margin-bottom: 25px;
  }

  .control-label {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }

  .db-input {
    font-size: 0.9rem;
    padding: 10px 12px;
  }

  .db-divider {
    margin: 18px 0 14px;
    font-size: 0.82rem;
  }

  .region-grid.col-2,
  .region-grid.col-4 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .db-search-form {
    flex-direction: column;
  }

  .db-submit-btn {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    font-size: 0.9rem;
  }

  /* 通常ボタン */
  .region-btn {
    padding: 12px 14px;
  }

  .region-btn .text {
    font-size: 0.82rem;
  }

  .region-btn .btn-icon {
    font-size: 1.2rem;
    margin-right: 10px;
    width: 24px;
  }

  /* 縦型ボタン（地域選択） */
  .region-btn.vertical {
    flex-direction: row;
    justify-content: space-between;
    padding: 12px 14px;
    text-align: left;
  }

  .region-btn.vertical .icon-bg {
    display: none;
  }

  .region-btn.vertical::after {
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: #ccc;
  }

  /* 国タグ */
  .country-tag {
    font-size: 0.82rem;
    padding: 5px 12px;
  }

  /* エリア統計 */
  .area-stat-item {
    font-size: 0.95rem;
  }

  .area-stat-item .stat-number {
    font-size: 1.6rem;
  }

  /* リンクページ見出し */
  .link-head-main {
    font-size: 1.3rem;
  }

  .link-head-sub {
    font-size: 1rem;
    padding: 8px 12px;
  }
}

@media screen and (max-width: 768px) {
  .db-map-wrapper {
    /* スマホで横スクロールさせるための設定 */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .google-active-map {
    /* スマホでも高さを出し、さらに横幅を強制的に広げることで拡大表示 */
    height: 450px;
    min-width: 800px; /* ★重要：画面からはみ出させて、大きく表示する */
  }

  /* スクロールを促すヒントを表示するなら */
  .db-map-wrapper::after {
    content: "← 地図をスクロールできます →";
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: #999;
    margin-top: 5px;
    padding-bottom: 10px;
  }
}

/* ==========================================================================
   Google Map Hover Color Override
   ========================================================================== */

/* 地図上の国にマウスが乗った時の色設定 */
#regions_div path:not([fill="none"]):hover {
  /* ここにお好みのホバー色を指定してください */
  fill: var(--jilaf) !important; /* 例：鮮やかなオレンジ */

  /* 枠線を少し太くして強調する場合 */
  stroke: var(--jilaf2) !important;
  stroke-width: 2px !important;

  /* 滑らかに変化させる */
  transition: fill 0.2s ease;
  cursor: pointer;
}

/* ==========================================================================
   Map Zoom Controls & Pan
   ========================================================================== */

/* 地図の親要素（はみ出し防止） */
.db-map-wrapper {
  position: relative;
  overflow: hidden; /* ★重要：拡大した時にはみ出さないようにする */
  cursor: grab; /* 手のひらカーソル */
}

.db-map-wrapper:active {
  cursor: grabbing; /* 掴んでいる時のカーソル */
}

/* 地図本体（アニメーション用） */
.google-active-map {
  transform-origin: center center; /* 中央から拡大 */
  transition: transform 0.2s ease-out; /* スムーズに動く */
}

/* ズームボタンエリア */
.map-zoom-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 10;
}

/* ボタンのデザイン */
.zoom-btn {
  width: 40px;
  height: 40px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #333;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.zoom-btn:hover {
  background: var(--jilaf); /* ホバー時はJILAFブルー */
  color: #fff;
  border-color: var(--jilaf);
}

/* スマホ用のヒント */
.sp-map-hint {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 5;
}

/* ==========================================================================
   Custom Tooltip (Zoom Compatible)
   ========================================================================== */

/* ==========================================================================
   Customize Google Default Tooltip
   ========================================================================== */

/* ツールチップの箱自体のデザイン */
div.google-visualization-tooltip {
  /* 以前の「消す」コードは削除または上書き */
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;

  /* ▼ デザインカスタマイズ ▼ */
  background-color: #fff !important; /* 真っ白な背景 */
  border: none !important; /* ダサい枠線を消す */
  border-radius: 6px !important; /* 角丸にする */
  padding: 12px 16px !important; /* 余白を広げて見やすく */

  /* 影をつけて浮かせる（モダンな感じに） */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;

  /* アニメーション（ふわっと出る） */
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;

  /* マウスの邪魔をしないように */
  pointer-events: none;

  /* 横幅の調整（お好みで） */
  min-width: 120px;
  text-align: center;
  z-index: 1000;

  /* ★重要：カーソルに近づけすぎるとチラつくので、これを必ず入れる */
  pointer-events: none !important;
}

/* ツールチップ内の文字（国名）のデザイン */
div.google-visualization-tooltip ul {
  margin: 0 !important;
  padding: 0 !important;
}

div.google-visualization-tooltip li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

div.google-visualization-tooltip li::before {
  content: none !important; /* アイコンの中身を空にする */
  display: none !important; /* 要素自体を非表示にする */
}

/* 国名の文字設定 */
div.google-visualization-tooltip span {
  font-family: "Montserrat", "Noto Sans JP", sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important; /* 太字で強調 */
  color: #1658a0 !important; /* JILAFブルーにする */
}

/* db.css の最後に追加 */

/* ツールチップ内の2行目（数値が表示される行）を消す */
div.google-visualization-tooltip ul li:nth-child(2) {
  display: none !important;
}

/* ついでに1行目（国名）の余計なマージンを調整して中央っぽくする */
div.google-visualization-tooltip ul li:nth-child(1) {
  margin-bottom: 0 !important;
  text-align: center;
}

@charset "UTF-8";

/* ==========================================================================
   LINK Page (リンク集専用スタイル)
   ========================================================================== */

/* --- 大見出し（国内・国外） --- */
.link-head-main {
  font-size: 1.6rem;
  color: #333;
  border-bottom: 2px solid var(--jilaf); /* ブランドカラー */
  padding-bottom: 10px;
  margin-bottom: 30px;
}

/* --- カテゴリブロック --- */
.link-category {
  margin-bottom: 50px;
}

/* 中見出し（アイコン付き） */
.link-head-sub {
  font-size: 1.2rem;
  color: var(--jilaf);
  background: #f4f8fb;
  padding: 10px 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

.link-head-sub i {
  margin-right: 10px;
  opacity: 0.7;
}

/* --- リンク一覧グリッド --- */
.link-list-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* PCは3列 */
  gap: 15px 30px; /* 縦の隙間15px、横の隙間30px */
  list-style: none;
  padding: 0;
  margin: 0;
}

.link-list-grid li {
  /* 崩れ防止 */
  min-width: 0;
}
/* 既存のリストアイコンを打ち消す設定 */
.link-list-grid li::before {
  content: none !important; /* アイコンの中身を空にする */
  display: none !important; /* 要素自体を非表示にする */
}

.link-list-grid li {
  padding-left: 0 !important; /* アイコン用の左余白もリセット */
  background: none !important; /* もし背景画像でアイコンを出している場合用 */
}
/* リンクボタンのデザイン */
.link-list-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  color: #333;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  height: 100%; /* 高さを揃える */
}

/* ホバー時の挙動 */
.link-list-grid a:hover {
  background: #fff8e1; /* 薄い黄色（広報カラーの薄い版） */
  border-color: #ffd54f;
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

/* 外部リンクアイコン */
.link-list-grid a i {
  font-size: 0.75rem;
  color: #ccc;
  margin-left: 10px;
  transition: color 0.2s;
}

.link-list-grid a:hover i {
  color: var(--orange); /* ホバー時にオレンジに */
}

/* リンクなし（ただのテキスト）の場合 */
.no-link {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: #f9f9f9;
  border: 1px dashed #ddd;
  border-radius: 4px;
  color: #888;
  font-size: 0.9rem;
  height: 100%;
}

/* --- レスポンシブ対応 --- */

/* タブレット (1024px以下) */
@media screen and (max-width: 1024px) {
  .link-list-grid {
    grid-template-columns: repeat(2, 1fr); /* 2列 */
  }
}

/* スマホ (600px以下) */
@media screen and (max-width: 600px) {
  .link-list-grid {
    grid-template-columns: 1fr; /* 1列 */
    gap: 10px;
  }

  .link-list-grid a {
    padding: 15px; /* タップしやすいように少し広げる */
  }
}

/* ILOテーブルの基本スタイル調整 */
#ilo_list_body table {
  width: 100%;
  border-collapse: collapse;
}

#ilo_list_body td {
  padding: 8px 12px;
  border: 1px solid #eee;
  font-size: 0.95em;
}

/* 批准済み（完了）のスタイル */
.ilo-ratified {
  background-color: #fff5f5; /* ほんのり赤背景 */
  color: #d32f2f; /* JILAFアクセントカラーの赤 */
  font-weight: bold;
  position: relative;
}

/* 未批准のスタイル（あえて薄くして対比させる） */
.ilo-unratified {
  color: #ccc;
  background-color: #fafafa;
}
/* ============================================================
   エリア別データベース（area.js）用スタイル
============================================================ */

/* スタッツ（統計情報） */
.area-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  background: #f4f7f9;
  padding: 25px;
  border-radius: 12px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.area-stat-item {
  font-size: 1.1rem;
  font-weight: bold;
  color: #555;
}

.area-stat-item .stat-icon {
  color: #0056b3;
  margin-right: 8px;
}

.area-stat-item .stat-number {
  font-size: 2rem;
  color: #0056b3;
  margin: 0 5px;
}

@media (max-width: 768px) {
  .area-stats {
    flex-direction: column;
    gap: 15px;
    align-items: center;
    padding: 20px;
  }
}

/* 登録国一覧（タグ風スタイル） */
.country-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.country-tag {
  display: inline-block;
  padding: 6px 18px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 20px;
  color: #333;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s ease-in-out;
}

.country-tag:hover {
  background: #0056b3;
  color: #fff;
  border-color: #0056b3;
  text-decoration: none;
}
