/**
 * Widget de Accesibilidad - Estilos
 */

/* ============================================
   BOTÓN FLOTANTE
   ============================================ */

#accessibility-toggle {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 45px;
    height: 45px;
    background: #003d82;
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

#accessibility-toggle:hover {
    background: #002a5c;
    transform: scale(1.1);
}

#accessibility-toggle:focus {
    outline: 3px solid #ffd700;
    outline-offset: 2px;
}

/* ============================================
   PANEL DE ACCESIBILIDAD
   ============================================ */

#accessibility-panel {
    position: fixed;
    left: -350px;
    bottom: 75px;
    width: 320px;
    max-height: 80vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    transition: left 0.3s ease;
    overflow: hidden;
}

#accessibility-panel.open {
    left: 20px;
}

.accessibility-header {
    background: linear-gradient(135deg, #003d82 0%, #0056b3 100%);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accessibility-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.accessibility-body {
    padding: 1rem;
    max-height: calc(80vh - 60px);
    overflow-y: auto;
}

.accessibility-section {
    margin-bottom: 1.5rem;
}

.accessibility-section:last-child {
    margin-bottom: 0;
}

.accessibility-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #003d82;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   CONTROLES
   ============================================ */

.font-size-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.font-size-controls button {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.font-size-controls button:hover {
    background: #f8f9fa;
    border-color: #003d82;
}

.font-size-controls button:focus {
    outline: 2px solid #003d82;
    outline-offset: 2px;
}

.font-size-indicator {
    font-weight: 600;
    color: #003d82;
    min-width: 50px;
    text-align: center;
}

/* ============================================
   BOTONES TOGGLE
   ============================================ */

.toggle-button {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    text-align: left;
}

.toggle-button:hover {
    background: #f8f9fa;
    border-color: #003d82;
}

.toggle-button:focus {
    outline: 2px solid #003d82;
    outline-offset: 2px;
}

.toggle-button.active {
    background: #e7f3ff;
    border-color: #003d82;
    color: #003d82;
}

.toggle-button i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.toggle-button-text {
    flex: 1;
}

.toggle-button-label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.toggle-button-desc {
    font-size: 0.75rem;
    color: #6c757d;
}

.toggle-button.active .toggle-button-desc {
    color: #003d82;
}

/* ============================================
   BOTÓN RESET
   ============================================ */

.reset-button {
    width: 100%;
    padding: 0.75rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.reset-button:hover {
    background: #c82333;
}

.reset-button:focus {
    outline: 2px solid #dc3545;
    outline-offset: 2px;
}

/* ============================================
   MODOS DE ACCESIBILIDAD
   ============================================ */

/* Alto contraste */
html.high-contrast {
    filter: contrast(1.3);
}

html.high-contrast body {
    background: #fff;
    color: #000;
}

html.high-contrast .bg-dark,
html.high-contrast footer {
    background: #000 !important;
    color: #fff !important;
}

html.high-contrast .card {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #000 !important;
}

html.high-contrast .card-body {
    background: #fff !important;
    color: #000 !important;
}

html.high-contrast .text-white,
html.high-contrast .text-white-50 {
    color: #fff !important;
}

html.high-contrast a {
    color: #0000ff;
    text-decoration: underline;
    font-weight: 600;
}

html.high-contrast .btn-primary {
    background: #0000ff !important;
    color: #fff !important;
    border-color: #0000ff !important;
}

html.high-contrast .btn-outline-primary {
    background: #fff !important;
    color: #0000ff !important;
    border: 2px solid #0000ff !important;
}

/* Escala de grises */
html.grayscale {
    filter: grayscale(100%);
}

/* Resaltar enlaces */
html.highlight-links a {
    background: #ffff00;
    color: #000;
    padding: 2px 4px;
    border-radius: 2px;
    text-decoration: underline;
    font-weight: 600;
}

/* Fuente legible */
html.readable-font,
html.readable-font * {
    font-family: 'Arial', 'Helvetica', sans-serif !important;
    letter-spacing: 0.05em;
    line-height: 1.8 !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    #accessibility-toggle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        left: 15px;
        bottom: 15px;
    }
    
    #accessibility-panel {
        width: calc(100% - 30px);
        left: -100%;
        bottom: 65px;
    }
    
    #accessibility-panel.open {
        left: 15px;
    }
}

/* ============================================
   ANIMACIONES
   ============================================ */

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

#accessibility-toggle.pulse {
    animation: pulse 2s infinite;
}

/* ============================================
   MODO REDUCIDO DE MOVIMIENTO
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    #accessibility-toggle,
    #accessibility-panel,
    .toggle-button,
    .font-size-controls button {
        transition: none;
    }
    
    #accessibility-toggle.pulse {
        animation: none;
    }
}
