/* ============================================================
 * Compound Search — style.css
 * 周期表 info-panel 組み込み用（ダークテーマ）
 * CSS変数は親ページ (:root) から継承
 * ============================================================ */

/* --- セクションヘッダー --- */
.info-compounds-section {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.info-compounds-heading {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-cyan);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.info-compounds-count {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0, 212, 255, 0.15);
  color: var(--accent-cyan);
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
}

/* --- ローディング --- */
.cs-loading {
  text-align: center;
  padding: 16px 8px;
  color: var(--text-muted);
  font-size: 11px;
}

.cs-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: cs-spin 0.7s linear infinite;
  margin-bottom: 6px;
}

@keyframes cs-spin {
  to { transform: rotate(360deg); }
}

/* --- 化合物ミニカードリスト --- */
.cs-compound-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* --- ミニカード --- */
.cs-mini-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: default;
}

.cs-mini-card:hover {
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.1);
}

/* --- ミニ分子図エリア --- */
.cs-mini-molecule {
  background: rgba(13, 17, 23, 0.6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  min-height: 80px;
}

.cs-mini-molecule svg {
  max-width: 100%;
  height: auto;
  max-height: 80px;
}

.cs-mini-placeholder {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
}

/* --- ミニカード本文 --- */
.cs-mini-body {
  padding: 8px 10px;
}

.cs-mini-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 3px;
}

.cs-mini-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.cs-mini-formula {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-cyan);
  white-space: nowrap;
  flex-shrink: 0;
}

.cs-mini-formula sub {
  font-size: 0.75em;
  vertical-align: sub;
}

.cs-mini-name-en {
  font-size: 10px;
  color: var(--text-muted);
  margin: 0 0 4px;
}

.cs-mini-desc {
  font-size: 10px;
  color: var(--text-muted);
  margin: 0 0 6px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- タグ --- */
.cs-mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.cs-mini-tag {
  display: inline-block;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 600;
  border-radius: 10px;
  white-space: nowrap;
}

.cs-mini-tag-use {
  background: rgba(0, 255, 136, 0.12);
  color: var(--accent-green);
}

.cs-mini-tag-element {
  background: rgba(0, 212, 255, 0.12);
  color: var(--accent-cyan);
}

/* --- 該当なし --- */
.cs-no-compounds {
  text-align: center;
  padding: 12px 8px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- SVG分子図内の要素スタイル --- */
.cs-bond-line {
  stroke: #8b949e;
  stroke-width: 2;
  stroke-linecap: round;
}

.cs-atom-circle {
  stroke: #30363d;
  stroke-width: 1.5;
}

.cs-atom-label {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

/* ============================================================
 * 元素詳細ページ用レイアウト（compounds-section を .section として表示）
 * ============================================================ */
.compounds-page-section .info-compounds-heading {
  font-size: 14px;
  margin-bottom: 14px;
}

.compounds-page-section .info-compounds-count {
  font-size: 13px;
  padding: 2px 10px;
}

.compounds-page-section .cs-compound-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.compounds-page-section .cs-mini-molecule {
  min-height: 110px;
  padding: 16px 14px;
}

.compounds-page-section .cs-mini-body {
  padding: 12px 16px;
}

.compounds-page-section .cs-mini-name {
  font-size: 15px;
}

.compounds-page-section .cs-mini-formula {
  font-size: 14px;
}

.compounds-page-section .cs-mini-name-en {
  font-size: 12px;
}

.compounds-page-section .cs-mini-desc {
  font-size: 12px;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.compounds-page-section .cs-mini-tag {
  font-size: 10px;
  padding: 2px 8px;
}

.compounds-page-section .cs-no-compounds {
  font-size: 13px;
  padding: 20px;
}

@media (max-width: 900px) {
  .compounds-page-section .cs-compound-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .compounds-page-section .cs-compound-list {
    grid-template-columns: 1fr;
  }
}
