/* 動詞格配列検索ページのスタイル */

.search-page-title {
  margin-bottom: 20px;
}

.pattern-selection-section {
  max-width: 800px;
  margin: 0px auto 20px;
  padding: 20px;
  background: white;
  border-radius: 4px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: #2d7a2d;
  margin: 0 15px 15px 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #cae4ca;
}

.pattern-instruction {
  font-size: 14px;
  line-height: 1.8;
  color: #555;
  margin: 0 15px 20px 15px;
  padding: 15px;
  background-color: #f9f9f9;
  border: 1px solid #dbdbdb;
  border-left: 4px solid #2d7a2d;
  flex-shrink: 0;
}

/* カテゴリフィルタ */
.category-filter {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 35px 15px 25px 15px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.category-btn {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #555;
  background-color: white;
  border: 2px solid #d0d0d0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-btn i {
  font-size: 18px;
}

.category-btn:hover {
  background-color: #f0f7f0;
  border-color: #2d7a2d;
}

.category-btn.active {
  background-color: #2d7a2d;
  color: white;
  border-color: #2d7a2d;
}

.count-badge {
  display: inline-block;
  background-color: #e0e0e0;
  color: #333;
  padding: 3px 3px 4px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

.category-btn.active .count-badge {
  background: #d8afc3;
  color: #5d1337;
}

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

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

/* パターンリストコンテナ */
.pattern-list-container {
  margin: 0 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pattern-group {
  margin-bottom: 35px;
}

.pattern-group-title {
  font-size: 16px;
  font-weight: 600;
  color: #2d7a2d;
  margin-bottom: 15px;
  padding: 8px 12px;
  background-color: #f0f7f0;
  border-left: 4px solid #2d7a2d;
}

/* ソートバー */
.sort-bar {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.sort-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-family: "Noto Sans JP", sans-serif;
  color: #777;
  background: white;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sort-btn:hover {
  border-color: #2d7a2d;
  color: #2d7a2d;
}

.sort-btn.active {
  background: #2d7a2d;
  border-color: #2d7a2d;
  color: white;
}

.sort-btn i {
  margin-right: 3px;
}

/* パターンカード */
.pattern-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  flex: 1;
  overflow-y: auto;
  padding-right: 12px;
  border: 1px solid #e0e0e0;
  margin-top: 5px;
}

.pattern-card {
  background: white;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  padding: 8px 0 8px 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.pattern-card:hover {
  background-color: #f0f7f0;
}

.pattern-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.pattern-label {
  font-size: 14px;
  color: #333;
  line-height: 1.6;
}

.pattern-label strong {
  font-weight: 700;
}

.pattern-card-body {
  font-size: 13px;
  color: #666;
}

.pattern-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar-container {
  flex: 1;
  height: 20px;
  background-color: #e8e8e8;
  border-radius: 0;
  overflow: hidden;
  position: relative;
}

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

.pattern-bar:hover {
  opacity: 0.8;
}

.pattern-count {
  min-width: 120px;
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
  color: #2d7a2d;
}

.pattern-count .percentage {
  font-weight: 700;
  color: #2d7a2d;
  margin-right: 6px;
}

.pattern-count .sense-count {
  font-weight: 400;
  color: #2d7a2d;
}

/* ガ格の下位分類 */
.ga-kaku-breakdown {
  margin-top: 6px;
  margin-left: 10px;
  padding: 8px 0px 4px;
  background-color: #f7f9f7;
  border-left: 3px solid #b5d5b5;
}

.breakdown-title {
  font-size: 12px;
  font-weight: 600;
  color: #3d3d3d;
  margin-top: 8px;
  margin-left: 10px;
  padding: 0 0 2px;
}

.breakdown-item {
  margin-bottom: 2px;
  padding: 2px 8px;
  border-radius: 3px;
  transition: background-color 0.2s ease;
}

.breakdown-item:hover {
  background-color: #e8f0e8;
}

.breakdown-label {
  font-size: 12px;
  color: #333;
  line-height: 1.6;
}

.ga-kaku-breakdown .bar-container {
  height: 16px;
}

.ga-kaku-breakdown .pattern-count {
  font-size: 12px;
  color: #555;
}

.ga-kaku-breakdown .pattern-count .percentage {
  color: #555;
}

.ga-kaku-breakdown .pattern-count .sense-count {
  color: #555;
}

/* レスポンシブ対応 */
@media only screen and (max-width: 640px) {
  .category-filter {
    flex-direction: column;
    align-items: stretch;
  }
  
  .category-btn {
    width: 100%;
    justify-content: center;
  }
  
  .pattern-selection-section {
    padding: 15px;
  }
  
  .pattern-count {
    min-width: 110px;
    font-size: 13px;
  }
  
  .pattern-count .percentage {
    font-size: 13px;
  }
  
  .pattern-count .sense-count {
    font-size: 13px;
  }
}
