/**
 * Utility Classes - Doctor Scroll
 * 
 * Clases de utilidad reutilizables basadas en Design Tokens
 * Inspirado en Tailwind CSS pero usando nuestros tokens
 * Versión: 1.0.0
 */

/* ========================================
 CONTAINER
 ======================================== */

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container-narrow {
  max-width: 800px;
}

.container-wide {
  max-width: 1400px;
}

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

.flex {
  display: flex;
}

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

.flex-row {
  flex-direction: row;
}

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

.items-start {
  align-items: flex-start;
}

.items-center {
  align-items: center;
}

.items-end {
  align-items: flex-end;
}

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

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

/* ========================================
 GRID
 ======================================== */

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

/* Responsive grids */
@media (min-width: 768px) {
  .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\\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .lg\\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ========================================
 SPACING - MARGIN
 ======================================== */

.m-0 {
  margin: 0;
}

.m-auto {
  margin: auto;
}

.mt-0 {
  margin-top: 0;
}

.mt-2 {
  margin-top: var(--space-2);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mt-8 {
  margin-top: var(--space-8);
}

.mb-0 {
  margin-bottom: 0;
}

.mb-2 {
  margin-bottom: var(--space-2);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-6 {
  margin-bottom: var(--space-6);
}

.mb-8 {
  margin-bottom: var(--space-8);
}

.ml-auto {
  margin-left: auto;
}

.mr-auto {
  margin-right: auto;
}

/* ========================================
 SPACING - PADDING
 ======================================== */

.p-0 {
  padding: 0;
}

.p-2 {
  padding: var(--space-2);
}

.p-4 {
  padding: var(--space-4);
}

.p-6 {
  padding: var(--space-6);
}

.p-8 {
  padding: var(--space-8);
}

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

/* ========================================
 TEXT ALIGNMENT
 ======================================== */

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

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

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

/* ========================================
 TEXT STYLES
 ======================================== */

.font-display {
  font-family: var(--font-display);
}

.font-body {
  font-family: var(--font-primary);
}

.font-mono {
  font-family: var(--font-mono);
}

.text-xs {
  font-size: var(--text-xs);
}

.text-sm {
  font-size: var(--text-sm);
}

.text-base {
  font-size: var(--text-base);
}

.text-lg {
  font-size: var(--text-lg);
}

.text-xl {
  font-size: var(--text-xl);
}

.text-2xl {
  font-size: var(--text-2xl);
}

.text-3xl {
  font-size: var(--text-3xl);
}

.font-normal {
  font-weight: var(--weight-normal);
}

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

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

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

.leading-tight {
  line-height: var(--leading-tight);
}

.leading-normal {
  line-height: var(--leading-normal);
}

.leading-relaxed {
  line-height: var(--leading-relaxed);
}

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

.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted);
}

.text-accent-primary {
  color: var(--accent-primary);
}

.text-accent-secondary {
  color: var(--accent-secondary);
}

.bg-primary {
  background-color: var(--bg-primary);
}

.bg-secondary {
  background-color: var(--bg-secondary);
}

.bg-tertiary {
  background-color: var(--bg-tertiary);
}

/* ========================================
 BORDERS
 ======================================== */

.border {
  border: 1px solid var(--border-primary);
}

.border-t {
  border-top: 1px solid var(--border-primary);
}

.border-b {
  border-bottom: 1px solid var(--border-primary);
}

.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: var(--radius-full);
}

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

.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

.shadow-xl {
  box-shadow: var(--shadow-xl);
}

/* ========================================
 DISPLAY
 ======================================== */

.block {
  display: block;
}

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

.inline {
  display: inline;
}

.hidden {
  display: none;
}

/* ========================================
 POSITION
 ======================================== */

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.sticky {
  position: sticky;
}

/* ========================================
 SIZES
 ======================================== */

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

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

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

.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

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

.transition-all {
  transition: var(--transition-all);
}

.transition-colors {
  transition: var(--transition-colors);
}

.transition-transform {
  transition: var(--transition-transform);
}

/* ========================================
 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-width: 0;
}

/* Focus visible helper */
.focus-ring {
  outline: 2px solid var(--accent-secondary);
  outline-offset: 2px;
}

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

/* Hide on mobile */
@media (max-width: 767px) {
  .hidden-mobile {
    display: none;
  }
}

/* Show on mobile only */
@media (min-width: 768px) {
  .mobile-only {
    display: none;
  }
}
