/* Sistema de Zoom de Texto - Accesibilidad */
/* Aplicar zoom consistente a todos los elementos de texto */

/* Variables CSS para controlar el tamaño base */
:root {
    --text-scale: 1;
}

/* Nivel 1: Tamaño normal (100%) */
body.text-size-normal {
    --text-scale: 1;
}

/* Nivel 2: Tamaño grande (120%) */
body.text-size-large {
    --text-scale: 1.2;
}

/* Nivel 3: Tamaño extra grande (140%) */
body.text-size-xlarge {
    --text-scale: 1.4;
}

/* Aplicar escala a elementos de texto base */
body {
    font-size: calc(14px * var(--text-scale));
}

/* Headers */
h1, .h1 { font-size: calc(2.5rem * var(--text-scale)) !important; }
h2, .h2 { font-size: calc(2rem * var(--text-scale)) !important; }
h3, .h3 { font-size: calc(1.75rem * var(--text-scale)) !important; }
h4, .h4 { font-size: calc(1.5rem * var(--text-scale)) !important; }
h5, .h5 { font-size: calc(1.25rem * var(--text-scale)) !important; }
h6, .h6 { font-size: calc(1rem * var(--text-scale)) !important; }

/* Texto de párrafo */
p, .text-base {
    font-size: calc(14px * var(--text-scale)) !important;
}

/* Botones */
.btn {
    font-size: calc(14px * var(--text-scale)) !important;
}

.btn-sm {
    font-size: calc(13px * var(--text-scale)) !important;
}

.btn-lg {
    font-size: calc(16px * var(--text-scale)) !important;
}

/* Formularios */
.form-control,
.form-select,
.form-label,
label {
    font-size: calc(14px * var(--text-scale)) !important;
}

.form-control-sm {
    font-size: calc(13px * var(--text-scale)) !important;
}

.form-control-lg {
    font-size: calc(16px * var(--text-scale)) !important;
}

/* Texto pequeño */
.small,
small,
.text-muted.small {
    font-size: calc(12px * var(--text-scale)) !important;
}

/* Tablas */
.table {
    font-size: calc(14px * var(--text-scale)) !important;
}

.table th,
.table td {
    font-size: calc(14px * var(--text-scale)) !important;
}

/* Badges */
.badge {
    font-size: calc(12px * var(--text-scale)) !important;
}

/* Cards */
.card-title {
    font-size: calc(1.25rem * var(--text-scale)) !important;
}

.card-text,
.card-body {
    font-size: calc(14px * var(--text-scale)) !important;
}

/* Navegación */
.nav-link {
    font-size: calc(14px * var(--text-scale)) !important;
}

.navbar-brand {
    font-size: calc(1.25rem * var(--text-scale)) !important;
}

/* Dropdowns */
.dropdown-item {
    font-size: calc(14px * var(--text-scale)) !important;
}

.dropdown-header {
    font-size: calc(13px * var(--text-scale)) !important;
}

/* Alertas */
.alert {
    font-size: calc(14px * var(--text-scale)) !important;
}

/* Modals */
.modal-title {
    font-size: calc(1.25rem * var(--text-scale)) !important;
}

.modal-body {
    font-size: calc(14px * var(--text-scale)) !important;
}

/* Footer */
footer {
    font-size: calc(14px * var(--text-scale)) !important;
}

footer h4 {
    font-size: calc(17px * var(--text-scale)) !important;
}

footer .small {
    font-size: calc(12px * var(--text-scale)) !important;
}

/* Listas */
ul, ol, li {
    font-size: calc(14px * var(--text-scale)) !important;
}

/* Breadcrumbs */
.breadcrumb {
    font-size: calc(14px * var(--text-scale)) !important;
}

/* Tooltips */
.tooltip {
    font-size: calc(12px * var(--text-scale)) !important;
}

/* Métricas y estadísticas (números grandes) */
.metric-value,
.stat-number {
    font-size: calc(2rem * var(--text-scale)) !important;
}

.metric-label,
.stat-label {
    font-size: calc(12px * var(--text-scale)) !important;
}

/* Ajustes responsivos */
@media (max-width: 768px) {
    /* En móvil, limitar el zoom máximo para evitar overflow */
    body.text-size-xlarge {
        --text-scale: 1.3;
    }
}

/* Guardar preferencia en localStorage */
body[data-text-size] {
    transition: font-size 0.2s ease;
}