/* 
 * CSS de Accesibilidad - WCAG 2.1 Nivel AA
 * Facultad de Ciencias Sociales
 */

/* ========== ALTO CONTRASTE ========== */
body.alto-contraste {
    background-color: #000000 !important;
    color: #FFFFFF !important;
}

body.alto-contraste * {
    background-color: #000000 !important;
    color: #FFFFFF !important;
    border-color: #FFFFFF !important;
}

body.alto-contraste a {
    color: #FFFF00 !important;
    text-decoration: underline !important;
}

body.alto-contraste button,
body.alto-contraste .btn {
    border: 2px solid #FFFFFF !important;
    background-color: #000000 !important;
    color: #FFFFFF !important;
}

body.alto-contraste button:hover,
body.alto-contraste .btn:hover {
    background-color: #333333 !important;
}

/* ========== TAMAÑO DE TEXTO ========== */
body.texto-125 { font-size: 125% !important; }
body.texto-150 { font-size: 150% !important; }
body.texto-175 { font-size: 175% !important; }
body.texto-200 { font-size: 200% !important; }

/* Asegurar que todo se redimensione */
.texto-escalable {
    max-width: 100% !important;
    overflow-x: auto !important;
}

/* ========== FUENTE PARA DISLEXIA ========== */
body.fuente-dislexia {
    font-family: 'OpenDyslexic', 'Comic Sans MS', 'Open Sans', sans-serif !important;
    line-height: 1.8 !important;
    letter-spacing: 0.05em !important;
}

/* ========== SIN ANIMACIONES ========== */
body.sin-animaciones * {
    animation: none !important;
    transition: none !important;
}

/* ========== FOCO VISIBLE ========== */
*:focus {
    outline: 3px solid #0056b3 !important;
    outline-offset: 2px !important;
}

.focused {
    box-shadow: 0 0 0 3px #0056b3, 0 0 0 6px #FFFFFF !important;
    position: relative !important;
    z-index: 1000 !important;
}

/* Para usuarios de teclado */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #0056b3;
    color: white;
    padding: 8px;
    z-index: 10000;
    text-decoration: none;
}

.skip-link:focus {
    top: 10px;
}

/* ========== CONTRASTE MEJORADO ========== */
.contraste-mejorado {
    color: #000000 !important;
    background-color: #FFFFFF !important;
}

.contraste-mejorado-inverso {
    color: #FFFFFF !important;
    background-color: #000000 !important;
}

/* ========== MEJORAS PARA LECTORES PANTALLA ========== */
.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;
}

.visually-hidden-focusable:not(:focus):not(:focus-within) {
    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;
}

/* ========== BARRA DE ACCESIBILIDAD ========== */
.accessibility-bar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.9rem;
}

.btn-accessibility {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn-accessibility:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.btn-accessibility[aria-pressed="true"] {
    background-color: #0056b3;
    color: white;
    border-color: #0056b3;
}

/* ========== CARRUSEL ACCESIBLE ========== */
.carousel-caption-accessible {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

/* ========== TIMELINE ACCESIBLE ========== */
.timeline-accessible {
    position: relative;
    padding-left: 40px;
}

.timeline-accessible::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #dee2e6;
}

.timeline-step {
    position: relative;
    margin-bottom: 20px;
}

.step-number {
    position: absolute;
    left: -40px;
    width: 40px;
    height: 40px;
    background-color: #0056b3;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.step-content {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #0056b3;
}

/* ========== BOTONES ACCESIBLES ========== */
.btn-accesible {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 24px;
    font-size: 1rem;
    line-height: 1.5;
}

/* ========== FORMULARIOS ACCESIBLES ========== */
.form-label-required::after {
    content: " *";
    color: #dc3545;
}

.form-control:focus {
    border-color: #0056b3;
    box-shadow: 0 0 0 0.25rem rgba(0, 86, 179, 0.25);
}

.input-group-text-accessible {
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
}

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

.table-accessible th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid #dee2e6;
}

.table-accessible td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.table-accessible caption {
    caption-side: top;
    padding: 10px;
    font-weight: bold;
    text-align: left;
}

/* ========== MEDIA QUERIES PARA ACCESIBILIDAD ========== */
@media (max-width: 320px) {
    .mobile-first-320 {
        display: block !important;
    }
    
    .btn-accesible {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== MEJORAS PARA DALTÓNICOS ========== */
.daltonismo-protanopia {
    filter: url('#protanopia');
}

.daltonismo-deuteranopia {
    filter: url('#deuteranopia');
}

.daltonismo-tritanopia {
    filter: url('#tritanopia');
}

/* ========== BOTÓN DE AYUDA FLOTANTE ========== */
.btn-help {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ========== INDICADORES DE ESTADO ========== */
.estado-cargando {
    position: relative;
}

.estado-cargando::after {
    content: " (Cargando...)";
    font-size: 0.9em;
    color: #6c757d;
}

.estado-completado::after {
    content: " ✓";
    color: #198754;
}

/* ========== MEJORAS PARA LECTURA ========== */
.modo-lectura {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.2em;
    line-height: 1.8;
    font-family: Georgia, 'Times New Roman', serif;
}

.modo-lectura img {
    max-width: 100%;
    height: auto;
}

/* ========== SIMULADOR DE DISLEXIA ========== */
@font-face {
    font-family: 'OpenDyslexic';
    src: url('../fonts/OpenDyslexic-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}