/* Utility classes — atomic style helpers for the patterns we found in views/.
   Use these instead of inline style="..." attributes. Keeps views readable
   and the design system enforceable.

   Conventions:
     - Spacing: xs=4 sm=8 md=12 lg=16 xl=20 2xl=24 3xl=32 (matches --space-*)
     - Text:    xs=12 sm=13 md=14 lg=16 xl=18 2xl=22 3xl=28
*/

/* ─── Text size + weight ────────────────────────────────────────────────── */
.text-xs  { font-size: 12px; }
.text-sm  { font-size: 13px; }
.text-md  { font-size: 14px; }
.text-lg  { font-size: 16px; }
.text-xl  { font-size: 18px; }
.text-2xl { font-size: 22px; }
.text-3xl { font-size: 28px; }

.text-thin     { font-weight: 300; }
.text-normal   { font-weight: 400; }
.text-medium   { font-weight: 500; }
.text-semibold { font-weight: 600; }
.text-bold     { font-weight: 700; }

/* ─── Semantic text color ───────────────────────────────────────────────── */
.text-primary       { color: var(--text-primary); }
.text-regular       { color: var(--text-regular); }
.text-muted,
.text-secondary     { color: var(--text-secondary); }
.text-placeholder   { color: var(--text-placeholder); }
.text-success       { color: var(--ea-success); }
.text-warning       { color: var(--ea-warning); }
.text-danger        { color: var(--ea-danger); }
.text-info          { color: var(--ea-info); }
.text-link          { color: var(--ea-primary); }

/* ─── Text alignment + truncation ───────────────────────────────────────── */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.text-mono {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.text-nowrap { white-space: nowrap; }

/* ─── Padding ───────────────────────────────────────────────────────────── */
.p-0  { padding: 0; }
.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.px-xs { padding-left: var(--space-xs); padding-right: var(--space-xs); }
.px-sm { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-lg { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.px-xl { padding-left: var(--space-xl); padding-right: var(--space-xl); }

.py-xs { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }
.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-xl { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }

/* ─── Margin ────────────────────────────────────────────────────────────── */
.m-0  { margin: 0; }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ─── Flex helpers (cover ~80% of inline display:flex; gap: Xpx cases) ──── */
.flex          { display: flex; }
.inline-flex   { display: inline-flex; }
.flex-col      { flex-direction: column; }
.flex-row      { flex-direction: row; }
.flex-wrap     { flex-wrap: wrap; }
.flex-1        { flex: 1; min-width: 0; }
.flex-shrink-0 { flex-shrink: 0; }

.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.items-stretch { align-items: stretch; }

.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around  { justify-content: space-around; }

.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* ─── Visibility ────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.invisible { visibility: hidden; }

/* ─── Cursor / interaction ─────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }
.select-none { user-select: none; }

/* ─── Border helpers ────────────────────────────────────────────────────── */
.border        { border: 1px solid var(--border-base); }
.border-light  { border: 1px solid var(--border-light); }
.border-lighter{ border: 1px solid var(--border-lighter); }
.border-t      { border-top: 1px solid var(--border-lighter); }
.border-b      { border-bottom: 1px solid var(--border-lighter); }

.rounded    { border-radius: var(--radius-base); }
.rounded-sm { border-radius: var(--radius-small); }
.rounded-lg { border-radius: var(--radius-large); }
.rounded-full { border-radius: 9999px; }

/* ─── Width / height ────────────────────────────────────────────────────── */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-w-0 { min-width: 0; }

/* ─── Common backgrounds ────────────────────────────────────────────────── */
.bg-card    { background: var(--card-bg); }
.bg-content { background: var(--content-bg); }
.bg-muted   { background: var(--border-extra-light); }
