/* =====================================================
   Assembly — Proposal Board Styles
   Additions for the dynamic JS-rendered proposal board.
   Loaded alongside theme.css.
   ===================================================== */

/* ── Sort Controls ────────────────────────────────── */
.board-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.sort-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L2 4h8z' fill='%235a5a5a'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 32px 6px 12px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  transition: border-color 0.15s;
  background-color: var(--surface);
}
.sort-select:hover { border-color: var(--border-strong); }
.sort-select:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.sort-select option { background: var(--surface); }

/* ── Skeleton Loading ─────────────────────────────── */
.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-card {
  display: grid;
  grid-template-columns: 56px 1fr 180px;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-alt) 25%, var(--surface) 50%, var(--surface-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.sk-rank  { width: 36px; height: 36px; border-radius: 50%; }
.sk-tag   { width: 70px; height: 18px; margin-bottom: 10px; }
.sk-title { width: 75%; height: 18px; margin-bottom: 8px; }
.sk-desc  { width: 90%; height: 14px; margin-bottom: 4px; }
.sk-desc2 { width: 60%; height: 14px; }
.sk-vote  { width: 50px; height: 18px; }

@media (max-width: 900px) {
  .skeleton-card {
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
  }
  .sk-vote-wrap {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .sk-vote { flex: 1; max-width: 200px; }
}

/* ── Proposal Card (JS rendered) ───────────────────── */
.proposal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.proposal-card {
  display: grid;
  grid-template-columns: 56px 1fr 180px;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.proposal-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.proposal-lead {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(45, 80, 22, 0.03) 0%, var(--surface) 100%);
}

.proposal-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}
.rank-num {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg-subtle);
}

.proposal-body { min-width: 0; }
.proposal-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.proposal-tag {
  padding: 2px 10px;
  background: var(--surface-alt);
  color: var(--fg-muted);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.proposal-status-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-open      { background: rgba(45, 80, 22, 0.1); color: var(--primary); }
.status-executing { background: rgba(201, 122, 15, 0.1); color: var(--accent); }
.status-shipped   { background: rgba(45, 80, 22, 0.15); color: var(--primary); }
.status-rejected  { background: rgba(90, 90, 90, 0.1); color: var(--fg-muted); }

.proposal-author { font-size: 0.75rem; color: var(--fg-subtle); }
.proposal-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 6px;
  line-height: 1.3;
}
.proposal-desc {
  font-size: 0.82rem;
  color: var(--fg-muted);
  line-height: 1.5;
  /* truncate at 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.proposal-time {
  font-size: 0.7rem;
  color: var(--fg-subtle);
  margin-top: 6px;
}

.proposal-votes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.vote-score {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}
.vote-bar-wrap {
  width: 100%;
  height: 4px;
  background: var(--surface-alt);
  border-radius: 2px;
  overflow: hidden;
}
.vote-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  transition: width 0.3s ease;
}
.vote-controls {
  display: flex;
  gap: 4px;
}
.vote-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--fg-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  position: relative;
}
.vote-btn:hover { border-color: var(--border-strong); color: var(--fg); }
.vote-btn.vote-up.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.vote-btn.vote-down.active {
  background: #a33;
  border-color: #a33;
  color: white;
}
.vote-btn.loading { pointer-events: none; opacity: 0.6; }
.vote-btn:disabled { cursor: not-allowed; }

/* ── Empty State ──────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 24px;
  text-align: center;
}
.empty-icon {
  width: 64px;
  height: 64px;
  background: var(--surface-alt);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-headline {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
}
.empty-body {
  font-size: 0.875rem;
  color: var(--fg-muted);
  max-width: 360px;
}
.empty-arrow {
  display: inline-block;
  animation: bounce-left 1.2s ease-in-out infinite;
}
@keyframes bounce-left {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(-12px); }
}

/* ── Error Toast ──────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: #c0392b;
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: toast-in 0.25s ease-out;
  pointer-events: auto;
}
.toast.fade-out {
  animation: toast-out 0.3s ease-in forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(4px); }
}

/* ── Load More ────────────────────────────────────── */
.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}
.load-more-btn {
  padding: 10px 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.load-more-btn:hover { border-color: var(--border-strong); color: var(--fg); }
.load-more-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Stats Strip ──────────────────────────────────── */
.stats-strip {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.82rem;
  color: var(--fg-subtle);
  padding: 10px 2px 18px;
  letter-spacing: 0.01em;
}

/* Mobile: allow two-line wrap */
@media (max-width: 480px) {
  .stats-strip { font-size: 0.78rem; padding: 8px 0 14px; }
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 900px) {
  .proposal-card {
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
  }
  .proposal-votes {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
  }
  .vote-bar-wrap { flex: 1; max-width: 200px; }
}

@media (max-width: 480px) {
  .proposal-card { padding: 16px; gap: 12px; }
  .proposal-title { font-size: 0.9rem; }
  .toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { font-size: 0.8rem; }
}