/* ===================================
   RESET Y BASE STYLES
   =================================== */

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

/* HTML y Body */
html {
    scroll-behavior: smooth;
    font-size: 16px;
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background: var(--bg-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enlaces */
a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-normal);
}

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

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

h1 {
    font-size: var(--font-size-5xl);
}

h2 {
    font-size: var(--font-size-4xl);
}

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

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

h5 {
    font-size: var(--font-size-xl);
}

h6 {
    font-size: var(--font-size-lg);
}

/* Párrafos */
p {
    margin-bottom: var(--space-md);
    line-height: var(--line-height-relaxed);
}

/* Listas */
ul, ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
}

li {
    margin-bottom: var(--space-xs);
}

/* Imágenes */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Formularios */
input,
button,
select,
textarea {
    font: inherit;
    margin: 0;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

input,
select,
textarea {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius);
    font-size: var(--font-size-base);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
    background: var(--bg-white);
    color: var(--text-dark);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Tablas */
table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    text-align: left;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-medium);
}

th {
    background: var(--bg-light);
    font-weight: var(--font-weight-semibold);
    color: var(--text-dark);
}

/* Code */
code,
pre {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: var(--font-size-sm);
}

pre {
    background: var(--bg-light);
    padding: var(--space-md);
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: var(--space-md);
}

code {
    background: var(--bg-light);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

/* Utilidades de accesibilidad */
.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 */
.focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Selection */
::selection {
    background: var(--accent-soft);
    color: var(--accent);
}

::-moz-selection {
    background: var(--accent-soft);
    color: var(--accent);
}