/* ============================================================
   styles.css  –  Home Workout App
   Theme: dark industrial / utility aesthetic
   ============================================================ */

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

:root {
  --bg:          #0f1117;
  --surface:     #181c26;
  --surface2:    #1f2535;
  --border:      #2a3148;
  --accent:      #f97316;   /* orange */
  --accent2:     #3b82f6;   /* blue  */
  --green:       #22c55e;
  --red:         #ef4444;
  --text:        #e2e8f0;
  --text-muted:  #64748b;
  --font-head:   'Barlow Condensed', sans-serif;
  --font-body:   'Barlow', sans-serif;
  --radius:      10px;
  --shadow:      0 4px 24px rgba(0,0,0,.45);
}

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

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
}

/* ── Layout ──────────────────────────────────────────────── */
.page-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 12px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.card h2 {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.card h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── Stat boxes ──────────────────────────────────────────── */
.stat-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  text-align: center;
  min-width: 110px;
  flex: 1;
}

.stat-box .label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-box .value {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

/* ── XP Bar ──────────────────────────────────────────────── */
.xp-bar-wrap {
  margin-bottom: 20px;
}

.xp-bar-wrap .bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.xp-bar {
  height: 10px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #fb923c);
  border-radius: 99px;
  transition: width .5s ease;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.form-row .form-group { flex: 1; margin-bottom: 0; }

label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}

input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: .9rem;
  padding: 9px 12px;
  width: 100%;
  outline: none;
  transition: border-color .2s;
}

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

textarea { resize: vertical; min-height: 120px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 6px;
  font-family: var(--font-head);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: filter .15s, transform .1s;
}

.btn:active { transform: scale(.97); }
.btn:hover  { filter: brightness(1.1); }

.btn-primary   { background: var(--accent);  color: #fff; }
.btn-secondary { background: var(--accent2); color: #fff; }
.btn-danger    { background: var(--red);     color: #fff; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-sm { padding: 5px 12px; font-size: .8rem; }

/* ── Slot Grid ───────────────────────────────────────────── */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}

.slot {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--border);
  transition: transform .15s;
}

.slot.filled {
  background: linear-gradient(135deg, #1a2e1a, #162816);
  border-color: var(--green);
  color: var(--green);
}

.slot.filled .xp-val {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 900;
}

.slot.empty {
  background: var(--surface2);
  color: var(--text-muted);
  border-style: dashed;
}

.slot.locked {
  background: rgba(15,17,23,.5);
  color: var(--border);
  opacity: .6;
  font-size: 1.1rem;
}

/* ── Table ───────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

.data-table th {
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-size: .75rem;
  color: var(--text-muted);
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface2); }

.data-table input[type="number"],
.data-table input[type="text"] {
  padding: 5px 8px;
  font-size: .82rem;
}

/* ── Badges / Tags ───────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.badge-orange { background: rgba(249,115,22,.15); color: var(--accent); }
.badge-blue   { background: rgba(59,130,246,.15);  color: var(--accent2); }
.badge-green  { background: rgba(34,197,94,.15);   color: var(--green); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid;
}

.alert-success { background: rgba(34,197,94,.1);  border-color: var(--green); color: var(--green); }
.alert-error   { background: rgba(239,68,68,.1);  border-color: var(--red);   color: var(--red); }

/* ── Nav ─────────────────────────────────────────────────── */
.nav-bar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nav-bar a {
  font-family: var(--font-head);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}

.nav-bar a:hover { color: var(--text); }

/* ── Auth pages ──────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  margin-bottom: 6px;
}

.auth-card .sub {
  color: var(--text-muted);
  font-size: .85rem;
  margin-bottom: 24px;
}

.auth-card a { color: var(--accent2); text-decoration: none; font-size: .85rem; }
.auth-card a:hover { text-decoration: underline; }

/* ── Scrollable table wrapper ────────────────────────────── */
.table-scroll { overflow-x: auto; }

/* ── Responsive tweaks ───────────────────────────────────── */
@media (max-width: 580px) {
  .form-row { flex-direction: column; }
  .stat-row  { flex-direction: column; }
}
