/* ============================================
   UTILITY CSS - SPACING, FLEX, GRID, TYPOGRAPHY
   ============================================ */

/* SPACING UTILITIES */
.mt-xs { margin-top: 0.5rem; }
.mt-sm { margin-top: 1rem; }
.mt-md { margin-top: 1.5rem; }
.mt-lg { margin-top: 2rem; }
.mt-xl { margin-top: 3rem; }
.mt-2xl { margin-top: 4rem; }

.mb-xs { margin-bottom: 0.5rem; }
.mb-sm { margin-bottom: 1rem; }
.mb-md { margin-bottom: 1.5rem; }
.mb-lg { margin-bottom: 2rem; }
.mb-xl { margin-bottom: 3rem; }
.mb-2xl { margin-bottom: 4rem; }

.pt-xs { padding-top: 0.5rem; }
.pt-sm { padding-top: 1rem; }
.pt-md { padding-top: 1.5rem; }
.pt-lg { padding-top: 2rem; }
.pt-xl { padding-top: 3rem; }
.pt-2xl { padding-top: 4rem; }

.pb-xs { padding-bottom: 0.5rem; }
.pb-sm { padding-bottom: 1rem; }
.pb-md { padding-bottom: 1.5rem; }
.pb-lg { padding-bottom: 2rem; }
.pb-xl { padding-bottom: 3rem; }
.pb-2xl { padding-bottom: 4rem; }

/* FLEX UTILITIES */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.gap-xs { gap: 0.5rem; }
.gap-sm { gap: 1rem; }
.gap-md { gap: 1.5rem; }
.gap-lg { gap: 2rem; }
.gap-xl { gap: 3rem; }

/* GRID UTILITIES */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-12 { grid-template-columns: repeat(12, 1fr); }

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .lg\:grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
}

/* TYPOGRAPHY UTILITIES */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 2rem; }
.text-4xl { font-size: 2.5rem; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 800; }

.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-secondary); }
.text-charcoal { color: var(--color-charcoal); }
.text-white { color: white; }
.text-muted { color: var(--color-text-muted, #555); }

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

.leading-none { line-height: 1; }
.leading-tight { line-height: 1.25; }
.leading-normal { line-height: 1.5; }
.leading-relaxed { line-height: 1.75; }

/* SIZING UTILITIES */
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.h-auto { height: auto; }

/* DISPLAY UTILITIES */
.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }

@media (max-width: 767px) {
  .mobile\:hidden { display: none; }
  .mobile\:block { display: block; }
}

@media (min-width: 768px) {
  .desktop\:hidden { display: none; }
  .desktop\:block { display: block; }
}

/* POSITION UTILITIES */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; top: 0; z-index: 10; }

/* SHADOW UTILITIES */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* BORDER RADIUS UTILITIES */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 9999px; }

/* Z-INDEX UTILITIES */
.z-base { z-index: 1; }
.z-sticky { z-index: 10; }
.z-overlay { z-index: 20; }
.z-modal { z-index: 30; }
.z-tooltip { z-index: 40; }

/* OVERFLOW UTILITIES */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }

/* OBJECT UTILITIES */
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }
.object-center { object-position: center; }

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

/* TRANSFORM UTILITIES */
.scale-90 { transform: scale(0.9); }
.scale-100 { transform: scale(1); }
.scale-110 { transform: scale(1.1); }

/* REVEAL ANIMATIONS */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-up.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* SCALE ANIMATIONS */
.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.scale-in.revealed {
  opacity: 1;
  transform: scale(1);
}

/* FADE ANIMATIONS */
.fade-in {
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

.fade-in.revealed {
  opacity: 1;
}

/* SKELETON LOADER */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(14, 15, 18, 0.05) 25%,
    rgba(14, 15, 18, 0.08) 50%,
    rgba(14, 15, 18, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* RESPONSIVE VISIBILITY */
@media (min-width: 768px) {
  .mobile-only { display: none !important; }
}

@media (max-width: 767px) {
  .desktop-only { display: none !important; }
}

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

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

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

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* RESPONSIVE UTILITIES */
@media (max-width: 767px) {
  .mobile\:flex { display: flex; }
  .mobile\:hidden { display: none; }
  .mobile\:flex-col { flex-direction: column; }
  .mobile\:text-center { text-align: center; }
  .mobile\:text-sm { font-size: 0.875rem; }
}
