/* FreelanceFlow — dark deal-desk aesthetic */

:root {
  --bg: #0c0d10;
  --bg-raise: #131518;
  --panel: #16181d;
  --panel-edge: #22252c;
  --card: #1b1e24;
  --card-hover: #21252d;
  --ink: #e8e6e1;
  --ink-dim: #9a978f;
  --ink-faint: #5c5a54;
  --amber: #f6a821;
  --amber-soft: rgba(246, 168, 33, 0.12);
  --green: #57c785;
  --blue: #5aa9e6;
  --red: #e05252;
  --radius: 10px;
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Instrument Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(246, 168, 33, 0.05), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(90, 169, 230, 0.04), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------- Token gate ---------- */

.gate {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  z-index: 100;
}

.gate-card {
  width: 340px;
  padding: 40px 32px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 16px;
  text-align: center;
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gate-mark { font-size: 34px; margin-bottom: 10px; }

.gate-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.gate-sub { color: var(--ink-faint); margin: 6px 0 26px; font-size: 12px; }

.gate-card input {
  width: 100%;
  margin-bottom: 12px;
  text-align: center;
  font-family: var(--font-mono);
}

.gate-card .btn { width: 100%; }

.gate-error { color: var(--red); margin-top: 12px; font-size: 12px; }

/* ---------- Topbar ---------- */

.app { display: flex; flex-direction: column; height: 100vh; }

.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--panel-edge);
  background: rgba(12, 13, 16, 0.8);
  backdrop-filter: blur(8px);
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  font-size: 20px;
  filter: drop-shadow(0 0 8px rgba(246, 168, 33, 0.5));
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 10px;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.topbar-stats {
  display: flex; gap: 18px;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
}

.topbar-stats b { color: var(--ink); font-weight: 600; }

.topbar-actions { display: flex; gap: 10px; }

/* ---------- Board ---------- */

.board {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 16px;
  padding: 20px 24px 24px;
  overflow-x: auto;
}

.column {
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  min-height: 0;
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.column:nth-child(2) { animation-delay: 0.05s; }
.column:nth-child(3) { animation-delay: 0.1s; }
.column:nth-child(4) { animation-delay: 0.15s; }

.column-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px 10px;
}

.column-dot { width: 8px; height: 8px; border-radius: 50%; }

.column-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.column-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}

.column-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 80px;
}

.column-body.drag-over {
  background: var(--amber-soft);
  border-radius: 0 0 14px 14px;
  outline: 1px dashed rgba(246, 168, 33, 0.4);
  outline-offset: -6px;
}

/* ---------- Cards ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  padding: 12px 12px 10px;
  cursor: grab;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.card:hover {
  background: var(--card-hover);
  border-color: #333842;
  transform: translateY(-1px);
}

.card.dragging { opacity: 0.4; }

.card-top { display: flex; align-items: flex-start; gap: 8px; }

.card-title {
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.35;
  flex: 1;
}

.card:hover .card-title { color: var(--amber); }

.prio {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.prio-low  { color: var(--ink-dim); border-color: var(--panel-edge); }
.prio-mid  { color: var(--blue); border-color: rgba(90, 169, 230, 0.35); background: rgba(90, 169, 230, 0.08); }
.prio-high { color: var(--amber); border-color: rgba(246, 168, 33, 0.4); background: var(--amber-soft); }
.prio-max  { color: #0c0d10; background: var(--amber); border-color: var(--amber); }

.card-desc {
  color: var(--ink-dim);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-faint);
}

.card-meta a {
  color: var(--blue);
  text-decoration: none;
}

.card-meta a:hover { text-decoration: underline; }

.card-bid { color: var(--green); font-weight: 600; }

.has-proposal { color: var(--amber); }

/* ---------- Buttons & inputs ---------- */

.btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease;
}

.btn-primary { background: var(--amber); color: #0c0d10; }
.btn-primary:hover { filter: brightness(1.1); }

.btn-ghost {
  background: transparent;
  color: var(--ink-dim);
  border-color: var(--panel-edge);
}
.btn-ghost:hover { color: var(--ink); border-color: #333842; }

.btn-danger { background: transparent; color: var(--red); border-color: rgba(224, 82, 82, 0.4); }
.btn-danger:hover { background: rgba(224, 82, 82, 0.1); }

input, textarea, select {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
  background: var(--bg-raise);
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  padding: 9px 11px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease;
}

input:focus, textarea:focus, select:focus { border-color: var(--amber); }

textarea { resize: vertical; line-height: 1.5; }

input[type="range"] { padding: 0; accent-color: var(--amber); }

/* ---------- Modal ---------- */

.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 6, 8, 0.75);
  backdrop-filter: blur(3px);
}

.modal-panel {
  position: relative;
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 16px;
  padding: 22px 24px;
  animation: rise 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}

.modal-head h2 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal-x {
  background: none; border: none;
  color: var(--ink-faint);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.modal-x:hover { color: var(--ink); }

.field { display: block; margin-bottom: 14px; }

.field > span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  margin-bottom: 6px;
}

.field > span small { text-transform: none; letter-spacing: 0; color: var(--ink-faint); font-weight: 400; }

.field > span em {
  font-style: normal;
  color: var(--amber);
  font-family: var(--font-mono);
}

.field-row { display: grid; grid-template-columns: 1.4fr 1fr 0.8fr 0.7fr; gap: 10px; }
.field-row .field { margin-bottom: 14px; }

.modal-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px;
}

.modal-foot-right { display: flex; gap: 10px; margin-left: auto; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--panel-edge);
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  z-index: 200;
  animation: rise 0.25s ease;
}

/* ---------- Animations ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .board { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .topbar-stats { display: none; }
}

@media (max-width: 560px) {
  .board { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr 1fr; }
}
