@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=Roboto:wght@500&display=swap');

/* ベース設定 */
body {
  font-family: "Noto Sans JP", sans-serif;
  line-height: 1.8;
  margin: 0;
  padding: 2.5rem 2rem;
  background: #f5f7fa;
  color: #333;
}

/* 見出し */
h1 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0.02em;
}

/* 説明文 */
.description {
  margin-bottom: 2rem;
  line-height: 1.8;
  color: #555;
  font-size: 0.95rem;
}

/* 検索フォームコンテナ */
.search-container {
  margin-bottom: 2rem;
}

.search-container label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #444;
  font-size: 0.95rem;
}

/* 入力欄のスタイル */
#input-text {
  width: 100%;
  max-width: 100%;
  min-height: 8rem;
  padding: 1rem 1rem 1rem 1rem;
  box-sizing: border-box;
  font-size: 1rem;
  font-family: "Noto Sans JP", sans-serif;
  line-height: 1.6;
  border: 2px solid #e0e4e8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#input-text:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 2px 12px rgba(74, 144, 226, 0.15);
}

/* 結果表示領域の各行 */
.result-item {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  margin-bottom: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border-left: 4px solid #28a745;
  border-top: 1px solid #e8ecf0;
  border-right: 1px solid #e8ecf0;
  border-bottom: 1px solid #e8ecf0;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
  color: #333;
  transition: all 0.2s ease;
}

.result-item:hover {
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15), 0 2px 4px rgba(0, 0, 0, 0.08);
  transform: translateX(2px);
  border-left-color: #218838;
}

/* 結果のメタデータ（課題管理番号、年度、研究課題名、ソース） */
.result-metadata {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e8ecf0;
  font-size: 0.75rem;
  color: #666;
  line-height: 1.5;
}

.metadata-row {
  margin-bottom: 0.25rem;
}

.metadata-label {
  font-weight: 500;
  color: #777;
  margin-right: 0.25rem;
}

/* 検索キーワードのハイライト */
mark {
  background-color: #fff3cd;
  color: #856404;
  padding: 0.1em 0.2em;
  border-radius: 3px;
  font-weight: 500;
}

/* 検索結果が無い場合のテキスト */
.no-results {
  color: #6c757d;
  font-style: italic;
  text-align: center;
  padding: 2rem;
}

/* クリアボタン */
.clear-button {
  display: block;
  margin: 0.75rem auto 0;
  background-color: #007b9e;
  color: #ffffff;
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 123, 158, 0.2);
}

.clear-button:hover {
  background-color: #006080;
  box-shadow: 0 4px 8px rgba(0, 123, 158, 0.3);
  transform: translateY(-1px);
}

.clear-button:active {
  transform: translateY(0);
}

/* 入力中のハイライト表示エリア */
.input-highlight {
  background: #ffffff;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border: 1px solid #e8ecf0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  margin-bottom: 1.5rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.8;
  color: #333;
  min-height: 3rem;
}

/* クラスタ用ハイライト */
.cluster-term {
  background-color: #fff3cd;
  color: #856404;
  padding: 0.1em 0.3em;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
  border-bottom: 2px solid transparent;
}

.cluster-term:hover {
  background-color: #ffc107;
  color: #fff;
  border-bottom-color: #e0a800;
}

/* 代表表記のハイライト（緑色） */
.cluster-term-representative {
  background-color: #d4edda;
  color: #155724;
  padding: 0.1em 0.3em;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
  border-bottom: 2px solid transparent;
}

.cluster-term-representative:hover {
  background-color: #28a745;
  color: #fff;
  border-bottom-color: #1e7e34;
}

/* クラスター情報ボックス */
.cluster-info {
  background: #e7f3ff;
  border-left: 4px solid #4a90e2;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  color: #333;
  box-shadow: 0 2px 6px rgba(74, 144, 226, 0.08);
  display: none;
}

.cluster-info.show {
  display: block;
}

.cluster-info > div {
  margin-bottom: 0.5rem;
}

.cluster-info > div:last-child {
  margin-bottom: 0;
}

.cluster-info strong {
  color: #1a1a1a;
  font-weight: 600;
  margin-right: 0.5rem;
}

.cluster-info span {
  transition: all 0.15s ease;
}

.cluster-info span:hover {
  color: #4a90e2;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  body {
    padding: 1.5rem 1rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  #input-text {
    min-height: 6rem;
  }
}

/* フッター */
.footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e8ecf0;
  text-align: center;
}

/* e-btn-arrow スタイル */
.e-btn-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: #007b9e;
  color: #ffffff;
  padding: 8px 40px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  min-height: 40px;
  min-width: 280px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 123, 158, 0.25);
  border: none;
}

.e-btn-arrow:hover {
  background-color: #006080;
  box-shadow: 0 6px 16px rgba(0, 123, 158, 0.35);
  transform: translateY(-2px);
}

.e-btn-arrow:active {
  transform: translateY(0);
}
