/* 格パターン検索ページのスタイル
   ページ構成・表の基本スタイルは ../thematic_role_search/thematic-role.css（tr-*）を共用し、
   ここでは格パターン一覧に固有の部分のみを定義する。 */

/* ローディング */
.loading {
  text-align: center;
  padding: 40px;
  font-size: 16px;
  color: #666;
}

.loading i {
  margin-right: 10px;
  font-size: 20px;
  color: #2d7a2d;
}

/* 見出し帯 */
.as-pattern-total {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: normal;
}

.as-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* 見出し帯内の「多い順」「少ない順」ボタン（ページトップボタンと同じ白枠スタイル）
   共通CSSの .content button（hover は !important）を上書きする */
.content .as-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: auto;
  margin: 0;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: normal;
  letter-spacing: normal;
  color: #ffffff;
  background-color: transparent;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.content .as-sort-btn:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.75) !important;
}

.content .as-sort-btn.active,
.content .as-sort-btn.active:hover {
  color: #2d7a2d !important;
  background-color: #ffffff !important;
  border-color: #ffffff !important;
  cursor: default;
}

.as-sort-btn i {
  font-size: 11px;
}

/* 表の列幅 */
.as-table .col-pattern { width: 34%; }
.as-table .col-ratio { width: auto; }
.as-table .col-count { width: 80px; }

.as-row-clickable {
  cursor: pointer;
}

.as-row-clickable:hover td {
  background-color: #eaf5ea;
}

/* 割合バー */
.pattern-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar-container {
  flex: 1;
  height: 16px;
  background-color: #e8e8e8;
  overflow: hidden;
}

.pattern-bar {
  height: 100%;
  background-color: #5c9f5c;
  transition: width 0.5s ease;
}

.as-percentage {
  min-width: 48px;
  text-align: right;
  font-weight: 700;
  color: #2d7a2d;
  white-space: nowrap;
}

.as-count-cell {
  text-align: right !important;
  white-space: nowrap;
  color: #333;
}

/* ガ格（格が1つ）＋内訳行：ひとまとまりのブロックとして表示
   border-collapse では none が隣接セルの罫線に負けるため hidden で消す */
.as-group-parent td {
  border-bottom-style: hidden;
}

.as-sub-row td {
  border-top-style: hidden;
  border-bottom-style: hidden;
  background-color: #ffffff;
  padding-top: 3px;
  padding-bottom: 3px;
}

.as-sub-row.as-sub-last td {
  border-bottom-style: solid;
  padding-bottom: 8px;
}

.as-sub-label-cell {
  padding-left: 20px !important;
  white-space: nowrap;
}

.as-sub-prefix {
  display: inline-block;
  width: 5.5em;
  font-size: 12px;
  color: #6a8f6a;
  position: relative;
  left: -10px;
  font-weight: bold;
}

.as-sub-row .tr-role-tag {
  font-size: 12.5px;
}

.as-sub-row .bar-container {
  height: 10px;
}

.as-sub-row .as-percentage,
.as-sub-row .as-count-cell {
  font-size: 12px;
  color: #555;
}

.as-empty-cell {
  text-align: center !important;
  color: #999;
  padding: 20px !important;
}

/* 結果ページから戻った際の該当行ハイライト */
.as-row-highlight td {
  background-color: #ffffcc !important;
  transition: background-color 0.3s ease;
}

/* レスポンシブ対応 */
@media only screen and (max-width: 640px) {
  .tr-category-title {
    flex-wrap: wrap;
  }

  .as-table .col-pattern { width: 40%; }
  .as-table .col-count { width: 60px; }

  .as-sub-label-cell {
    white-space: normal;
  }

  .as-sub-prefix {
    display: block;
    width: auto;
  }
}
