/* Version 2 — 2026-07-12 - BoardNest CSS */

/* === CSS Variables === */
:root {
  --bg-primary: #0c0a04;
  --bg-secondary: #14120a;
  --bg-card: #1a1810;
  --bg-card-hover: #222010;
  --bg-glass: rgba(26, 24, 16, 0.85);
  --text-primary: #f0ede6;
  --text-secondary: #a09b8e;
  --text-muted: #6b6558;
  --accent: #4ade80;
  --accent-hover: #22c55e;
  --accent-dim: rgba(74, 222, 128, 0.15);
  --accent-glow: rgba(74, 222, 128, 0.3);
  --border: #2a2820;
  --border-light: #3a3828;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --warning: #f59e0b;
  --info: #60a5fa;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --transition: 0.2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* === Light Mode === */
body.light-mode {
  --bg-primary: #f5f3ef;
  --bg-secondary: #ebe9e3;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f6f0;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --text-primary: #1a1810;
  --text-secondary: #6b6558;
  --text-muted: #a09b8e;
  --border: #e0ddd5;
  --border-light: #d0cdc5;
  --shadow: 0 4px 24px rgba(0,0,0,0.1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
}

/* === Nav === */
.bn-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.bn-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.bn-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}
.bn-logo i { color: var(--accent); font-size: 1.3rem; }
.bn-logo:hover { color: var(--accent); }

.bn-nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-card); }
.nav-link.active { color: var(--accent); background: var(--accent-dim); }
.nav-link i { font-size: 0.85rem; }

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

/* === Main === */
.bn-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 20px 40px;
  min-height: 100vh;
}

/* === Loading === */
.bn-loading, .bn-loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 60px 0;
}
.bn-loading i, .bn-loading-spinner i { font-size: 2rem; color: var(--accent); }
.bn-loading-spinner { padding: 20px; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:hover { background: var(--bg-card-hover); border-color: var(--border-light); }
.btn-primary { background: var(--accent); color: #0c0a04; border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-card); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn i { font-size: 0.85rem; }

/* === Cards === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}
.card:hover { border-color: var(--border-light); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 1.1rem; font-weight: 600; }

/* === Skeleton Loading === */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.skel-line { height: 14px; margin-bottom: 10px; width: 100%; }
.skel-line-sm { height: 14px; margin-bottom: 10px; width: 60%; }
.skel-line-xs { height: 14px; margin-bottom: 10px; width: 35%; }
.skel-circle {
  width: 48px; height: 48px;
  border-radius: 50%;
  margin: 0 auto 12px;
}
.skel-block { height: 80px; margin-bottom: 10px; border-radius: var(--radius-sm); }

.skeleton-grid {
  display: grid;
  gap: 16px;
}
.skeleton-grid.wishlist-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.skeleton-grid.user-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.skeleton-grid.list-grid { grid-template-columns: 1fr; }

/* Loading container — first skeleton only, hidden after data loads */
.loading-container { display: block; }
.loading-container.loaded { display: none; }

/* === Forms === */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: border-color var(--transition);
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { min-height: 80px; resize: vertical; }
select.form-input { cursor: pointer; }

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 4px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  align-items: center;
}

/* === Auth Pages === */
.auth-container {
  max-width: 420px;
  margin: 60px auto;
}

.auth-container .card {
  padding: 32px;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}
.auth-title i { color: var(--accent); margin-right: 8px; }

.auth-toggle {
  text-align: center;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.auth-toggle a { color: var(--accent); cursor: pointer; }

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.85rem;
  display: none;
}

/* === Landing Page === */
.landing-hero {
  text-align: center;
  padding: 60px 20px 40px;
}
.landing-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.landing-hero h1 i { color: var(--accent); }
.landing-hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 24px;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title i { color: var(--accent); }
.section-title .see-all {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 500;
}

.wishlist-grid, .user-grid {
  display: grid;
  gap: 16px;
}

.wishlist-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.user-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.wishlist-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}
.wishlist-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.wishlist-card .wl-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wishlist-card .wl-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.wishlist-card .wl-meta i { width: 14px; }
.wishlist-card .wl-author {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.wishlist-card .wl-author i { color: var(--accent); }

.user-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
}
.user-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.user-card .user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.4rem;
  color: var(--accent);
}
.user-card .user-name { font-weight: 600; margin-bottom: 4px; }
.user-card .user-stats { font-size: 0.8rem; color: var(--text-muted); display: flex; justify-content: center; gap: 12px; }

/* === Dashboard (My Lists) === */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.dashboard-header h2 { font-size: 1.4rem; }

.list-row {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all var(--transition);
  gap: 16px;
}
.list-row:hover { border-color: var(--border-light); }
.list-row .lr-info { flex: 1; min-width: 0; }
.list-row .lr-title { font-weight: 600; font-size: 0.95rem; }
.list-row .lr-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; display: flex; gap: 12px; flex-wrap: wrap; }
.list-row .lr-actions { display: flex; gap: 6px; flex-shrink: 0; }
.list-row .lr-vis { font-size: 0.75rem; padding: 2px 8px; border-radius: 4px; background: var(--bg-primary); }

/* === Wishlist Detail View === */
.wl-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.wl-detail-header h2 { font-size: 1.5rem; }
.wl-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.wl-items {
  display: grid;
  gap: 12px;
}

.item-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.item-card:hover { border-color: var(--border-light); }
.item-card .item-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.item-card .item-img img { width: 100%; height: 100%; object-fit: cover; }
.item-card .item-img i { font-size: 1.8rem; color: var(--text-muted); }
.item-card .item-info { flex: 1; min-width: 0; }
.item-card .item-title { font-weight: 600; margin-bottom: 4px; }
.item-card .item-desc { font-size: 0.85rem; color: var(--text-secondary); }
.item-card .item-meta { display: flex; gap: 12px; margin-top: 8px; font-size: 0.8rem; color: var(--text-muted); flex-wrap: wrap; }
.item-card .item-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: flex-start; }

.priority-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.priority-1 { background: var(--danger); }
.priority-2 { background: var(--warning); }
.priority-3 { background: var(--accent); }
.priority-4 { background: var(--info); }
.priority-5 { background: var(--text-muted); }

.status-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
}
.status-badge.reserved { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.status-badge.purchased { background: rgba(96, 165, 250, 0.15); color: var(--info); }

/* === Upvote Button === */
.upvote-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
}
.upvote-btn:hover { border-color: var(--accent); color: var(--accent); }
.upvote-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.upvote-btn i { font-size: 0.8rem; }

/* === Profile Page === */
.profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--accent);
  flex-shrink: 0;
}
.profile-info h2 { font-size: 1.5rem; }
.profile-info p { color: var(--text-secondary); font-size: 0.9rem; }
.profile-stats { display: flex; gap: 20px; margin-top: 8px; font-size: 0.85rem; color: var(--text-muted); }

/* === Share Section === */
.share-section {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.share-section .share-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: var(--font);
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text-primary); }

/* === Toast === */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  animation: toastIn 0.3s ease;
  max-width: 400px;
}
.toast.success { background: var(--accent); color: #0c0a04; }
.toast.error { background: var(--danger); color: white; }
.toast.info { background: var(--info); color: white; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; color: var(--text-muted); }
.empty-state p { font-size: 1rem; }

/* === Responsive === */
@media (max-width: 768px) {
  .bn-main { padding: 76px 16px 32px; }
  .bn-nav-inner { padding: 0 12px; gap: 16px; }
  .bn-nav-links { gap: 0; }
  .nav-link { padding: 8px 10px; font-size: 0.85rem; }
  .nav-link span { display: none; }

  .landing-hero h1 { font-size: 1.8rem; }
  .landing-hero p { font-size: 1rem; }

  .wishlist-grid { grid-template-columns: 1fr; }
  .user-grid { grid-template-columns: repeat(2, 1fr); }

  .dashboard-header { flex-direction: column; align-items: flex-start; }
  .list-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .list-row .lr-actions { width: 100%; justify-content: flex-end; }

  .wl-detail-header { flex-direction: column; }

  .item-card { flex-direction: column; }
  .item-card .item-img { width: 100%; height: 120px; }
  .item-card .item-actions { width: 100%; justify-content: flex-end; }

  .profile-header { flex-direction: column; text-align: center; }
  .profile-stats { justify-content: center; }
}

@media (max-width: 480px) {
  .user-grid { grid-template-columns: 1fr; }
  .auth-container { margin: 40px 16px; }
  .modal-content { padding: 24px 16px; }
}
