/**
 * 共通UIコンポーネント（絞り込みフォーム・主要指標カード）
 * トップ / シミュレーション / データの見方 などで共有。
 */

/* --- 主要指標カード --- */
.yws-top-metrics {
  display: grid;
  gap: 2em;
  margin-top: 2em;
}

.yws-top-metric-card {
  padding: 1.15em 1.1em;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.yws-top-metric-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 1em;
  opacity: 0.1;
}

.yws-top-metric-card__icon img {
  display: block;
  width: 150px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.yws-top-metric-card h3 {
  margin: 0 0 0.75em;
  font-size: 1.1em;
  text-align: center;
}

.yws-top-metric-card p {
  font-size: 0.9em;
  text-align: left;
}

@media (min-width: 768px) {
  .yws-top-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .yws-top-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .yws-top-metrics {
    grid-template-columns: 1fr;
  }
}

/* --- 絞り込み検索フォーム --- */
.yws-filter-form {
  margin-top: 1.5em;
  padding: 24px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.yws-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.yws-filter-score-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.yws-filter-item {
  padding: 10px 16px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.yws-filter-item.is-filled {
  border-color: #7a9e3a;
  background: #e8f2d4;
}

.yws-filter-item.is-error {
  border-color: #e57d7d;
  background: #fff8f8;
}

.yws-filter-label {
  display: inline-flex;
  margin: 0 0 8px;
  font-size: 0.92em;
  font-weight: 700;
  color: #1e293b;
}

.yws-filter-unit {
  color: #64748b;
  font-size: 0.92em;
  font-weight: 500;
}

.yws-filter-select,
.yws-filter-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #1e293b;
  font-size: 14px;
  outline: none;
}

.yws-filter-select:focus,
.yws-filter-input:focus {
  border-color: #556b2f;
  box-shadow: 0 0 0 4px rgba(85, 107, 47, 0.12);
}

.yws-filter-select {
  padding-right: 40px;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #7c8aa5 50%),
    linear-gradient(135deg, #7c8aa5 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.yws-filter-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.yws-filter-input::placeholder {
  color: #94a3b8;
}

.yws-filter-error {
  display: none;
  margin: 8px 0 0;
  color: #c24141;
  font-size: 0.8rem;
}

.yws-filter-item.is-error .yws-filter-error {
  display: block;
}

.yws-filter-mobile-toggle {
  display: block;
  margin-top: 16px;
}

.yws-filter-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 0;
  padding: 0 16px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #1e293b;
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 700;
}

.yws-filter-collapsed {
  display: none;
}

.yws-filter-grid.is-expanded .yws-filter-collapsed {
  display: block;
}

.yws-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.yws-filter-submit,
.yws-filter-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 999px;
  font-size: 0.95em;
  font-weight: 700;
  cursor: pointer;
}

.yws-filter-submit {
  padding: 0 50px;
  border: 1px solid #556b2f;
  background: #556b2f;
  color: #fff;
}

.yws-filter-submit:hover,
.yws-filter-submit:focus {
  background: #465a27;
  border-color: #465a27;
}

.yws-filter-reset {
  padding: 0 50px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
}

.yws-filter-reset:hover,
.yws-filter-reset:focus {
  background: #f8fafc;
}

@media (max-width: 960px) {
  .yws-filter-grid {
    grid-template-columns: 1fr;
  }

  .yws-filter-score-row {
    grid-template-columns: 1fr;
  }
}
