/**
 * Stili CSS per l'accessibilità
 * Solo gli stili che non possono essere gestiti con Bootstrap
 */

/* Font per dislessia - non disponibile in Bootstrap */
@font-face {
    font-family: 'OpenDyslexic';
    src: url('https://cdn.jsdelivr.net/npm/opendyslexic@0.91.12/compiled/OpenDyslexic-Regular.otf') format('opentype');
}

.dyslexia-font,
.dyslexia-font * {
    font-family: 'OpenDyslexic', sans-serif !important;
}

/* Modalità alto contrasto */
.high-contrast {
    background-color: #000 !important;
    color: #fff !important;
}

.high-contrast * {
    background-color: #000 !important;
    color: #fff !important;
}

.high-contrast a {
    color: #ffff00 !important;
    text-decoration: underline !important;
}

.high-contrast button,
.high-contrast .btn {
    background-color: #0056b3 !important;
    border: 2px solid #fff !important;
    color: #fff !important;
}

.high-contrast input,
.high-contrast textarea,
.high-contrast select {
    background-color: #000 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
}

.high-contrast .card {
    background-color: #000 !important;
    border: 2px solid #fff !important;
}

.high-contrast .card-header {
    background-color: #333 !important;
    border-bottom: 2px solid #fff !important;
}

/* Bootstrap gestisce già il tema scuro con bg-dark e text-white */

/* Colori invertiti */
.inverted-colors {
    filter: invert(1) !important;
}

.inverted-colors img {
    filter: invert(1) !important;
}

/* Le spaziature ora sono gestite con classi Bootstrap p-1, p-3, p-4 */

/* Cursore grande - non disponibile in Bootstrap */
.cursor-large {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path d="M0 0l12 24l4-4l8 8l3-3l-8-8l4-4z" fill="%23000" stroke="%23fff" stroke-width="2"/></svg>') 0 0, auto;
}

/* Cursore molto grande - non disponibile in Bootstrap */
.cursor-xlarge {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M0 0l16 32l6-6l10 10l4-4l-10-10l6-6z" fill="%23000" stroke="%23fff" stroke-width="2"/></svg>') 0 0, auto;
}

/* I link sottolineati ora usano la classe Bootstrap text-decoration-underline */

/* Disabilita animazioni */
.no-animations *,
.no-animations *:before,
.no-animations *:after {
    animation: none !important;
    transition: none !important;
}

/* Focus migliorato per navigazione da tastiera */
.keyboard-nav *:focus {
    outline: 3px solid #ff6b00 !important;
    outline-offset: 2px !important;
}

.keyboard-nav a:focus,
.keyboard-nav button:focus,
.keyboard-nav input:focus,
.keyboard-nav select:focus,
.keyboard-nav textarea:focus {
    outline: 3px solid #ff6b00 !important;
    outline-offset: 2px !important;
}

/* Supporto per screen reader */
.screen-reader-text {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Miglioramenti per la modalità alto contrasto del sistema */
@media (prefers-contrast: high) {
    * {
        outline: 1px solid !important;
    }
}

/* Supporto per la preferenza di riduzione del movimento */
@media (prefers-reduced-motion: reduce) {
    *,
    *:before,
    *:after {
        animation: none !important;
        transition: none !important;
    }
}

/* Supporto per la preferenza del tema scuro del sistema */
@media (prefers-color-scheme: dark) {
    body:not(.high-contrast):not(.dark-mode):not(.inverted-colors) {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
}