/* =========================
   APP.CSS (DEDUPED / CANON)
   ========================= */

/* ----- Theme tokens (ONE source of truth) ----- */
:root {
  --bg: #0b0d12;
  --panel: #11141b;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e5e7eb;
  --muted: #a5a9b5;
  --brand: #5b8cff;

  --card: #0f0f0f;
  --card-border: #2f2f2f;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* =========================
   Layout helpers
   ========================= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem;
}
.container.narrow { max-width: 720px; }

/* Global grid utility (2-col default, stacks on mobile) */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.span-2 { grid-column: 1 / -1; }

.ps-grid {
  display: grid;
  gap: 0.75rem;
}

.ps-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.ps-name { margin: 0; }

.muted { color: var(--muted); }
.prewrap { white-space: pre-wrap; }

.chips-wrap {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.hr { height: 1px; background: var(--border); }

.stack-sm > * + * { margin-top: 0.4rem; }

.pad-std { padding: 1.25rem; }
.pad-tight { padding: 0.75rem; }
.mt-std { margin-top: 1rem; }

.w-100 { width: 100%; }
.inline { display: flex; align-items: center; gap: 0.5rem; }

.btn-row-inline {
  display: grid;
  grid-auto-flow: column;
  gap: 0.5rem;
  width: max-content;
}

/* =========================
   Cards
   ========================= */
.ps-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.03)),
    var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: 16px;
  padding: 1rem;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 6px 14px rgba(0, 0, 0, 0.25);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.ps-card:hover {
  border-color: #4a4f59;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.02)),
    #121316;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 8px 18px rgba(0, 0, 0, 0.3);
}

/* =========================
   Forms
   ========================= */
/* Inputs (but NOT checkboxes) */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 8px;
  border: 1px solid #2d2d2d;
  border-radius: 8px;
  background: #0f0f14;
  color: #eaeaea;
}

.inline-input {
  width: auto;
  min-width: 220px;
}

/* =========================
   Buttons (ONE definition)
   ========================= */
.btn {
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  font-weight: 700;
  display: inline-block;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.02s ease;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }

.btn-secondary {
  background: #262b35;
  color: #eaeaea;
}
.btn-danger {
  background: #c0392b;
  color: #fff;
}
.btn-sm { padding: 6px 10px; }

.btn-outline {
  display: inline-block;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.8rem;
  color: var(--text);
  background: transparent;
  font-weight: 600;
  text-decoration: none;
}

/* =========================
   Skills editor (kept)
   ========================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px;
}
.skill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #444;
  border-radius: 12px;
  background: #121622;
}
.skill-name {
  font-weight: 600;
  margin: 0;
  flex: 1 1 auto;
  line-height: 1.2;
  user-select: none;
}
.skill-level { flex: 0 0 140px; }

/* Make checkboxes normal (Safari-friendly) */
.skills-grid .skill-check {
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 2px 0 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-appearance: checkbox !important;
  appearance: checkbox !important;
}

/* Optional: highlight selected skill rows */
.skill-row:has(.skill-check:checked) {
  border-color: #0ea5e9;
  background: #0f1e2a;
}

/* =========================
   Message badge (ONE)
   ========================= */
.badge {
  display: inline-block;
  min-width: 1.1rem;
  height: 1.1rem;
  line-height: 1.1rem;
  font-size: 0.72rem;
  text-align: center;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  margin-left: 0.15rem;
  vertical-align: middle;
  transform: scale(0);
  transform-origin: center;
  transition: transform 160ms ease;
}
.badge.show { transform: scale(1); }

/* =========================
   Header nav (works for either class set)
   ========================= */
.nav,
.sh-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item { display: flex; align-items: center; gap: 0.4rem; }
.nav-item + .nav-item::before { content: none !important; }

.sh-header {
  background: #0c0e13;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sh-link { color: #a5a9b5; font-weight: 600; }
.sh-link:hover { color: #cbd3e1; }

/* =========================
   Sticky footer layout (global)
   ========================= */
.ps-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.ps-main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }
