/* subreddit-directory.css — scoped styles for [finsig_subreddit_directory] */

/* ── Directory-specific colour tokens (additive — don't override theme) ── */
.finsig-dir-wrap {
  --dir-green:    #10b981;
  --dir-amber:    #f59e0b;
  --dir-red:      #ef4444;
  --dir-purple:   #8b5cf6;
  --dir-navy:     #3b82f6;
  --dir-mono:     var(--font-mono, 'JetBrains Mono', monospace);
  --dir-sans:     var(--font-body, 'Plus Jakarta Sans', sans-serif);
  --dir-bg2:      #0D1128;
  --dir-bg3:      #141830;
  --dir-border:   rgba(255,255,255,0.07);
  --dir-border2:  rgba(255,255,255,0.13);
  --dir-muted:    var(--muted, #6B7E9C);
  --dir-radius:   6px;
  --dir-sidebar:  220px;
  font-size: 14px;
  line-height: 1.5;
  padding-top: 60px; /* clear fixed nav (#site-nav height: 60px) */
}

/* ── Top bar (search + stats + export) ── */
.fsd-topbar {
  background: var(--dir-bg2);
  border-bottom: 1px solid var(--dir-border);
  padding: 0 24px;
}
.fsd-topbar-inner {
  max-width: 1560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 52px;
}
.fsd-search-wrap {
  flex: 1;
  max-width: 440px;
  position: relative;
}
.fsd-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dir-muted);
  pointer-events: none;
}
.fsd-search {
  width: 100%;
  background: var(--dir-bg3);
  border: 1px solid var(--dir-border2);
  border-radius: var(--dir-radius);
  padding: 7px 12px 7px 32px;
  color: var(--text);
  font-family: var(--dir-sans);
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
.fsd-search::placeholder { color: var(--dir-muted); }
.fsd-search:focus { border-color: var(--accent); }

.fsd-stats {
  font-family: var(--dir-mono);
  font-size: 11px;
  color: var(--dir-muted);
  white-space: nowrap;
}
.fsd-stats b { color: var(--accent); }

.fsd-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--dir-border2);
  border-radius: var(--dir-radius);
  color: var(--dir-muted);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
  margin-left: auto;
}
.fsd-export-btn:hover { border-color: var(--accent); color: var(--accent); }
.fsd-export-btn:disabled { opacity: .5; cursor: default; }

/* ── App layout ── */
.fsd-app {
  max-width: 1560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--dir-sidebar) 1fr;
  min-height: calc(100vh - 60px - 52px);
}

/* ── Sidebar ── */
.fsd-sidebar {
  background: var(--dir-bg2);
  border-right: 1px solid var(--dir-border);
  padding: 16px 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px - 52px);
  overflow-y: auto;
}
.fsd-sidebar-section { padding: 0 0 12px; }
.fsd-sidebar-label {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dir-muted);
  font-family: var(--dir-mono);
}
.fsd-cat-btn,
.fsd-q-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 6px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  gap: 6px;
  transition: background .12s, color .12s;
  border-left: 2px solid transparent;
}
.fsd-cat-btn:hover, .fsd-q-btn:hover { background: rgba(255,255,255,.04); }
.fsd-cat-btn.active, .fsd-q-btn.active {
  background: rgba(0,212,160,.08);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}
.fsd-cat-count {
  margin-left: auto;
  font-family: var(--dir-mono);
  font-size: 10px;
  color: var(--dir-muted);
  background: rgba(255,255,255,.06);
  padding: 1px 5px;
  border-radius: 3px;
}
.fsd-q-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fsd-q-dot--high      { background: var(--dir-green); }
.fsd-q-dot--mixed     { background: var(--dir-amber); }
.fsd-q-dot--community { background: var(--dir-navy); }
.fsd-q-dot--low       { background: var(--dir-red); }

/* ── Main content ── */
.fsd-main {
  padding: 20px 24px 40px;
  min-width: 0;
}

/* ── Filter chips ── */
.fsd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.fsd-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  background: rgba(0,212,160,.1);
  border: 1px solid rgba(0,212,160,.25);
  border-radius: 4px;
  font-size: 12px;
  color: var(--accent);
}
.fsd-chip button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  opacity: .7;
}
.fsd-chip button:hover { opacity: 1; }
.fsd-chip--clear {
  background: transparent;
  border-color: var(--dir-border2);
  color: var(--dir-muted);
  cursor: pointer;
}

/* ── Table ── */
.fsd-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--dir-border);
  border-radius: 8px;
}
.fsd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.fsd-table thead th {
  background: var(--dir-bg2);
  padding: 10px 14px;
  text-align: left;
  font-weight: 500;
  color: var(--dir-muted);
  font-size: 11.5px;
  letter-spacing: .04em;
  white-space: nowrap;
  border-bottom: 1px solid var(--dir-border);
  user-select: none;
}
.fsd-table thead th[data-col]:hover { color: var(--text); cursor: pointer; }
.fsd-table thead th.sort-desc::after { content: ' ↓'; color: var(--accent); }
.fsd-table thead th.sort-asc::after  { content: ' ↑'; color: var(--accent); }

.fsd-table tbody tr {
  border-bottom: 1px solid var(--dir-border);
  transition: background .1s;
}
.fsd-table tbody tr:last-child { border-bottom: none; }
.fsd-table tbody tr:hover { background: rgba(255,255,255,.02); }
.fsd-table td { padding: 10px 14px; vertical-align: top; }

.fsd-sub-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-weight: 500;
  font-family: var(--dir-mono);
  font-size: 12.5px;
  white-space: nowrap;
}
.fsd-sub-link svg { opacity: .5; flex-shrink: 0; }
.fsd-sub-link:hover svg { opacity: 1; }

.fsd-cat-pill {
  display: inline-block;
  padding: 2px 7px;
  background: rgba(255,255,255,.06);
  border-radius: 3px;
  font-size: 11.5px;
  color: var(--dir-muted);
  white-space: nowrap;
}
.fsd-num {
  font-family: var(--dir-mono);
  font-size: 12px;
  color: var(--dir-muted);
  white-space: nowrap;
}
.fsd-desc {
  font-size: 12.5px;
  color: var(--dir-muted);
  max-width: 380px;
  line-height: 1.5;
}

/* ── Badges ── */
.fsd-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-high      { background: rgba(16,185,129,.15); color: #10b981; border: 1px solid rgba(16,185,129,.25); }
.badge-mixed     { background: rgba(245,158,11,.12);  color: #f59e0b; border: 1px solid rgba(245,158,11,.25); }
.badge-community { background: rgba(59,130,246,.12);  color: #60a5fa; border: 1px solid rgba(59,130,246,.25); }
.badge-low       { background: rgba(239,68,68,.12);   color: #f87171; border: 1px solid rgba(239,68,68,.25); }

/* ── Pagination ── */
.fsd-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.fsd-pg-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  background: var(--dir-bg3);
  border: 1px solid var(--dir-border);
  border-radius: var(--dir-radius);
  color: var(--dir-muted);
  font-size: 12px;
  cursor: pointer;
  transition: border-color .1s, color .1s;
}
.fsd-pg-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.fsd-pg-btn.active { background: rgba(0,212,160,.12); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.fsd-pg-btn:disabled { opacity: .35; cursor: default; }
.fsd-pg-ellipsis { color: var(--dir-muted); font-size: 12px; padding: 0 4px; }
.fsd-pg-info { margin-left: 8px; font-family: var(--dir-mono); font-size: 11px; color: var(--dir-muted); }

/* ── Toast ── */
.fsd-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--dir-bg2);
  border: 1px solid var(--dir-border2);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--accent);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 999;
}
.fsd-toast.show { opacity: 1; transform: none; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .fsd-app { grid-template-columns: 1fr; }
  .fsd-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--dir-border);
    display: flex;
    flex-wrap: wrap;
    padding: 8px 16px;
    gap: 0;
  }
  .fsd-sidebar-section { padding: 4px 0; }
  .fsd-sidebar-label { display: none; }
  .fsd-cat-btn, .fsd-q-btn {
    width: auto;
    padding: 4px 10px;
    border-left: none;
    border-radius: 4px;
    border: 1px solid transparent;
    font-size: 12px;
  }
  .fsd-cat-btn.active, .fsd-q-btn.active {
    border-color: var(--accent);
  }
  .fsd-topbar-inner { flex-wrap: wrap; height: auto; padding: 8px 0; }
  .fsd-search-wrap { max-width: 100%; }
  .fsd-desc { max-width: 220px; }
}
@media (max-width: 600px) {
  .fsd-main { padding: 12px 12px 32px; }
  .fsd-table { font-size: 12px; }
  .fsd-desc { display: none; }
}
