/**
 * KTG Connect — Utility Classes
 * ============================================================
 * Minimal set of layout and spacing utilities.
 * Keep this lean — components own their own styles.
 */

/* ── Display ──────────────────────────────────────────────────────────── */
.d-none    { display: none !important; }
.d-block   { display: block; }
.d-flex    { display: flex; }
.d-grid    { display: grid; }
.d-inline  { display: inline; }
.d-inline-flex { display: inline-flex; }

/* ── Flex ─────────────────────────────────────────────────────────────── */
.flex-row     { flex-direction: row; }
.flex-col      { flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.flex-nowrap  { flex-wrap: nowrap; }
.flex-1       { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.items-start  { align-items: flex-start; }
.items-center { align-items: center; }
.items-end    { align-items: flex-end; }
.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.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-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

/* ── Text ─────────────────────────────────────────────────────────────── */
.text-xs      { font-size: var(--font-size-xs); }
.text-sm      { font-size: var(--font-size-sm); }
.text-base    { font-size: var(--font-size-base); }
.text-lg      { font-size: var(--font-size-lg); }
.text-xl      { font-size: var(--font-size-xl); }
.text-2xl     { font-size: var(--font-size-2xl); }
.text-3xl     { font-size: var(--font-size-3xl); }
.text-left    { text-align: left; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-primary   { color: var(--color-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted     { color: var(--color-text-muted); }
.text-error     { color: var(--color-error); }
.font-medium    { font-weight: var(--font-weight-medium); }
.font-semibold  { font-weight: var(--font-weight-semibold); }
.font-bold      { font-weight: var(--font-weight-bold); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Spacing ──────────────────────────────────────────────────────────── */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

/* ── Sizing ───────────────────────────────────────────────────────────── */
.w-full   { width: 100%; }
.h-full   { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* ── Misc ─────────────────────────────────────────────────────────────── */
.rounded    { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }
.shadow-sm  { box-shadow: var(--shadow-sm); }
.shadow-md  { box-shadow: var(--shadow-md); }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

/* ── Page loading overlay ─────────────────────────────────────────────── */

.page-loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--color-primary-15);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Fade transition (used by router between pages) ──────────────────── */
.page-enter {
  animation: pageFadeIn var(--transition-slow) ease forwards;
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}