/**
 * ============================================================================
 * WEBOPTIMIZER PRO - BASE / RESET CSS
 * ============================================================================
 * 
 * DESCRIPCIÓN:
 * Reset CSS, estilos base para elementos HTML,
 * y utilidades tipográficas fundamentales.
 * 
 * REGLA DE ORO #8: ~150 líneas
 * 
 * @author      WebOptimizer Team
 * @version     1.0.0
 * ============================================================================
 */

/* ============================================
   RESET UNIVERSAL
   ============================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, var(--color-bg-dark) 0%, #1a1a2e 50%, var(--color-bg-dark) 100%);
    color: var(--color-text);
    line-height: var(--leading-normal);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   TIPOGRAFÍA BASE
 * ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    color: var(--color-text);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p {
    margin-bottom: var(--spacing-md);
    color: var(--color-text-muted);
}

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

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

/* ============================================
   ELEMENTOS DE FORMULARIO (BASE)
 * ============================================ */

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   LISTAS
 * ============================================ */

ul, ol {
    list-style: none;
}

/* Listas con estilo cuando se necesiten */
ul.styled, ol.styled {
    padding-left: var(--spacing-lg);
}

ul.styled {
    list-style-type: disc;
}

ol.styled {
    list-style-type: decimal;
}

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

/* ============================================
   TABLAS
 * ============================================ */

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
}

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

tr:hover {
    background: var(--color-bg-hover);
}

/* ============================================
   UTILIDADES DE TEXTO
 * ============================================ */

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

.text-muted { color: var(--color-text-muted); }
.text-dim { color: var(--color-text-dim); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-info { color: var(--color-info); }

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

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

/* ============================================
   UTILIDADES DE VISIBILIDAD
 * ============================================

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

.hidden { display: none !important; }
.invisible { visibility: hidden; }

/* ============================================
   SCROLLBARES PERSONALIZADOS
 * ============================================

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-dim);
}

/**
 * ============================================================================
 * FIN DE BASE CSS
 * ============================================================================
 */
