/**
 * Base CSS - Reset, tipografía y estilos base
 */

/* ============================================
 * RESET / NORMALIZE
 * ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-base);
  color: var(--text-primary);
  background-color: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
 * TIPOGRAFÍA
 * ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin-top: 0;
  margin-bottom: var(--spacing-4);
}

h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-extrabold);
  letter-spacing: var(--letter-spacing-wide);
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-base);
}

p {
  margin-top: 0;
  margin-bottom: var(--spacing-4);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus {
  color: var(--color-primary-dark);
}

/* ============================================
 * LISTAS
 * ============================================ */

ul, ol {
  margin-top: 0;
  margin-bottom: var(--spacing-4);
  padding-left: var(--spacing-8);
}

li {
  margin-bottom: var(--spacing-2);
}

/* ============================================
 * IMÁGENES
 * ============================================ */

img {
  max-width: 100%;
  vertical-align: middle;
}

/* ============================================
 * TABLAS
 * ============================================ */

table {
  border-collapse: collapse;
  width: 100%;
}

/* ============================================
 * FORMULARIOS BASE
 * ============================================ */

input,
textarea,
select,
button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button {
  cursor: pointer;
}

/* ============================================
 * UTILIDADES DE TEXTO
 * ============================================ */

.text-primary {
  color: var(--text-primary) !important;
}

.text-secondary {
  color: var(--text-secondary) !important;
}

.text-danger {
  color: var(--color-primary) !important;
}

.text-success {
  color: var(--color-success) !important;
}

.text-warning {
  color: var(--color-warning) !important;
}

.text-info {
  color: var(--color-info) !important;
}

.text-white {
  color: var(--color-white) !important;
}

.text-light {
  color: var(--text-light) !important;
}

/* ============================================
 * UTILIDADES DE FONDO
 * ============================================ */

.bg-black {
  background-color: var(--color-black) !important;
}

.bg-dark {
  background-color: var(--color-dark) !important;
}

.bg-danger {
  background-color: var(--color-primary) !important;
}

.bg-white {
  background-color: var(--color-white) !important;
}

/* ============================================
 * SELECCIÓN DE TEXTO
 * ============================================ */

::selection {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* ============================================
 * FOCUS VISIBLE
 * ============================================ */

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ============================================
 * SCROLLBAR PERSONALIZADO
 * ============================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

/* ============================================
 * RESPONSIVE - BASE
 * ============================================ */

@media (max-width: 767px) {
  /* Tipografía responsive */
  h1 {
    font-size: var(--font-size-3xl);
  }

  h2 {
    font-size: var(--font-size-2xl);
  }

  h3 {
    font-size: var(--font-size-xl);
  }

  h4 {
    font-size: var(--font-size-lg);
  }

  h5 {
    font-size: var(--font-size-base);
  }

  h6 {
    font-size: var(--font-size-sm);
  }

  body {
    font-size: var(--font-size-sm);
  }

  /* Scrollbar más delgada en móviles */
  ::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }
}

@media (max-width: 576px) {
  h1 {
    font-size: var(--font-size-2xl);
  }

  h2 {
    font-size: var(--font-size-xl);
  }

  h3 {
    font-size: var(--font-size-lg);
  }

  body {
    font-size: var(--font-size-sm);
  }
}

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-500);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}
