/* ===================================================================
   Feed Pages — Shared Vercel/Geist-inspired layout
   Used by: GitHub, HackerNews, Reddit
   All classes prefixed fd-
   =================================================================== */

/* --- Page Layout --- */
.fd-page {
  max-width: 1200px;
  margin: 0 auto;
}

/* --- Page Header --- */
.fd-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.fd-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.fd-title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-strong) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fd-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--accent-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  -webkit-text-fill-color: var(--accent);
  color: var(--accent);
}

.fd-subtitle {
  color: var(--text-3);
  font-size: 0.82rem;
  font-weight: 400;
  margin: 0;
}

.fd-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* --- Filter Bar --- */
.fd-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.fd-select {
  padding: 6px 12px;
  font-size: 0.78rem;
  font-family: var(--font-body);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  cursor: pointer;
  transition: border-color var(--duration-fast) ease,
              background var(--duration-fast) ease;
}

.fd-select:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.04);
}

.fd-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

/* --- Filter Chips --- */
.fd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1rem;
}

.fd-chip {
  padding: 4px 12px;
  font-size: 0.72rem;
  font-family: var(--font-body);
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.fd-chip:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.fd-chip.active {
  background: var(--accent-subtle);
  border-color: rgba(0, 112, 243, 0.3);
  color: var(--accent);
  font-weight: 600;
}

/* --- Feed List --- */
.fd-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* --- Feed Row --- */
.fd-row {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  transition: background var(--duration-fast) ease,
              border-color var(--duration-fast) ease,
              transform var(--duration-fast) ease;
  animation: rise 0.3s var(--ease-out) backwards;
}

/* Default 3-column layout: rank | content | stats */
.fd-row {
  grid-template-columns: 2rem 1fr auto;
}

/* 2-column variant (no rank) */
.fd-row.fd-row-2col {
  grid-template-columns: 1fr auto;
}

.fd-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Stagger animation — first 20 rows */
.fd-row:nth-child(1) { animation-delay: 0ms; }
.fd-row:nth-child(2) { animation-delay: 20ms; }
.fd-row:nth-child(3) { animation-delay: 40ms; }
.fd-row:nth-child(4) { animation-delay: 60ms; }
.fd-row:nth-child(5) { animation-delay: 80ms; }
.fd-row:nth-child(6) { animation-delay: 100ms; }
.fd-row:nth-child(7) { animation-delay: 120ms; }
.fd-row:nth-child(8) { animation-delay: 140ms; }
.fd-row:nth-child(9) { animation-delay: 160ms; }
.fd-row:nth-child(10) { animation-delay: 180ms; }
.fd-row:nth-child(n+11) { animation-delay: 200ms; }

/* --- Rank Number --- */
.fd-rank {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  text-align: right;
}

.fd-rank.fd-rank-accent {
  color: var(--accent);
  font-size: 0.85rem;
}

/* --- Content Area --- */
.fd-content {
  min-width: 0;
}

.fd-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.fd-link {
  color: var(--text-strong);
  text-decoration: none;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--duration-fast) ease;
  line-height: 1.3;
}

.fd-link:hover {
  color: var(--accent);
}

/* --- Tags / Badges --- */
.fd-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.68rem;
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.fd-tag-accent {
  color: var(--accent);
}

.fd-tag-muted {
  color: var(--text-3);
  font-size: 0.65rem;
}

/* --- Description / Meta --- */
.fd-desc {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 700px;
  line-height: 1.4;
}

.fd-meta {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 2px;
  line-height: 1.4;
}

.fd-meta a {
  color: var(--text-3);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

.fd-meta a:hover {
  color: var(--text);
}

/* --- Stats Column --- */
.fd-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-3);
  flex-shrink: 0;
}

.fd-stat {
  white-space: nowrap;
}

.fd-stat-hot {
  color: #f0b429;
  font-weight: 600;
}

.fd-stat-accent {
  color: var(--accent);
  font-weight: 600;
}

.fd-stat-red {
  color: #e57373;
  font-weight: 500;
}

.fd-stat-green {
  color: #2dd4bf;
  font-weight: 500;
}

.fd-stat-label {
  color: var(--text-3);
  font-weight: 400;
}

/* --- Account Section (Reddit) --- */
.fd-accounts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 1rem;
}

.fd-account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  transition: background var(--duration-fast) ease;
}

.fd-account-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.fd-account-info {
  flex: 1;
  min-width: 0;
}

.fd-account-name {
  font-weight: 600;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 8px;
}

.fd-account-status {
  display: inline-flex;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
}

.fd-account-status.active {
  background: var(--color-success);
}

.fd-account-status.unverified {
  background: var(--yellow, #f59e0b);
}

.fd-account-status.expired,
.fd-account-status.error {
  background: var(--red);
}

.fd-account-meta {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 2px;
}

.fd-account-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* --- Create Form --- */
.fd-form-card {
  position: relative;
  background: rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: rise 0.3s var(--ease-out);
}

.fd-form-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: linear-gradient(90deg, var(--accent) 0%, #38bdf8 50%, rgba(0, 112, 243, 0.3) 100%);
}

.fd-form-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0 0 0.75rem;
}

.fd-form-error {
  font-size: 0.8rem;
  color: var(--red);
  margin-bottom: 0.5rem;
}

.fd-form-hint {
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 0.25rem;
}

.fd-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 0.75rem;
}

/* --- Empty State --- */
.fd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem;
  text-align: center;
  animation: rise 0.4s var(--ease-out) backwards;
}

.fd-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--accent-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
}

.fd-empty-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.fd-empty-desc {
  font-size: 0.85rem;
  color: var(--text-3);
  max-width: 360px;
  line-height: 1.6;
}

/* --- Loading --- */
.fd-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 300px;
  color: var(--text-3);
  font-size: 0.85rem;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .fd-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .fd-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .fd-rank {
    display: none;
  }

  .fd-stats {
    gap: 8px;
    font-size: 0.72rem;
  }

  .fd-desc {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fd-row {
    animation: none;
  }
}
