/* 
Fecha: 2025-12-29
Path: /var/www/oberdomo/app-client/css/base.css
Descripción: CSS base - Reset y estilos fundamentales
             Normalización cross-browser y estilos globales
*/

/* === RESET BÁSICO === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-dark);
    overflow-x: hidden;
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

/* === SELECCIÓN DE TEXTO === */
::selection {
    background-color: var(--color-primary);
    color: var(--color-bg-dark);
}

::-moz-selection {
    background-color: var(--color-primary);
    color: var(--color-bg-dark);
}

/* === SCROLLBAR PERSONALIZADO === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--color-border-light);
}

/* === TIPOGRAFÍA === */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
}

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

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

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

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

a:active {
    color: var(--color-primary-dark);
}

small {
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
}

strong, b {
    font-weight: var(--font-weight-semibold);
}

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

/* === IMÁGENES === */
img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

svg {
    fill: currentColor;
}

/* === FORMULARIOS === */
input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

input, textarea, select {
    width: 100%;
    background-color: var(--color-bg-darker);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: var(--input-padding);
    color: var(--color-text-primary);
    transition: all var(--transition-base);
}

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

input::placeholder, textarea::placeholder {
    color: var(--color-text-tertiary);
    opacity: 1;
}

input:disabled, textarea:disabled, select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
}

/* === BOTONES === */
button {
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    font-family: inherit;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

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

th, td {
    text-align: left;
    padding: var(--spacing-sm);
}

/* === UTILIDADES GLOBALES === */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

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

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

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

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

/* === ANIMACIONES GLOBALES === */
.fade-in {
    animation: fadeIn var(--transition-base);
}

.slide-in-up {
    animation: slideInUp var(--transition-base);
}

.slide-in-down {
    animation: slideInDown var(--transition-base);
}

.scale-in {
    animation: scaleIn var(--transition-base);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    h1 { font-size: var(--font-size-2xl); }
    h2 { font-size: var(--font-size-xl); }
    h3 { font-size: var(--font-size-lg); }
}

/* === DARK MODE (por defecto) === */
@media (prefers-color-scheme: light) {
    /* Usuario prefiere modo claro pero forzamos oscuro */
    body {
        background-color: var(--color-bg-dark);
        color: var(--color-text-primary);
    }
}

/* === SAFE AREA (iOS) === */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* === PRINT === */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .no-print {
        display: none !important;
    }
}
