/**
 * VALIS Atomic Utilities v1.0
 * ═══════════════════════════════════════════════════════════════════════════
 * 
 * Clases utilitarias atómicas para eliminar duplicación de CSS.
 * Inspirado en Tailwind pero con naming coherente con VALIS.
 * 
 * Uso:
 *   <button class="flex items-center gap-2 font-ui text-sm tracking-wide">
 * 
 * @version 1.0.0
 */

/* ═══════════════════════════════════════════════════════════════════════════
   TIPOGRAFÍA
   ═══════════════════════════════════════════════════════════════════════════ */

/* Font Family */
.font-ui { font-family: var(--valis-font-ui); }
.font-serif { font-family: var(--valis-font-serif); }
.font-mono { font-family: var(--valis-font-mono); }

/* Font Size */
.text-xs { font-size: var(--valis-text-xs); }
.text-sm { font-size: var(--valis-text-sm); }
.text-base { font-size: var(--valis-text-base); }
.text-md { font-size: var(--valis-text-md); }
.text-lg { font-size: var(--valis-text-lg); }
.text-xl { font-size: var(--valis-text-xl); }
.text-2xl { font-size: var(--valis-text-2xl); }
.text-3xl { font-size: var(--valis-text-3xl); }

/* Font Weight */
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

/* Letter Spacing */
.tracking-tight { letter-spacing: var(--valis-tracking-tight); }
.tracking-normal { letter-spacing: var(--valis-tracking-normal); }
.tracking-wide { letter-spacing: var(--valis-tracking-wide); }
.tracking-wider { letter-spacing: var(--valis-tracking-wider); }
.tracking-widest { letter-spacing: var(--valis-tracking-widest); }

/* Line Height */
.leading-tight { line-height: var(--valis-line-height-tight); }
.leading-normal { line-height: var(--valis-line-height-base); }
.leading-relaxed { line-height: var(--valis-line-height-relaxed); }

/* Text Transform */
.lowercase { text-transform: lowercase; }
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.normal-case { text-transform: none; }

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

/* Text Style */
.italic { font-style: italic; }
.not-italic { font-style: normal; }
.underline { text-decoration: underline; }
.no-underline { text-decoration: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   COLORES DE TEXTO
   ═══════════════════════════════════════════════════════════════════════════ */

.text-primary { color: var(--valis-text-primary); }
.text-secondary { color: var(--valis-text-secondary); }
.text-muted { color: var(--valis-text-muted); }
.text-subtle { color: var(--valis-text-subtle); }
.text-light { color: var(--valis-text-light); }
.text-white { color: white; }
.text-cielo { color: var(--valis-cielo-text); }
.text-tierra { color: var(--valis-tierra-text); }
.text-success { color: var(--valis-success); }
.text-error { color: var(--valis-error); }

/* ═══════════════════════════════════════════════════════════════════════════
   FONDOS
   ═══════════════════════════════════════════════════════════════════════════ */

.bg-white { background: white; }
.bg-dark { background: var(--valis-bg-dark); }
.bg-light { background: var(--valis-bg-light); }
.bg-subtle { background: var(--valis-bg-subtle); }
.bg-overlay { background: var(--valis-bg-overlay); }
.bg-transparent { background: transparent; }
.bg-cielo-soft { background: var(--valis-cielo-soft); }
.bg-tierra-soft { background: var(--valis-tierra-soft); }
.bg-action-primary { background: var(--valis-action-primary); }
.bg-action-secondary { background: var(--valis-action-secondary); }

/* ═══════════════════════════════════════════════════════════════════════════
   BORDES
   ═══════════════════════════════════════════════════════════════════════════ */

.border { border: 1px solid var(--valis-border-medium); }
.border-0 { border: none; }
.border-light { border-color: var(--valis-border-light); }
.border-medium { border-color: var(--valis-border-medium); }
.border-dark { border-color: var(--valis-border-dark); }
.border-cielo { border-color: var(--valis-cielo-border); }
.border-tierra { border-color: var(--valis-tierra-border); }
.border-transparent { border-color: transparent; }

/* Border Radius - VALIS usa 0 por defecto (geometría pura) */
.rounded-0 { border-radius: 0; }
.rounded-sm { border-radius: 2px; }
.rounded { border-radius: 4px; }
.rounded-full { border-radius: 9999px; }

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT - FLEXBOX
   ═══════════════════════════════════════════════════════════════════════════ */

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none !important; }

.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.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-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; }

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

/* ═══════════════════════════════════════════════════════════════════════════
   ESPACIADO - GAP
   ═══════════════════════════════════════════════════════════════════════════ */

.gap-0 { gap: 0; }
.gap-1 { gap: var(--valis-space-1); }
.gap-2 { gap: var(--valis-space-2); }
.gap-3 { gap: var(--valis-space-3); }
.gap-4 { gap: var(--valis-space-4); }
.gap-5 { gap: var(--valis-space-5); }
.gap-6 { gap: var(--valis-space-6); }
.gap-8 { gap: var(--valis-space-8); }
.gap-10 { gap: var(--valis-space-10); }

/* ═══════════════════════════════════════════════════════════════════════════
   ESPACIADO - PADDING
   ═══════════════════════════════════════════════════════════════════════════ */

.p-0 { padding: 0; }
.p-1 { padding: var(--valis-space-1); }
.p-2 { padding: var(--valis-space-2); }
.p-3 { padding: var(--valis-space-3); }
.p-4 { padding: var(--valis-space-4); }
.p-5 { padding: var(--valis-space-5); }
.p-6 { padding: var(--valis-space-6); }
.p-8 { padding: var(--valis-space-8); }

.px-2 { padding-left: var(--valis-space-2); padding-right: var(--valis-space-2); }
.px-3 { padding-left: var(--valis-space-3); padding-right: var(--valis-space-3); }
.px-4 { padding-left: var(--valis-space-4); padding-right: var(--valis-space-4); }
.px-6 { padding-left: var(--valis-space-6); padding-right: var(--valis-space-6); }
.px-8 { padding-left: var(--valis-space-8); padding-right: var(--valis-space-8); }

.py-2 { padding-top: var(--valis-space-2); padding-bottom: var(--valis-space-2); }
.py-3 { padding-top: var(--valis-space-3); padding-bottom: var(--valis-space-3); }
.py-4 { padding-top: var(--valis-space-4); padding-bottom: var(--valis-space-4); }
.py-6 { padding-top: var(--valis-space-6); padding-bottom: var(--valis-space-6); }

/* ═══════════════════════════════════════════════════════════════════════════
   ESPACIADO - MARGIN
   ═══════════════════════════════════════════════════════════════════════════ */

.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.mt-2 { margin-top: var(--valis-space-2); }
.mt-4 { margin-top: var(--valis-space-4); }
.mt-6 { margin-top: var(--valis-space-6); }
.mt-8 { margin-top: var(--valis-space-8); }
.mt-auto { margin-top: auto; }

.mb-2 { margin-bottom: var(--valis-space-2); }
.mb-4 { margin-bottom: var(--valis-space-4); }
.mb-6 { margin-bottom: var(--valis-space-6); }
.mb-8 { margin-bottom: var(--valis-space-8); }

/* ═══════════════════════════════════════════════════════════════════════════
   DIMENSIONES
   ═══════════════════════════════════════════════════════════════════════════ */

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

.h-full { height: 100%; }
.h-auto { height: auto; }
.h-screen { height: 100vh; }
.min-h-0 { min-height: 0; }
.min-h-screen { min-height: 100vh; }
.min-h-44 { min-height: 44px; } /* Touch target mínimo */

/* ═══════════════════════════════════════════════════════════════════════════
   POSICIONAMIENTO
   ═══════════════════════════════════════════════════════════════════════════ */

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

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

/* Z-Index */
.z-base { z-index: var(--valis-z-base); }
.z-dropdown { z-index: var(--valis-z-dropdown); }
.z-sticky { z-index: var(--valis-z-sticky); }
.z-fixed { z-index: var(--valis-z-fixed); }
.z-modal { z-index: var(--valis-z-modal); }
.z-toast { z-index: var(--valis-z-toast); }

/* ═══════════════════════════════════════════════════════════════════════════
   INTERACCIÓN
   ═══════════════════════════════════════════════════════════════════════════ */

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

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

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

/* ═══════════════════════════════════════════════════════════════════════════
   TRANSICIONES
   ═══════════════════════════════════════════════════════════════════════════ */

.transition { transition: all var(--valis-transition-base); }
.transition-fast { transition: all var(--valis-transition-fast); }
.transition-slow { transition: all var(--valis-transition-slow); }
.transition-none { transition: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   SOMBRAS
   ═══════════════════════════════════════════════════════════════════════════ */

.shadow-none { box-shadow: none; }
.shadow-sm { box-shadow: var(--valis-shadow-sm); }
.shadow { box-shadow: var(--valis-shadow-md); }
.shadow-lg { box-shadow: var(--valis-shadow-lg); }
.shadow-xl { box-shadow: var(--valis-shadow-xl); }

/* ═══════════════════════════════════════════════════════════════════════════
   OVERFLOW
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════════════════════════════════════
   OPACIDAD
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════════════════════════════════════
   UTILIDADES ESPECÍFICAS VALIS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Whitespace */
.whitespace-nowrap { white-space: nowrap; }
.whitespace-pre { white-space: pre; }
.whitespace-normal { white-space: normal; }

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

/* 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;
}

/* Focus visible ring */
.focus-ring:focus-visible {
    outline: 2px solid var(--valis-text-primary);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE MODIFIERS
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .md\:hidden { display: none !important; }
    .md\:flex { display: flex; }
    .md\:flex-col { flex-direction: column; }
    .md\:w-full { width: 100%; }
    .md\:text-center { text-align: center; }
}

@media (max-width: 480px) {
    .sm\:hidden { display: none !important; }
    .sm\:flex { display: flex; }
    .sm\:flex-col { flex-direction: column; }
    .sm\:w-full { width: 100%; }
    .sm\:text-sm { font-size: var(--valis-text-sm); }
    .sm\:p-4 { padding: var(--valis-space-4); }
}
