/**
 * css/drafter.css
 * Styles specific to the drafter self-check page.
 * Reuses variables from base.css.
 * Depends on: base.css, layout.css (for project-bar, app-root shell)
 */

'use strict';

/* ─── DRAFTER SHELL ──────────────────────────────────────────────────────────── */

.drafter-root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--color-bg);
}

/* ─── HEADER ─────────────────────────────────────────────────────────────────── */

.drafter-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: var(--color-text);
  color: #fff;
  z-index: var(--z-sticky);
}

.drafter-header__brand h1 {
  font-size: var(--text-base);
  font-weight: var(--weight-extrabold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: var(--leading-tight);
}

.drafter-header__brand p {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: #888;
  margin-top: 0.1rem;
}

.drafter-header__center {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex: 1;
  justify-content: center;
}

.drafter-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}


/* ─── PROGRESS BAR ───────────────────────────────────────────────────────────── */

.drafter-progress {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.drafter-progress__track {
  width: 160px;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  overflow: hidden;
  flex-shrink: 0;
}

.drafter-progress__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--color-yes);
  transition: width 0.3s ease, background 0.3s ease;
}

.drafter-progress__fill--partial { background: var(--color-warning); }

.drafter-progress__text {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: #aaa;
  white-space: nowrap;
}

.drafter-progress__text strong { color: #fff; }


/* ─── CONTENT AREA ───────────────────────────────────────────────────────────── */

.drafter-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5) var(--space-8);
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}


/* ─── PROJECT BAR ────────────────────────────────────────────────────────────── */

.drafter-project-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.drafter-project-bar__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.drafter-project-bar__input {
  flex: 1;
  min-width: 120px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-base);
}
.drafter-project-bar__input:focus { border-color: var(--color-accent); }


/* ─── SHEET CARD ─────────────────────────────────────────────────────────────── */

.drafter-sheet {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.drafter-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}
.drafter-sheet__header:hover { background: var(--color-surface-hover); }

.drafter-sheet__header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.drafter-sheet__abbr {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.05em;
  background: var(--color-text);
  color: #fff;
  padding: 0.18rem 0.45rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.drafter-sheet__name {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
}

.drafter-sheet__header-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Per-sheet progress badge */
.drafter-sheet__badge {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text-muted);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background var(--transition-base), color var(--transition-base);
}

.drafter-sheet__badge--done {
  background: rgba(39, 174, 96, 0.12);
  color: var(--color-yes);
}

.drafter-sheet__chevron {
  font-size: 0.62rem;
  color: var(--color-text-muted);
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.drafter-sheet.is-open .drafter-sheet__chevron {
  transform: rotate(180deg);
}

.drafter-sheet__body {
  display: none;
  border-top: 1px solid var(--color-border);
}

.drafter-sheet.is-open .drafter-sheet__body {
  display: block;
}


/* ─── ITEM ROW ───────────────────────────────────────────────────────────────── */

.drafter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid #f0ede8;
  transition: background var(--transition-fast);
}

.drafter-item:last-child { border-bottom: none; }
.drafter-item:hover      { background: var(--color-surface-hover); }

.drafter-item.is-done    { background: #f4fdf6; }
.drafter-item.is-na      { background: #fafaf8; opacity: 0.6; }

.drafter-item__label {
  flex: 1;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text);
}

.drafter-item.is-done .drafter-item__label {
  text-decoration: line-through;
  color: var(--color-text-muted);
}

.drafter-item.is-na .drafter-item__label {
  color: var(--color-text-muted);
}

/* ✓ / N/A button group */
.drafter-item__controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.drafter-btn {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: var(--weight-medium);
  padding: 0.28rem 0.6rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  background: #fff;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1;
}

.drafter-btn:hover { border-color: var(--color-border-strong); color: var(--color-text); }

.drafter-btn--check.is-active  { background: var(--color-yes); border-color: var(--color-yes); color: #fff; }
.drafter-btn--na.is-active     { background: var(--color-na);  border-color: var(--color-na);  color: #fff; }
