/* =========================================================
   WORKLINK SA — PREMIUM MARKETPLACE + OWNER CONSOLE
   High-trust • Fintech-grade • SA-rooted • Mobile-first
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #0b0d10;
  --bg-elevated: #12151a;
  --bg-card: #161a21;
  --bg-hover: #1c212b;
  --border: #2a303c;
  --border-strong: #3d4656;
  --text: #e8eaed;
  --text-muted: #8b93a7;
  --text-dim: #5c6578;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --danger: #ef4444;
  --sa-gold: #eab308;
  --radius: 10px;
  --radius-sm: 6px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
}

body.light-mode {
  --bg: #f4f5f7;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f0f2f5;
  --border: #d8dde6;
  --border-strong: #b0b8c8;
  --text: #0f1218;
  --text-muted: #4a5568;
  --text-dim: #718096;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

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

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

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

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 300;
  background: rgba(11, 13, 16, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
body.light-mode .site-header {
  background: rgba(255,255,255,0.92);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
}
.brand-mark {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: #fff;
}
.brand-text {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.brand-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.95rem;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}
.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  padding: 3.5rem 1.25rem 3rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(59,130,246,0.08), transparent),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(16,185,129,0.05), transparent);
  pointer-events: none;
}
.hero-content {
  position: relative;
  max-width: 720px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  letter-spacing: 0.03em;
}
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.9rem;
}
.hero p {
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 48ch;
  margin-bottom: 1.6rem;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.sa-flag {
  font-size: 0.9rem;
}

/* ---------- LAYOUT ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
section {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.section-head h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

/* ---------- PLATFORM FEES ---------- */
.fees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}
.fee-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  transition: border-color 0.15s, transform 0.15s;
}
.fee-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.fee-card .name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
.fee-card .price {
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.fee-card .desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  line-height: 1.4;
}
.fee-card a {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.fee-card a:hover { text-decoration: underline; }

/* ---------- MARKETPLACE CARDS ---------- */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}
.filters-bar input,
.filters-bar select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.85rem;
  min-width: 160px;
}
.filters-bar input:focus,
.filters-bar select:focus {
  outline: none;
  border-color: var(--accent);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.card-tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.card-tag.official { color: var(--accent); }
.card-tag.seller { color: var(--success); }
.card h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-grow: 1;
  line-height: 1.4;
}
.card .price {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 600;
}
.card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

/* ---------- OWNER CONSOLE ---------- */
.console-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.console-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  overflow-x: auto;
}
.console-tab {
  padding: 0.85rem 1.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.console-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.console-panel {
  display: none;
  padding: 1.4rem;
}
.console-panel.active {
  display: block;
}
.console-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.console-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.console-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.console-table tr:hover td {
  background: var(--bg-hover);
}
.status-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}
.status-open { background: var(--success-soft); color: var(--success); }
.status-pending { background: rgba(245,158,11,0.15); color: var(--warning); }
.status-closed { background: rgba(239,68,68,0.12); color: var(--danger); }

/* ---------- TRANSACTION ROOMS ---------- */
.rooms-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 380px;
  background: var(--bg-elevated);
}
@media (max-width: 700px) {
  .rooms-layout { grid-template-columns: 1fr; }
}
.rooms-list {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  max-height: 420px;
  background: var(--bg);
}
.room-item {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.1s;
}
.room-item:hover, .room-item.active {
  background: var(--bg-hover);
}
.room-item .title {
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.room-item .meta {
  font-size: 0.7rem;
  color: var(--text-dim);
}
.chat-area {
  display: flex;
  flex-direction: column;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 260px;
  max-height: 320px;
}
.msg {
  max-width: 78%;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.4;
}
.msg.mine {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.msg.theirs {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
}
.msg .time {
  font-size: 0.65rem;
  opacity: 0.7;
  margin-top: 0.2rem;
}
.chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem;
  border-top: 1px solid var(--border);
}
.chat-input-row input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
}
.chat-input-row input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---------- MODALS ---------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.75);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.active { display: flex; }
.modal-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.modal-box h2 {
  font-size: 1.25rem;
  margin-bottom: 1.1rem;
  letter-spacing: -0.02em;
}
.form-group {
  margin-bottom: 0.9rem;
}
.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group textarea { min-height: 90px; resize: vertical; }
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.1rem;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.8rem 0;
}
.check-row a { color: var(--accent); }

/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 3rem 1.25rem 2rem;
}
.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  margin-bottom: 0.9rem;
}
.footer-col a, .footer-col p {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 0.45rem;
  line-height: 1.4;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.8rem;
}
.trust-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
}

/* ---------- UTILS ---------- */
.hidden { display: none !important; }
.empty {
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 1.5rem 0;
  text-align: center;
}
.notice {
  background: var(--accent-soft);
  border: 1px solid rgba(59,130,246,0.25);
  color: var(--accent);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
}

@media (max-width: 600px) {
  .hero { padding: 2.5rem 1rem 2rem; }
  .cards-grid { grid-template-columns: 1fr; }
  .site-header { padding: 0.6rem 1rem; }
}

/* ---------- EXTRA: Nav, Share, Anti-scam, Owner stats ---------- */
.header-nav {
  display: flex;
  gap: 0.15rem;
  flex-wrap: wrap;
}
.nav-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover {
  color: var(--text);
  background: var(--bg-hover);
}
@media (max-width: 800px) {
  .header-nav { display: none; }
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.4rem;
}
.share-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  margin-right: 0.3rem;
}

.anti-scam-banner {
  background: linear-gradient(90deg, rgba(239,68,68,0.12), rgba(245,158,11,0.08));
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
body.light-mode .anti-scam-banner {
  color: #b91c1c;
  background: rgba(239,68,68,0.08);
}

.owner-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.8rem;
}
.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--accent);
}
.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.teams-style .console-tabs {
  background: var(--bg);
}

/* ---------- LOGO + HERO PRETORIA ---------- */
.brand-logo {
  height: 36px;
  width: auto;
  border-radius: 6px;
  object-fit: contain;
  display: block;
}
.brand-text-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
@media (max-width: 520px) {
  .brand-text-wrap { display: none; }
  .brand-logo { height: 32px; }
}

.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
}
.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(11, 13, 16, 0.92) 0%,
    rgba(11, 13, 16, 0.78) 45%,
    rgba(11, 13, 16, 0.55) 100%
  );
}
.hero-content {
  position: relative;
  z-index: 2;
}
body.light-mode .hero-overlay {
  background: linear-gradient(
    105deg,
    rgba(244, 245, 247, 0.94) 0%,
    rgba(244, 245, 247, 0.82) 50%,
    rgba(244, 245, 247, 0.6) 100%
  );
}

/* ---------- BADGE + TRUST STRIP ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}
.badge.hidden { display: none !important; }

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.4rem 1.25rem;
  border-bottom: 1px solid var(--border);
  justify-content: center;
}
.trust-item {
  text-align: center;
  min-width: 90px;
}
.trust-num {
  display: block;
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}
.trust-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.verified-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--success);
  background: var(--success-soft);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-left: 0.35rem;
}

/* ---------- HOW IT WORKS + TRUST CENTRE ---------- */
.section-block {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}
.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.2rem;
}
@media (max-width: 700px) {
  .how-grid { grid-template-columns: 1fr; }
}
.how-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
}
.how-col h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}
.how-steps {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}
.how-note {
  margin-top: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  max-width: 60ch;
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}
.trust-card {
  display: flex;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.trust-icon {
  color: var(--success);
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.trust-card strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
.trust-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}
.card-status {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-top: 0.35rem;
}
.card-status.pending { color: #f59e0b; }
.card-status.live { color: var(--success); }
