/* ===== AROROPIOLOGÍA - BASE STYLES ===== */
/* Archivo: public_html/assets/css/base.css */
/* Versión: 2.0 - Optimizado para sistema tipográfico dedicado */
/* Nota: Las fuentes se manejan en typography.css */

/* ===== VARIABLES DE COLOR Y TEMA ===== */
:root {
    /* Colores monocromáticos principales */
    --black: #000000;
    --white: #ffffff;
    
    /* Escala de grises funcional */
    --gray-dark: #2a2a2a;
    --gray-medium: #4a4a4a;
    --gray-light: #8a8a8a;
    --gray-paper: #f4f4f4;
    
    /* Colores funcionales mínimos (para estados críticos) */
    --green-academic: #0f5132;    /* Confirmaciones y éxito */
    --red-institutional: #842029; /* Alertas críticas */
    --blue-reference: #084c61;    /* Enlaces y referencias */
    
    /* Opacidades estándar */
    --opacity-subtle: 0.02;
    --opacity-light: 0.05;
    --opacity-medium: 0.1;
    --opacity-strong: 0.7;
    
    /* Sombras minimalistas */
    --shadow-subtle: 0 0 20px rgba(255, 255, 255, 0.1);
    --shadow-panel: 0 0 40px rgba(0, 0, 0, 0.3);
    
    /* Transiciones estándar */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Z-index scale */
    --z-background: -1;
    --z-content: 1;
    --z-interface: 10;
    --z-panel: 50;
    --z-overlay: 100;
    --z-modal: 1000;
    --z-tooltip: 1100;
    --z-debug: 9999;
}

/* ===== CONFIGURACIÓN CORPORAL BASE ===== */
body {
    background: var(--black);
    color: var(--white);
    overflow: hidden; /* Mantener para Reader interface */
    
    /* ← REMOVIDO: font-family, font-size, line-height - delegado a typography.css */
    
    /* Optimizaciones de renderizado */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    
    /* Smooth scrolling global */
    scroll-behavior: smooth;
    
    /* Optimización para dispositivos táctiles */
    touch-action: manipulation;
}

/* ===== UTILIDADES BÁSICAS ===== */
.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.no-scroll {
    overflow: hidden;
}

.full-height {
    height: 100vh;
    min-height: 100vh;
}

.centered {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ===== BOTÓN LOGIN - SIMPLIFICADO ===== */
.login-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--z-interface);
}

.login-button a {
    color: var(--white);
    padding: 8px 16px;
    border: 1px solid var(--white);
    background: var(--black);
    /* ← REMOVIDO: font-family, font-size - delegado a typography.css */
    letter-spacing: 1px;
    transition: var(--transition-fast);
    display: inline-block;
    text-decoration: none;
}

.login-button a:hover {
    background: var(--white);
    color: var(--black);
}

.login-button a:focus {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

/* ===== ESTADOS DE CARGA Y TRANSICIÓN ===== */
.loading {
    pointer-events: none;
    opacity: var(--opacity-strong);
}

.fade-in {
    animation: fadeIn var(--transition-normal) ease-out forwards;
}

.fade-out {
    animation: fadeOut var(--transition-normal) ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ===== ELEMENTOS INTERACTIVOS BASE ===== */
button {
    /* ← REMOVIDO: font-family - delegado a typography.css */
    border: none;
    background: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

input, textarea, select {
    /* ← REMOVIDO: font-family - delegado a typography.css */
    border: none;
    background: transparent;
    outline: none;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

/* ===== FOCO Y ACCESIBILIDAD ===== */
:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

/* Reducir movimiento para usuarios con preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== MODO ALTO CONTRASTE (E-INK) ===== */
@media (prefers-contrast: high) {
    :root {
        /* Incrementar contrastes para e-ink */
        --gray-dark: #1a1a1a;
        --gray-medium: #333333;
        --gray-light: #666666;
    }
    
    .login-button a {
        border-width: 2px;
        font-weight: bold;
    }
    
    button {
        border-width: 2px !important;
        font-weight: bold;
    }
    
    input, textarea {
        border: 1px solid var(--gray-medium) !important;
    }
}

/* ===== MODO OSCURO FORZADO ===== */
@media (prefers-color-scheme: dark) {
    /* Aroropiología siempre es oscuro, pero preparado para adaptaciones */
    :root {
        color-scheme: dark;
    }
}

/* ===== RESPONSIVE BREAKPOINTS BÁSICOS ===== */
@media (max-width: 768px) {
    .login-button {
        top: 15px;
        right: 15px;
    }
    
    .login-button a {
        padding: 6px 12px;
        /* ← REMOVIDO: font-size - delegado a typography.css */
    }
}

@media (max-width: 480px) {
    .login-button {
        top: 12px;
        right: 12px;
    }
    
    .login-button a {
        padding: 5px 10px;
        /* ← REMOVIDO: font-size - delegado a typography.css */
    }
}

/* ===== SELECCIÓN DE TEXTO ===== */
::selection {
    background: var(--white);
    color: var(--black);
}

::-moz-selection {
    background: var(--white);
    color: var(--black);
}

/* ===== SCROLLBARS PERSONALIZADOS ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-medium);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-light);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* ===== FORMULARIOS BASE ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gray-light);
    /* ← REMOVIDO: font-size, font-family - delegado a typography.css */
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-medium);
    background: var(--black);
    color: var(--white);
    /* ← REMOVIDO: font-family - delegado a typography.css */
    transition: var(--transition-fast);
}

.form-input:focus {
    border-color: var(--white);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.form-input::placeholder {
    color: var(--gray-light);
}

/* ===== BOTONES BASE ===== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--white);
    background: var(--black);
    color: var(--white);
    /* ← REMOVIDO: font-family - delegado a typography.css */
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn:hover {
    background: var(--white);
    color: var(--black);
}

.btn:active {
    transform: translateY(1px);
}

.btn-secondary {
    border-color: var(--gray-medium);
    color: var(--gray-light);
}

.btn-secondary:hover {
    background: var(--gray-medium);
    color: var(--white);
    border-color: var(--white);
}

/* ===== OVERLAYS Y MODALES ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: var(--z-overlay);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

.overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--black);
    border: 2px solid var(--white);
    padding: 2rem;
    z-index: var(--z-modal);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

/* ===== DEBUGGING Y DESARROLLO ===== */
.debug-outline {
    outline: 1px solid red !important;
}

.debug-info {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: var(--black);
    color: var(--white);
    padding: 0.5rem;
    border: 1px solid var(--gray-medium);
    /* ← REMOVIDO: font-family, font-size - delegado a typography.css */
    z-index: var(--z-debug);
    pointer-events: none;
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .login-button,
    .overlay,
    .modal,
    .debug-info {
        display: none !important;
    }
    
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }
}

/* ===== COMPATIBILIDAD LEGACY ===== */
/* Fallbacks para navegadores muy antiguos */
.no-js body {
    overflow: auto;
}

.no-flexbox .centered {
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ===== OPTIMIZACIONES DE RENDIMIENTO ===== */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.pointer-events-none {
    pointer-events: none;
}

.pointer-events-auto {
    pointer-events: auto;
}