/* ==========================================================================
   Codenzo — Component library
   ========================================================================== */

/* ---- Navigation ---------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-6);
  background: rgba(11, 13, 18, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border-hair);
}
.nav-inner {
  max-width: var(--max-width); margin: 0 auto; width: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-display); font-size: var(--fs-md); font-weight: 600;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  background: var(--grad-hero); background-size: 200% 200%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text-on-accent);
  transition: background-position 600ms var(--ease-out), transform 400ms var(--ease-spring);
}
.brand:hover .brand-mark { background-position: 100% 100%; transform: rotate(-8deg) scale(1.06); }
.nav-links { display: flex; align-items: center; gap: var(--sp-6); }
.nav-links a {
  font-size: var(--fs-sm); color: var(--text-secondary);
  transition: color var(--dur-fast) var(--ease-out);
}
.nav-links a:hover { color: var(--text-primary); }
.nav-actions { display: flex; align-items: center; gap: var(--sp-3); }

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 11px 20px; border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--text-primary); color: var(--bg-0);
}
.btn-primary:hover { background: var(--violet-bright); color: white; }
.btn-accent {
  background: var(--grad-hero); color: var(--text-on-accent); font-weight: 600;
}
.btn-accent:hover { box-shadow: var(--shadow-glow-violet); }
.btn-ghost {
  background: transparent; color: var(--text-primary); border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--violet); background: rgba(124,92,255,0.08); }
.btn-sm { padding: 7px 14px; font-size: var(--fs-xs); }
.btn-lg { padding: 15px 28px; font-size: var(--fs-md); border-radius: var(--r-lg); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Cards ---------------------------------------------------------------- */
.card {
  background: var(--bg-2); border: 1px solid var(--border-hair);
  border-radius: var(--r-lg); padding: var(--sp-5);
  transition: border-color var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}
.card-hover:hover { border-color: var(--border-strong); transform: translateY(-3px); }

.listing-card {
  background: var(--bg-2); border: 1px solid var(--border-hair); border-radius: var(--r-lg);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 380ms var(--ease-out), border-color 380ms, box-shadow 380ms;
  position: relative;
}
.listing-card:hover {
  transform: translateY(-6px);
  border-color: var(--violet-dim);
  box-shadow: 0 20px 40px -12px rgba(124,92,255,0.28), 0 4px 12px rgba(0,0,0,0.3);
}
.listing-card-cover {
  aspect-ratio: 16/10; background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.listing-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease-out); }
.listing-card:hover .listing-card-cover img { transform: scale(1.06); }
.listing-card-cover::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(11,13,18,0.55) 100%);
  opacity: 0; transition: opacity 380ms;
}
.listing-card:hover .listing-card-cover::after { opacity: 1; }
.listing-card-body { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; }
.listing-card-cat {
  font-size: var(--fs-xs); color: var(--cyan); text-transform: capitalize; font-weight: 500;
}
.listing-card-title { font-size: var(--fs-base); font-weight: 500; color: var(--text-primary); }
.listing-card-dev {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-xs); color: var(--text-secondary); margin-top: auto; padding-top: var(--sp-3);
  border-top: 1px solid var(--border-hair);
}
.listing-card-price {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: var(--sp-2);
}
.listing-card-price .amount { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--text-primary); }
.listing-card-price .from { font-size: var(--fs-xs); color: var(--text-muted); }

.avatar {
  border-radius: 50%; background: var(--bg-3); object-fit: cover;
  width: 28px; height: 28px; flex-shrink: 0;
}
.avatar-lg { width: 96px; height: 96px; }

/* ---- Badges ---------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 500;
  border: 1px solid var(--border-strong); color: var(--text-secondary);
}
.badge-developer { color: var(--cyan); border-color: var(--cyan-dim); background: rgba(61,219,217,0.08); }
.badge-top-rated { color: var(--amber); border-color: var(--amber-dim); background: rgba(255,180,84,0.08); }
.badge-elite { color: var(--coral); border-color: rgba(255,107,94,0.4); background: rgba(255,107,94,0.08); }
.badge-fast-responder { color: var(--green-ok); border-color: rgba(74,222,128,0.35); background: rgba(74,222,128,0.08); }
.badge-rising-talent { color: var(--violet-bright); border-color: var(--violet-dim); background: rgba(124,92,255,0.1); }

/* ---- Forms ---------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.field label { font-size: var(--fs-sm); font-weight: 500; color: var(--text-primary); }
.field .hint { font-size: var(--fs-xs); color: var(--text-muted); }
.field .error { font-size: var(--fs-xs); color: var(--red-err); }
input, textarea, select {
  background: var(--bg-1); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  padding: 11px 14px; color: var(--text-primary); font-size: var(--fs-sm); font-family: inherit;
  transition: border-color var(--dur-fast);
}
input:focus, textarea:focus, select:focus { border-color: var(--violet); outline: none; }
textarea { resize: vertical; min-height: 100px; }
input::placeholder, textarea::placeholder { color: var(--text-muted); }

/* ---- Status pills ------------------------------------------------------------ */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 500;
}
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pending_payment { color: var(--text-muted); background: rgba(108,113,134,0.12); }
.status-in_progress { color: var(--amber); background: rgba(255,180,84,0.12); }
.status-delivered { color: var(--cyan); background: rgba(61,219,217,0.12); }
.status-revision_requested { color: var(--coral); background: rgba(255,107,94,0.12); }
.status-completed { color: var(--green-ok); background: rgba(74,222,128,0.12); }
.status-cancelled { color: var(--text-muted); background: rgba(108,113,134,0.12); }

/* ---- Section helpers ------------------------------------------------------------ */
.section { padding: var(--sp-9) 0; }
.eyebrow { font-size: var(--fs-sm); color: var(--violet-bright); font-weight: 500; margin-bottom: var(--sp-3); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: var(--sp-6); gap: var(--sp-4); flex-wrap: wrap; }
.grid { display: grid; gap: var(--sp-5); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---- Skeleton loading ------------------------------------------------------------ */
.skel { background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 37%, var(--bg-2) 63%); background-size: 400% 100%; animation: skel-shimmer 1.4s ease infinite; border-radius: var(--r-md); }
@keyframes skel-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---- Empty states ------------------------------------------------------------ */
.empty-state { text-align: center; padding: var(--sp-9) var(--sp-5); color: var(--text-secondary); }
.empty-state h3 { color: var(--text-primary); margin-bottom: var(--sp-2); }

/* ---- Toast ------------------------------------------------------------ */
#toast-root { position: fixed; bottom: var(--sp-5); right: var(--sp-5); z-index: 1000; display: flex; flex-direction: column; gap: var(--sp-2); }
.toast {
  background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  padding: 12px 16px; font-size: var(--fs-sm); box-shadow: var(--shadow-pop);
  animation: toast-in var(--dur-med) var(--ease-spring);
  max-width: 320px;
}
.toast.error { border-color: rgba(255,107,107,0.4); }
.toast.success { border-color: rgba(74,222,128,0.4); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }

footer.site-footer {
  border-top: 1px solid var(--border-hair); padding: var(--sp-8) 0 var(--sp-6);
  color: var(--text-muted); font-size: var(--fs-sm);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--sp-6); margin-bottom: var(--sp-6); }
.footer-grid h4 { color: var(--text-primary); font-size: var(--fs-sm); margin-bottom: var(--sp-3); font-family: var(--font-body); font-weight: 500; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.footer-grid a:hover { color: var(--text-primary); }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
