/* File: css/utilities.css
   Purpose: Utility classes for NikaTS V2 UI.
*/

/* ── Display ── */
.hidden { display: none !important; }
.block  { display: block; }
.flex   { display: flex; }
.grid   { display: grid; }
.inline { display: inline; }
.inline-flex { display: inline-flex; }
.contents { display: contents; }

/* ── Text ── */
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md   { font-size: var(--text-md); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }

.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }
.text-danger    { color: var(--color-danger); }
.text-brand     { color: var(--brand-primary); }
.text-long      { color: var(--color-long); }
.text-short     { color: var(--color-short); }

/* Tailwind-compat color classes (used in legacy rendering) */
.text-green-400 { color: #4ade80; }
.text-red-400   { color: #f87171; }
.text-gray-300  { color: #d1d5db; }
.text-gray-400  { color: #9ca3af; }
.text-gray-500  { color: #6b7280; }
.text-gray-200  { color: #e5e7eb; }
.text-white     { color: #fff; }

/* Muted helper (standalone, used outside .text-muted context) */
.muted { color: var(--text-muted); }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }

.tabular-nums { font-variant-numeric: tabular-nums; }

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

.nowrap { white-space: nowrap; }
.break-word { word-break: break-word; }

/* ── Spacing ── */
.m-0  { margin: 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-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); }

.p-0  { padding: 0; }
.p-2  { padding: var(--space-2); }
.p-3  { padding: var(--space-3); }
.p-4  { padding: var(--space-4); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }

/* ── Flex ── */
.flex-col     { flex-direction: column; }
.flex-row     { flex-direction: row; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }
.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-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.justify-start   { justify-content: flex-start; }

.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); }

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

/* ── Overflow ── */
.overflow-auto   { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* ── Position ── */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky   { position: sticky; }

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

/* ── Opacity ── */
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* ── Borders ── */
.border-b { border-bottom: 1px solid var(--border-subtle); }
.border-t { border-top: 1px solid var(--border-subtle); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* ── Screen reader only ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Shimmer effect ── */
.shimmer {
  height: 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: nts-shimmer 1.2s ease-in-out infinite;
}

@keyframes nts-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
