/* ── Examples catalog filter bar ───────────────────────────────────────────── */

#ef-bar {
  background: var(--color-sidebar-background, #f8f8f8);
  border: 1px solid #e1e4e5;
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ef-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

#ef-search {
  flex: 1;
  min-width: 180px;
  max-width: 420px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
  color: #333;
}

#ef-search:focus {
  outline: none;
  border-color: #2980b9;
  box-shadow: 0 0 0 2px rgba(41,128,185,0.15);
}

#ef-count {
  font-size: 12px;
  color: #888;
  margin-left: auto;
  white-space: nowrap;
}

#ef-reset {
  padding: 4px 12px;
  border: 1px solid #c0392b;
  border-radius: 4px;
  background: transparent;
  color: #c0392b;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.15s, color 0.15s;
}

#ef-reset:hover { background: #c0392b; color: #fff; }

.ef-chips-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.ef-chip-label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  min-width: 56px;
  flex-shrink: 0;
  padding-top: 3px;
}

/* ── Tag chips — green ───────────────────────────────────────────────────── */

#ef-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.ef-tag-btn {
  padding: 2px 9px;
  border: 1px solid #ccc;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  color: #555;
  font-family: monospace;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.ef-tag-btn:hover     { border-color: #27ae60; color: #27ae60; }
.ef-tag-btn.ef-active { background: #27ae60; border-color: #27ae60; color: #fff; }

/* ── Module chips — blue ─────────────────────────────────────────────────── */

#ef-modules { display: flex; flex-wrap: wrap; gap: 5px; }

.ef-mod-btn {
  padding: 2px 9px;
  border: 1px solid #ccc;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  color: #555;
  font-family: monospace;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.ef-mod-btn:hover     { border-color: #2980b9; color: #2980b9; }
.ef-mod-btn.ef-active { background: #2980b9; border-color: #2980b9; color: #fff; }

/* ── Dark mode ──────────────────────────────────────────────────────────── */

html[data-theme="dark"] #ef-bar,
.theme-dark #ef-bar { background: #2a2a2a; border-color: #444; }

html[data-theme="dark"] #ef-search,
.theme-dark #ef-search { background: #333; border-color: #555; color: #ddd; }

html[data-theme="dark"] .ef-chip-label,
.theme-dark .ef-chip-label { color: #aaa; }

html[data-theme="dark"] .ef-tag-btn,
html[data-theme="dark"] .ef-mod-btn,
.theme-dark .ef-tag-btn,
.theme-dark .ef-mod-btn { background: #333; border-color: #555; color: #ccc; }

html[data-theme="dark"] #ef-count,
.theme-dark #ef-count { color: #888; }

.examples-catalog-table tr[style*="display: none"] { display: none !important; }

/* Level column — emoji only, small and centered */
.examples-catalog-table td:first-child,
.examples-catalog-table th:first-child {
  text-align: center;
  font-size: 0.85em;
  vertical-align: middle;
}

/* ── Example info card (top of each individual example page) ────────────── */

.example-card {
  border: 1px solid #dde4ea;
  border-radius: 6px;
  padding: 14px 18px;
  margin: 1rem 0 1.8rem;
  background: #f8f9fa;
}

.ec-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-bottom: 10px;
}

.ec-level p, .ec-tags p, .ec-modules p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.ec-level p {
  font-size: 0.88rem;
  font-weight: 600;
  color: #444;
  white-space: nowrap;
}

.ec-tags code {
  padding: 2px 9px;
  border: 1px solid #a5d6a7;
  border-radius: 10px;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.75em;
}

.ec-modules a.reference {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid #90caf9;
  border-radius: 10px;
  background: #e3f2fd;
  color: #1565c0 !important;
  font-size: 0.75em;
  font-family: monospace;
  white-space: nowrap;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s;
}
.ec-modules a.reference:hover {
  background: #bbdefb;
  border-color: #1976d2;
}

.ec-desc p {
  margin: 0;
  font-size: 0.9rem;
  color: #555;
  line-height: 1.55;
}

/* ── Git setup commands ──────────────────────────────────────────────────── */

.ec-setup {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e1e4e5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ec-cmd p {
  margin: 0;
  padding: 4px 12px;
  border: 1px solid #c8d4dc;
  border-radius: 4px;
  background: #eef2f5;
  font-family: monospace;
  font-size: 0.82rem;
  color: #2c3e50;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ec-cmd p::before {
  content: '⎘ ';
  opacity: 0.45;
}
.ec-cmd p:hover {
  background: #dce8f0;
  border-color: #2980b9;
  color: #1a252f;
}
.ec-cmd.ec-copied p {
  background: #e8f5e9;
  border-color: #4caf50;
  color: #2e7d32;
}

/* Dark mode */
html[data-theme="dark"] .example-card,
.theme-dark .example-card {
  background: #1e2a35;
  border-color: #3a4a5a;
}
html[data-theme="dark"] .ec-level p,
.theme-dark .ec-level p { color: #ccc; }

html[data-theme="dark"] .ec-tags code,
.theme-dark .ec-tags code {
  background: #0a2010;
  border-color: #2e7d32;
  color: #a5d6a7;
}
html[data-theme="dark"] .ec-modules a.reference,
.theme-dark .ec-modules a.reference {
  background: #0a1525;
  border-color: #1565c0;
  color: #90caf9 !important;
}
html[data-theme="dark"] .ec-desc p,
.theme-dark .ec-desc p { color: #aaa; }

html[data-theme="dark"] .ec-setup,
.theme-dark .ec-setup { border-top-color: #3a4a5a; }

html[data-theme="dark"] .ec-cmd p,
.theme-dark .ec-cmd p {
  background: #1a2530;
  border-color: #3a4a5a;
  color: #9ab;
}
html[data-theme="dark"] .ec-cmd p:hover,
.theme-dark .ec-cmd p:hover {
  background: #1e3040;
  border-color: #2980b9;
  color: #cde;
}
html[data-theme="dark"] .ec-cmd.ec-copied p,
.theme-dark .ec-cmd.ec-copied p {
  background: #0a2010;
  border-color: #4caf50;
  color: #a5d6a7;
}

/* ── Module badges in the catalog table ──────────────────────────────────── */

.examples-catalog-table td:nth-child(4) p {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
}

.examples-catalog-table td:nth-child(4) a.reference {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid #90caf9;
  border-radius: 10px;
  background: #e3f2fd;
  color: #1565c0 !important;
  font-size: 0.75em;
  font-family: monospace;
  white-space: nowrap;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s;
}

.examples-catalog-table td:nth-child(4) a.reference:hover {
  background: #bbdefb;
  border-color: #1976d2;
}

/* ── Tags column — same badge treatment ──────────────────────────────────── */

.examples-catalog-table td:nth-child(3) p {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
}

.examples-catalog-table td:nth-child(3) code {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid #a5d6a7;
  border-radius: 10px;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.75em;
  white-space: nowrap;
}

/* Dark mode */
html[data-theme="dark"] .examples-catalog-table td:nth-child(4) a.reference,
.theme-dark .examples-catalog-table td:nth-child(4) a.reference {
  background: #0d2137;
  border-color: #1565c0;
  color: #90caf9 !important;
}

html[data-theme="dark"] .examples-catalog-table td:nth-child(3) code,
.theme-dark .examples-catalog-table td:nth-child(3) code {
  background: #0a1f0a;
  border-color: #2e7d32;
  color: #a5d6a7;
}

