/**
 * Utilities CSS - Helper Classes for SOLVUH Platform
 * ===================================================
 * Utility-first CSS classes for common styling needs.
 */

/* ============================================================================
   DISPLAY & VISIBILITY
   ============================================================================ */

.hidden { display: none !important; }
.invisible { visibility: hidden; }
.visible { visibility: visible; }

.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* ============================================================================
   FLEXBOX
   ============================================================================ */

.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-row-reverse { flex-direction: row-reverse; }
.flex-col-reverse { flex-direction: column-reverse; }

.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.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; }
.justify-evenly { justify-content: space-evenly; }

.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-none { flex: none; }
.flex-grow { flex-grow: 1; }
.flex-grow-0 { flex-grow: 0; }
.flex-shrink { flex-shrink: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* Gap utilities */
.gap-0 { gap: 0; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

/* ============================================================================
   SPACING (Margin & Padding)
   ============================================================================ */

/* Margin all sides */
.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }
.m-auto { margin: auto; }

/* Margin X (left + right) */
.mx-0 { margin-left: 0; margin-right: 0; }
.mx-1 { margin-left: 4px; margin-right: 4px; }
.mx-2 { margin-left: 8px; margin-right: 8px; }
.mx-3 { margin-left: 12px; margin-right: 12px; }
.mx-4 { margin-left: 16px; margin-right: 16px; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Margin Y (top + bottom) */
.my-0 { margin-top: 0; margin-bottom: 0; }
.my-1 { margin-top: 4px; margin-bottom: 4px; }
.my-2 { margin-top: 8px; margin-bottom: 8px; }
.my-3 { margin-top: 12px; margin-bottom: 12px; }
.my-4 { margin-top: 16px; margin-bottom: 16px; }
.my-auto { margin-top: auto; margin-bottom: auto; }

/* Margin individual sides */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-auto { margin-top: auto; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-auto { margin-bottom: auto; }

.ml-0 { margin-left: 0; }
.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }
.ml-3 { margin-left: 12px; }
.ml-4 { margin-left: 16px; }
.ml-auto { margin-left: auto; }

.mr-0 { margin-right: 0; }
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }
.mr-3 { margin-right: 12px; }
.mr-4 { margin-right: 16px; }
.mr-auto { margin-right: auto; }

/* Padding all sides */
.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }

/* Padding X (left + right) */
.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: 4px; padding-right: 4px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-6 { padding-left: 24px; padding-right: 24px; }

/* Padding Y (top + bottom) */
.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }

/* Padding individual sides */
.pt-0 { padding-top: 0; }
.pt-2 { padding-top: 8px; }
.pt-4 { padding-top: 16px; }
.pb-0 { padding-bottom: 0; }
.pb-2 { padding-bottom: 8px; }
.pb-4 { padding-bottom: 16px; }
.pl-0 { padding-left: 0; }
.pl-2 { padding-left: 8px; }
.pl-4 { padding-left: 16px; }
.pr-0 { padding-right: 0; }
.pr-2 { padding-right: 8px; }
.pr-4 { padding-right: 16px; }

/* ============================================================================
   SIZING
   ============================================================================ */

.w-full { width: 100%; }
.w-auto { width: auto; }
.w-screen { width: 100vw; }
.min-w-0 { min-width: 0; }
.max-w-full { max-width: 100%; }

.h-full { height: 100%; }
.h-auto { height: auto; }
.h-screen { height: 100vh; }
.min-h-0 { min-height: 0; }
.min-h-screen { min-height: 100vh; }

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

/* Font sizes */
.text-xs { font-size: 12px; line-height: 1.4; }
.text-sm { font-size: 14px; line-height: 1.5; }
.text-base { font-size: 16px; line-height: 1.6; }
.text-lg { font-size: 18px; line-height: 1.5; }
.text-xl { font-size: 20px; line-height: 1.4; }
.text-2xl { font-size: 24px; line-height: 1.3; }
.text-3xl { font-size: 30px; line-height: 1.2; }

/* Font weights */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

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

/* Text colors */
.text-primary { color: var(--text-primary, #ffffff); }
.text-secondary { color: var(--text-secondary, #888888); }
.text-muted { color: var(--text-muted, #666666); }
.text-accent { color: var(--accent, #3b82f6); }
.text-success { color: var(--success, #10b981); }
.text-warning { color: var(--warning, #f59e0b); }
.text-error { color: var(--error, #ef4444); }

/* Text utilities */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.whitespace-nowrap { white-space: nowrap; }
.whitespace-pre { white-space: pre; }
.whitespace-pre-wrap { white-space: pre-wrap; }

.break-words { word-wrap: break-word; }
.break-all { word-break: break-all; }

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

.underline { text-decoration: underline; }
.no-underline { text-decoration: none; }

/* ============================================================================
   BACKGROUNDS & BORDERS
   ============================================================================ */

/* Background colors */
.bg-primary { background-color: var(--bg-primary, #121212); }
.bg-secondary { background-color: var(--bg-secondary, #1e1e1e); }
.bg-elevated { background-color: var(--bg-elevated, #2a2a2a); }
.bg-accent { background-color: var(--accent, #3b82f6); }
.bg-success { background-color: var(--success, #10b981); }
.bg-warning { background-color: var(--warning, #f59e0b); }
.bg-error { background-color: var(--error, #ef4444); }
.bg-transparent { background-color: transparent; }

/* Border radius */
.rounded-none { border-radius: 0; }
.rounded-sm { border-radius: 4px; }
.rounded { border-radius: 6px; }
.rounded-md { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.rounded-xl { border-radius: 16px; }
.rounded-full { border-radius: 9999px; }

/* Borders */
.border { border: 1px solid var(--border-color, #333); }
.border-0 { border: 0; }
.border-t { border-top: 1px solid var(--border-color, #333); }
.border-b { border-bottom: 1px solid var(--border-color, #333); }
.border-l { border-left: 1px solid var(--border-color, #333); }
.border-r { border-right: 1px solid var(--border-color, #333); }

.border-accent { border-color: var(--accent, #3b82f6); }
.border-success { border-color: var(--success, #10b981); }
.border-warning { border-color: var(--warning, #f59e0b); }
.border-error { border-color: var(--error, #ef4444); }

/* ============================================================================
   POSITIONING
   ============================================================================ */

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.static { position: static; }

.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

/* ============================================================================
   OVERFLOW
   ============================================================================ */

.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-visible { overflow: visible; }
.overflow-scroll { overflow: scroll; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-hidden { overflow-y: hidden; }

/* ============================================================================
   CURSOR & INTERACTION
   ============================================================================ */

.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-wait { cursor: wait; }
.cursor-grab { cursor: grab; }

.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

.select-none { user-select: none; }
.select-text { user-select: text; }
.select-all { user-select: all; }

/* ============================================================================
   OPACITY & SHADOWS
   ============================================================================ */

.opacity-0 { opacity: 0; }
.opacity-25 { opacity: 0.25; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

.shadow-none { box-shadow: none; }
.shadow-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.shadow { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }
.shadow-md { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); }
.shadow-lg { box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4); }
.shadow-xl { box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5); }

/* ============================================================================
   TRANSITIONS
   ============================================================================ */

.transition-none { transition: none; }
.transition-all { transition: all 0.2s ease; }
.transition-colors { transition: color 0.2s, background-color 0.2s, border-color 0.2s; }
.transition-opacity { transition: opacity 0.2s ease; }
.transition-transform { transition: transform 0.2s ease; }

.duration-100 { transition-duration: 100ms; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }
.duration-500 { transition-duration: 500ms; }

/* ============================================================================
   TRANSFORMS
   ============================================================================ */

.rotate-0 { transform: rotate(0deg); }
.rotate-45 { transform: rotate(45deg); }
.rotate-90 { transform: rotate(90deg); }
.rotate-180 { transform: rotate(180deg); }
.-rotate-90 { transform: rotate(-90deg); }

.scale-0 { transform: scale(0); }
.scale-50 { transform: scale(0.5); }
.scale-100 { transform: scale(1); }
.scale-110 { transform: scale(1.1); }
.scale-125 { transform: scale(1.25); }

/* ============================================================================
   Z-INDEX
   ============================================================================ */

.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-auto { z-index: auto; }

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

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

.not-sr-only {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.focus-visible:focus-visible {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: 2px;
}

/* ============================================================================
   RESPONSIVE UTILITIES
   ============================================================================ */

@media (max-width: 640px) {
  .sm\:hidden { display: none; }
  .sm\:block { display: block; }
  .sm\:flex { display: flex; }
  .sm\:flex-col { flex-direction: column; }
  .sm\:text-sm { font-size: 14px; }
  .sm\:p-2 { padding: 8px; }
  .sm\:p-3 { padding: 12px; }
}

@media (min-width: 768px) {
  .md\:hidden { display: none; }
  .md\:block { display: block; }
  .md\:flex { display: flex; }
  .md\:flex-row { flex-direction: row; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .lg\:hidden { display: none; }
  .lg\:block { display: block; }
  .lg\:flex { display: flex; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}
