/* ── Variables ────────────────────────────────────── */
:root {
  --bg:         #f7f7f5;
  --surface:    #ffffff;
  --border:     #e8e8e6;
  --border-2:   #d4d4d0;
  --text:       #111110;
  --text-2:     #6b6b68;
  --text-3:     #b4b4b0;
  --active:     #16a34a;
  --inactive:   #d97706;
  --obsolete:   #c0c0bc;
  --accent:     #111110;
  --radius:     8px;
  --radius-sm:  5px;
  --max-w:      700px;
}

/* ── Reset ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── Header ───────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}

.gh-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 0;
  transition: color 0.15s;
  flex-shrink: 0;
  margin-top: 4px;
}
.gh-link:hover { color: var(--text); }
.gh-link svg { flex-shrink: 0; }

.header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.stats {
  color: var(--text-3);
  font-size: 13px;
}

.stats strong {
  color: var(--text-2);
  font-weight: 500;
}

.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.leg {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 5px;
}
.leg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.leg-active   .leg-dot { background: var(--active); }
.leg-inactive .leg-dot { background: var(--inactive); }
.leg-obsolete .leg-dot { background: var(--obsolete); }

/* ── Main ─────────────────────────────────────────── */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 24px 72px;
}

/* ── Search ───────────────────────────────────────── */
.search-wrap {
  position: relative;
  margin-bottom: 16px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

#searchInput {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 90px 10px 38px;
  outline: none;
  transition: border-color 0.12s;
  appearance: none;
}
#searchInput::placeholder { color: var(--text-3); }
#searchInput:focus { border-color: var(--accent); }

.search-count {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-3);
  pointer-events: none;
}

/* ── Feed list ────────────────────────────────────── */
.feed-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.feed-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  animation: fadeIn 0.2s ease both;
}
.feed-row:last-child { border-bottom: none; }
.feed-row:hover { background: #fafaf8; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.row-active   .status-dot { background: var(--active); }
.row-inactive .status-dot { background: var(--inactive); }

.row-inactive { opacity: 0.5; }
.row-inactive:hover { opacity: 0.85; }

.feed-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feed-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.12s;
}
.feed-name:hover { color: #000; text-decoration: underline; text-underline-offset: 2px; }

.feed-url {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ep-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
}

/* Hidden url input for clipboard fallback */
.url-hidden {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
  appearance: none;
  min-width: 62px;
  text-align: center;
}
.copy-btn:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border-2);
}
.copy-btn.copied {
  color: var(--active);
  border-color: transparent;
  background: transparent;
}

/* ── Empty state ──────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 0;
  color: var(--text-3);
  font-size: 13.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 520px) {
  .legend  { display: none; }
  .ep-badge { display: none; }
  .feed-url { display: none; }
  .header-top { flex-direction: column; gap: 8px; }
  .copy-btn { padding: 4px 10px; }
}
