/* Reset e protezione stili interni */
#a11y-widget-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    z-index: 999999;
}

#a11y-widget-container * {
    box-sizing: border-box;
    margin: 0; padding: 0;
}

/* Bottone Flottante Principale */
#a11y-btn {
    position: fixed; bottom: 25px; left: 25px;
    width: 50px; height: 50px;
    background-color: var(--accent, #0056b3);
    color: white; border: none; border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex; align-items: center; justify-content: center;
    z-index: 100000;
    transition: transform 0.2s, background-color 0.2s;
}
#a11y-btn:hover { transform: scale(1.1); }
#a11y-btn svg { width: 26px; height: 26px; fill: currentColor; }

/* Pannello Accessibilità */
#a11y-panel {
    position: fixed; bottom: 85px; left: 25px;
    width: 300px; background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 999999;
    opacity: 0; visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column;
    overflow: hidden;
    color: #333;
}
#a11y-panel.open {
    opacity: 1; visibility: visible; transform: translateY(0);
}

.a11y-header {
    background: #f8f9fa; padding: 15px 20px;
    font-weight: bold; font-size: 16px;
    border-bottom: 1px solid #eaeaea;
    display: flex; align-items: center; gap: 10px;
}
.a11y-header svg { width: 20px; height: 20px; fill: var(--accent, #0056b3); }

/* Opzioni */
.a11y-option {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px;
    background: none; border: none; border-bottom: 1px solid #f0f0f0;
    width: 100%; text-align: left;
    cursor: pointer; font-size: 14px; color: #333;
    transition: background 0.2s;
}
.a11y-option:hover { background: #fdfdfd; }
.a11y-option:last-of-type { border-bottom: none; }

.a11y-option-left {
    display: flex; align-items: center; gap: 12px;
}
.a11y-option-left svg { width: 20px; height: 20px; fill: #666; }

/* Switch per indicare l'attivazione */
.a11y-toggle {
    width: 36px; height: 20px;
    background: #ccc; border-radius: 20px;
    position: relative;
    transition: background 0.3s;
}
.a11y-toggle::after {
    content: ''; position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: #fff; border-radius: 50%;
    transition: transform 0.3s;
}
.a11y-option.active .a11y-toggle { background: var(--accent, #28a745); }
.a11y-option.active .a11y-toggle::after { transform: translateX(16px); }

/* Stato per Zoom Testo */
.zoom-status { font-size: 12px; color: #888; display: block; margin-top: 2px; }
.a11y-option.active .zoom-status { color: var(--accent, #28a745); font-weight: bold; }

/* Pulsante Reset */
.a11y-reset {
    margin: 15px; padding: 10px;
    background: #f1f1f1; border: none; border-radius: 8px;
    font-weight: bold; color: #555;
    cursor: pointer; transition: background 0.2s, color 0.2s;
    display: flex; justify-content: center; align-items: center; gap: 8px;
}
.a11y-reset:hover { background: #ff4757; color: #fff; }
.a11y-reset svg { width: 18px; height: 18px; fill: currentColor; }

/* ========================================== */
/* CLASSI APPLICATE AL SITO (ACCESSIBILITÀ)   */
/* ========================================== */

html.a11y-zoom-1 { font-size: 110% !important; }
html.a11y-zoom-2 { font-size: 120% !important; }
html.a11y-contrast { filter: contrast(135%) saturate(120%) brightness(95%); }
html.a11y-grayscale { filter: grayscale(100%); }
html.a11y-readable * { font-family: 'Arial', 'Helvetica', sans-serif !important; letter-spacing: 0.5px !important; line-height: 1.6 !important; }

/* CORREZIONE EVIDENZIA LINK */
html.a11y-links a, 
html.a11y-links a * { 
    outline: 2px solid var(--accent, #ff7a00) !important;
    outline-offset: 2px !important;
    color: var(--accent, #ff7a00) !important;
    background-color: rgba(255, 122, 0, 0.1) !important;
    text-decoration: underline !important;
}

/* WhatsApp Globale */
.wa-floating-global { display: none; position: fixed; bottom: 25px; right: 25px; width: 50px; height: 50px; background-color: #25D366; color: white !important; border-radius: 50%; box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4); z-index: 999999; align-items: center; justify-content: center; transition: transform 0.2s; }
.wa-floating-global:active { transform: scale(0.95); }
@media (max-width: 768px) { .wa-floating-global { display: flex; } }

/* Google Translate Overrides */
.goog-te-banner-frame { display: none !important; }
body { top: 0px !important; }
.goog-tooltip { display: none !important; }
.goog-tooltip:hover { display: none !important; }
.goog-text-highlight { background-color: transparent !important; border: none !important; box-shadow: none !important; }
#goog-gt-tt { display: none !important; }
.VIpgJd-ZVi9od-ORHb-OEVmcd { display: none !important; }
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf { display: none !important; }
