/**
 * Lagos Konect — Utility Classes
 * ============================================================
 * Minimal, single-purpose utility layer.
 * These classes are composable building blocks — they are NOT
 * meant to replace component styles. Keep this file lean:
 * if a pattern appears more than twice in a component, give it
 * a proper class in that component's CSS file.
 *
 * All values reference tokens from tokens.css.
 *
 * Sections:
 *   1.  Display
 *   2.  Flexbox
 *   3.  Gap
 *   4.  Text — size
 *   5.  Text — alignment
 *   6.  Text — colour
 *   7.  Text — weight & truncation
 *   8.  Spacing — margin
 *   9.  Spacing — padding
 *   10. Sizing
 *   11. Visual — border radius & shadow
 *   12. Overflow & positioning
 *   13. Interaction
 *   14. Accessibility
 *   15. Page loading
 *   16. Page transition
 */

/* ═══════════════════════════════════════════════════════════════════════════
   1. 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; }

/* ═══════════════════════════════════════════════════════════════════════════
   2. FLEXBOX
   ═══════════════════════════════════════════════════════════════════════ */

.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; }

/* ═══════════════════════════════════════════════════════════════════════════
   3. GAP
   ═══════════════════════════════════════════════════════════════════════ */

.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); }

/* ═══════════════════════════════════════════════════════════════════════════
   4. TEXT — SIZE
   ═══════════════════════════════════════════════════════════════════════ */

.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);  }

/* ═══════════════════════════════════════════════════════════════════════════
   5. TEXT — ALIGNMENT
   ═══════════════════════════════════════════════════════════════════════ */

.text-left   { text-align: left;   }
.text-center { text-align: center; }
.text-right  { text-align: right;  }

/* ═══════════════════════════════════════════════════════════════════════════
   6. TEXT — COLOUR
   ═══════════════════════════════════════════════════════════════════════ */

.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);          }
.text-success   { color: var(--color-success);        }
.text-warning   { color: var(--color-warning);        }

/* ═══════════════════════════════════════════════════════════════════════════
   7. TEXT — WEIGHT & TRUNCATION
   ═══════════════════════════════════════════════════════════════════════ */

.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;
}

/* ═══════════════════════════════════════════════════════════════════════════
   8. SPACING — MARGIN
   ═══════════════════════════════════════════════════════════════════════ */

.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; }

/* ═══════════════════════════════════════════════════════════════════════════
   9. SPACING — PADDING
   ═══════════════════════════════════════════════════════════════════════ */

.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); }

/* ═══════════════════════════════════════════════════════════════════════════
   10. SIZING
   ═══════════════════════════════════════════════════════════════════════ */

.w-full       { width: 100%;     }
.h-full       { height: 100%;    }
.min-h-screen { min-height: 100vh; }

/* ═══════════════════════════════════════════════════════════════════════════
   11. VISUAL — BORDER RADIUS & SHADOW
   ═══════════════════════════════════════════════════════════════════════ */

.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); }

/* ═══════════════════════════════════════════════════════════════════════════
   12. OVERFLOW & POSITIONING
   ═══════════════════════════════════════════════════════════════════════ */

.overflow-hidden { overflow: hidden;   }
.relative        { position: relative; }
.absolute        { position: absolute; }

/* ═══════════════════════════════════════════════════════════════════════════
   13. INTERACTION
   ═══════════════════════════════════════════════════════════════════════ */

.cursor-pointer { cursor: pointer;   }
.select-none    { user-select: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   14. ACCESSIBILITY
   Visually hidden but announced by screen readers.
   Use for icon-only buttons, skip links, etc.
   ═══════════════════════════════════════════════════════════════════════ */

.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;
}

/* ═══════════════════════════════════════════════════════════════════════════
   15. PAGE LOADING
   Spinner displayed by setPageLoading() while async content resolves.
   ═══════════════════════════════════════════════════════════════════════ */

.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: adm-spin 0.7s linear infinite;
}

@keyframes adm-spin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   16. PAGE TRANSITION
   Applied to #app by the router's afterEach hook on every navigation.
   Provides a subtle fade-and-rise to smooth the content swap.
   ═══════════════════════════════════════════════════════════════════════ */

.page-enter {
  animation: adm-page-fade-in var(--transition-slow) ease forwards;
}

@keyframes adm-page-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}