/**
 * GLASSTERMINAL DESIGN SYSTEM
 * utilities.css - Helper Classes
 *
 * Minimal utility classes for quick styling.
 * Use sparingly - prefer semantic CSS.
 */

/* ============================================
   BACKGROUND COLORS
   ============================================ */

.bg-deep { background-color: var(--color-bg-deep); }
.bg-base { background-color: var(--color-bg-base); }
.bg-elevated { background-color: var(--color-bg-elevated); }
.bg-surface { background-color: var(--color-bg-surface); }
.bg-overlay { background-color: var(--color-bg-overlay); }

.bg-accent { background-color: var(--color-accent-subtle); }
.bg-success { background-color: var(--color-success-subtle); }
.bg-warning { background-color: var(--color-warning-subtle); }
.bg-error { background-color: var(--color-error-subtle); }
.bg-info { background-color: var(--color-info-subtle); }

.bg-transparent { background-color: transparent; }

/* ============================================
   BORDER
   ============================================ */

.border { border: 1px solid var(--color-border-light); }
.border-0 { border: none; }
.border-t { border-top: 1px solid var(--color-border-light); }
.border-r { border-right: 1px solid var(--color-border-light); }
.border-b { border-bottom: 1px solid var(--color-border-light); }
.border-l { border-left: 1px solid var(--color-border-light); }

.border-accent { border-color: var(--color-accent); }
.border-success { border-color: var(--color-success); }
.border-warning { border-color: var(--color-warning); }
.border-error { border-color: var(--color-error); }

.rounded-none { border-radius: var(--radius-none); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ============================================
   SHADOWS
   ============================================ */

.shadow-none { box-shadow: none; }
.shadow-sm { box-shadow: var(--glass-shadow-sm); }
.shadow { box-shadow: var(--glass-shadow-md); }
.shadow-lg { box-shadow: var(--glass-shadow-lg); }
.shadow-inset { box-shadow: var(--glass-shadow-inset); }

.glow-accent { box-shadow: var(--glow-accent); }
.glow-success { box-shadow: var(--glow-success); }
.glow-error { box-shadow: var(--glow-error); }

/* ============================================
   OPACITY
   ============================================ */

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

/* ============================================
   CURSOR
   ============================================ */

.cursor-auto { cursor: auto; }
.cursor-default { cursor: default; }
.cursor-pointer { cursor: pointer; }
.cursor-wait { cursor: wait; }
.cursor-text { cursor: text; }
.cursor-move { cursor: move; }
.cursor-not-allowed { cursor: not-allowed; }

/* ============================================
   POINTER EVENTS
   ============================================ */

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

/* ============================================
   USER SELECT
   ============================================ */

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

/* ============================================
   WIDTH & HEIGHT
   ============================================ */

.w-full { width: 100%; }
.w-screen { width: 100vw; }
.w-auto { width: auto; }
.w-fit { width: fit-content; }

.min-w-0 { min-width: 0; }
.min-w-full { min-width: 100%; }

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

.h-full { height: 100%; }
.h-screen { height: 100vh; }
.h-auto { height: auto; }
.h-fit { height: fit-content; }

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

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

.transition-none { transition: none; }
.transition-all { transition: all var(--transition-normal) var(--ease-out); }
.transition-colors {
  transition:
    color var(--transition-fast) var(--ease-out),
    background-color var(--transition-fast) var(--ease-out),
    border-color var(--transition-fast) var(--ease-out);
}
.transition-opacity { transition: opacity var(--transition-fast) var(--ease-out); }
.transition-transform { transition: transform var(--transition-fast) var(--ease-out); }

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

.scale-95 { transform: scale(0.95); }
.scale-100 { transform: scale(1); }
.scale-105 { transform: scale(1.05); }
.scale-110 { transform: scale(1.1); }

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

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

/* ============================================
   ANIMATION
   ============================================ */

.animate-none { animation: none; }

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-ping {
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-bounce {
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(-25%);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s var(--ease-out);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-slide-up {
  animation: slideUp 0.3s var(--ease-out);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px var(--color-accent-muted);
  }
  50% {
    box-shadow: 0 0 20px var(--color-accent-muted), 0 0 30px var(--color-accent-subtle);
  }
}

/* ============================================
   INTERACTION STATES
   ============================================ */

.hover\:scale-105:hover { transform: scale(1.05); }
.hover\:glow:hover { box-shadow: var(--glow-accent); }
.hover\:opacity-80:hover { opacity: 0.8; }

.active\:scale-95:active { transform: scale(0.95); }

.disabled\:opacity-50:disabled { opacity: 0.5; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }

/* ============================================
   FOCUS STATES
   ============================================ */

.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.focus-glow:focus {
  outline: none;
  box-shadow: var(--glow-accent);
}

/* ============================================
   SCROLL
   ============================================ */

.scroll-smooth { scroll-behavior: smooth; }
.scroll-auto { scroll-behavior: auto; }

.snap-start { scroll-snap-align: start; }
.snap-center { scroll-snap-align: center; }
.snap-end { scroll-snap-align: end; }

.snap-x { scroll-snap-type: x mandatory; }
.snap-y { scroll-snap-type: y mandatory; }

/* ============================================
   PRINT
   ============================================ */

@media print {
  .print\:hidden { display: none; }
  .print\:block { display: block; }

  .print\:bg-white { background: white; }
  .print\:text-black { color: black; }
}

/* ============================================
   SCREEN READER
   ============================================ */

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

/* ============================================
   FORCED COLORS (HIGH CONTRAST MODE)
   ============================================ */

@media (forced-colors: active) {
  .forced-colors\:border {
    border: 1px solid CanvasText;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .motion-safe\:animate-spin { animation: none; }
  .motion-safe\:animate-pulse { animation: none; }
  .motion-safe\:animate-bounce { animation: none; }
  .motion-safe\:transition-all { transition: none; }
}

/* ============================================
   TRUNCATION
   ============================================ */

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

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

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

/* ============================================
   MISC UTILITIES
   ============================================ */

.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }
.object-fill { object-fit: fill; }

.list-none { list-style: none; }
.list-disc { list-style-type: disc; }
.list-decimal { list-style-type: decimal; }

/* Debug outline */
.debug * {
  outline: 1px solid rgba(255, 0, 0, 0.2);
}
