/**
 * KNOMAD Utility Classes
 * Standardized utility classes to replace inline styles
 * Following CSS_DOMAIN_CONTRACT.json standards
 */

/* 
 * LAYOUT UTILITIES
 * Flexbox, positioning, display
 */
.flex {
  display: flex;
}
.inline-flex {
  display: inline-flex;
}
.flex-col {
  display: flex;
  flex-direction: column;
}
.flex-row {
  display: flex;
  flex-direction: row;
}
.flex-1 {
  flex: 1;
}
.items-center {
  align-items: center;
}
.items-start {
  align-items: flex-start;
}
.items-end {
  align-items: flex-end;
}
.justify-between {
  justify-content: space-between;
}
.justify-center {
  justify-content: center;
}
.justify-end {
  justify-content: flex-end;
}
.self-center {
  align-self: center;
}
.relative {
  position: relative;
}
.absolute {
  position: absolute;
}
.hidden {
  display: none;
}
.block {
  display: block;
}
.w-full {
  width: 100%;
}
.min-w-auto {
  min-width: auto;
}

/* 
 * SPACING UTILITIES
 * Padding, margin, gap
 */
.gap-0 {
  gap: 0;
}
.gap-1 {
  gap: var(--space-1);
}
.gap-2 {
  gap: var(--space-2);
}
.gap-3 {
  gap: var(--space-3);
}
.gap-4 {
  gap: var(--space-4);
}
.gap-tight {
  gap: 4px;
} /* Legacy support */
.p-0 {
  padding: 0;
}
.p-1 {
  padding: var(--space-1);
}
.p-2 {
  padding: var(--space-2);
}
.p-3 {
  padding: var(--space-3);
}
.p-4 {
  padding: var(--space-4);
}
.px-1 {
  padding-left: var(--space-1);
  padding-right: var(--space-1);
}
.px-2 {
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}
.px-3 {
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}
.py-1 {
  padding-top: var(--space-1);
  padding-bottom: var(--space-1);
}
.py-2 {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}
.py-3 {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}
.m-0 {
  margin: 0;
}
.m-1 {
  margin: var(--space-1);
}
.m-2 {
  margin: var(--space-2);
}
.m-3 {
  margin: var(--space-3);
}
.m-4 {
  margin: var(--space-4);
}
.mt-0 {
  margin-top: 0;
}
.mt-1 {
  margin-top: var(--space-1);
}
.mt-2 {
  margin-top: var(--space-2);
}
.mt-3 {
  margin-top: var(--space-3);
}
.mt-4 {
  margin-top: var(--space-4);
}
.mb-0 {
  margin-bottom: 0;
}
.mb-1 {
  margin-bottom: var(--space-1);
}
.mb-2 {
  margin-bottom: var(--space-2);
}
.mb-3 {
  margin-bottom: var(--space-3);
}
.mb-4 {
  margin-bottom: var(--space-4);
}

/* 
 * TYPOGRAPHY UTILITIES
 * Text styles, fonts, sizes
 */
.text-xs {
  font-size: var(--fs-xs);
}
.text-sm {
  font-size: var(--fs-sm);
}
.text-md {
  font-size: var(--fs-base);
}
.text-lg {
  font-size: var(--fs-md);
}
.text-xl {
  font-size: var(--fs-lg);
}
.font-mono {
  font-family: var(--font-mono);
}
.font-bold {
  font-weight: bold;
}
.font-semibold {
  font-weight: 600;
}
.font-medium {
  font-weight: 500;
}
.font-normal {
  font-weight: 400;
}
.text-center {
  text-align: center;
}
.uppercase {
  text-transform: uppercase;
}
.leading-tight {
  line-height: var(--line-height-tight);
}
.leading-normal {
  line-height: var(--line-height-base);
}
.leading-loose {
  line-height: var(--line-height-loose);
}
.tracking-wide {
  letter-spacing: 0.05em;
}

/* 
 * COLOR UTILITIES
 * Text colors, backgrounds
 */
.text-primary {
  color: var(--text-primary);
}
.text-secondary {
  color: var(--text-secondary);
}
.text-tertiary {
  color: var(--text-tertiary);
}
.text-muted {
  color: var(--text-muted);
}
.text-disabled {
  color: var(--text-disabled);
}
.text-cyan {
  color: var(--cyan);
}
.text-cyan-90 {
  color: var(--cyan-90);
}
.text-inverse {
  color: var(--text-inverse);
}
.text-success {
  color: var(--success);
}
.text-warning {
  color: var(--warning);
}
.text-error {
  color: var(--error);
}
.bg-transparent {
  background: transparent;
}
.bg-dark-30 {
  background: rgba(0, 0, 0, 0.3);
}
.bg-dark-50 {
  background: rgba(0, 0, 0, 0.5);
}
.bg-surface-1 {
  background: var(--surface-1);
}
.bg-surface-2 {
  background: var(--surface-2);
}
.bg-surface-3 {
  background: var(--surface-3);
}

/* 
 * BORDER UTILITIES
 * Borders, border-radius
 */
.rounded-sm {
  border-radius: var(--radius-sm);
}
.rounded-md {
  border-radius: var(--radius-md);
}
.rounded-lg {
  border-radius: var(--radius-lg);
}
.rounded-full {
  border-radius: var(--radius-full);
}
.border {
  border: 1px solid var(--border-default);
}
.border-cyan {
  border: 1px solid var(--cyan);
}
.border-subtle {
  border: 1px solid var(--border-subtle);
}
.border-0 {
  border: none;
}

/* 
 * INTERACTION UTILITIES
 * Cursors, transitions
 */
.cursor-pointer {
  cursor: pointer;
}
.cursor-default {
  cursor: default;
}
.transition {
  transition: var(--transition-base);
}
.select-none {
  -webkit-user-select: none;
  user-select: none;
}

/* 
 * CUSTOM UTILITIES
 * For specific use cases
 */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
