/**
 * Base CSS - Shared Styles
 * Variables globales y reset básico
 */

:root {
  /* Colores base */
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-hover-dark: #1e40af;
  --color-secondary: #64748b;
  --color-secondary-hover: #475569;
  --color-success: #22c55e;
  --color-success-dark: #059669;
  --color-error: #ef4444;
  --color-error-dark: #dc2626;
  --color-warning: #f59e0b;
  --color-warning-dark: #d97706;
  --color-info: #3b82f6;
  --color-danger: #ef4444;

  /* Colores de fondo y texto */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f8fafc;
  --color-bg-tertiary: #f1f5f9;
  --color-text-primary: #0f172a;
  --color-text-secondary: #64748b;
  --color-text-tertiary: #94a3b8;
  --color-text-inverse: #ffffff;
  --color-white: #ffffff;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

  /* Colores - alias para compatibilidad */
  --color-surface: #f8fafc;
  --color-surface-hover: #f1f5f9;
  --color-border: #e5e7eb;
  --color-border-focus: #2563eb;
  --button-height: 44px;
  --font-family-base: 'Inter', system-ui, sans-serif;
  --font-size-base: 1rem;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --line-height-normal: 1.6;

  /* Espaciado */
  --spacing-xs: 0.25rem;   /* 4px */
  --spacing-sm: 0.5rem;    /* 8px */
  --spacing-md: 1rem;      /* 16px */
  --spacing-lg: 1.5rem;    /* 24px */
  --spacing-xl: 2rem;      /* 32px */
  --spacing-2xl: 3rem;     /* 48px */
  --spacing-3xl: 4rem;     /* 64px */

  /* Espaciado - alias para compatibilidad */
  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;        /* 16px */
  --space-5: 1.25rem;    /* 20px */
  --space-6: 1.5rem;     /* 24px */
  --space-8: 2rem;        /* 32px */
  --space-10: 2.5rem;     /* 40px */
  --space-16: 4rem;       /* 64px */

  /* Tipografía */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;

  /* Tamaños de fuente */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */

  /* Tipografía - alias para compatibilidad */
  --font-size-base: 1rem;
  --font-size-xl: 1.25rem;
  --font-size-sm: 0.875rem;
  --font-size-xs: 0.75rem;

  /* Líneas de altura - alias para compatibilidad */
  --line-height-relaxed: 1.75;
  --line-height-tight: 1.25;

  /* Bordes */
  --radius-xs: 0.125rem;    /* 2px */
  --radius-sm: 0.25rem;     /* 4px */
  --radius-md: 0.5rem;      /* 8px */
  --radius-lg: 1rem;        /* 16px */
  --radius-xl: 1.5rem;      /* 24px */
  --radius-full: 9999px;

  /* Bordes - alias para compatibilidad */
  --radius: var(--radius-md);

  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.3);

  /* Transiciones */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;

  /* Z-index layers */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* Reset básico */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  min-height: 100vh;
}

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
}

/* Imágenes */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Inputs, buttons, textarea */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}

/* Botones reset */
button {
  border: none;
  background: none;
  cursor: pointer;
}

/* Listas */
ul, ol {
  list-style: none;
}

/* Heading reset */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

/* Paragraph reset */
p {
  margin-bottom: var(--spacing-md);
}

/* Code block */
code, pre {
  font-family: var(--font-mono);
}

code {
  padding: 0.2em 0.4em;
  margin: 0 0.1em;
  font-size: 85%;
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
}

pre {
  padding: var(--spacing-md);
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
  margin: 0;
  font-size: 100%;
}

/* Horizontal rule */
hr {
  border: 0;
  border-top: 1px solid var(--color-bg-tertiary);
  margin: var(--spacing-xl) 0;
}

/* Scrollbar styling */
@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  ::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
  }

  ::-webkit-scrollbar-thumb {
    background: var(--color-secondary);
    border-radius: var(--radius-md);
  }

}

/* Focus visible outline */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background-color: var(--color-primary);
  color: white;
}
