/* Usabilis Widget Styles — bundled locally with the plugin (WP-3 fix). */
/* AUTO-GENERATO da api.usabilis.it/widget-styles.php — NON modificare a mano. */
/* Rigenera con build-usabilis-widget-assets.sh. Colore per-sito via wp_add_inline_style(). */

/* Usabilis - Styles */
/* (c) 2025 STUDIO 09 */

:root {
    --wpap-primary: #4A5568;
    --wpap-secondary: #5a6677; /* [FIX A11Y 2026-06-14] era #718096 (3.99:1 su bianco) -> ora ~5:1 */
    --wpap-accent: #1323D4;
    --wpap-accent-hover: #0f1caa;
    --wpap-accent-light: #223fff;
    --wpap-bg: #FFFFFF;
    --wpap-border: #ddd;
    --wpap-text: #2D3748;
    --wpap-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Wrapper per isolare gli stili */
#wpap-wrapper {
    position: relative;
    min-height: 100vh;
}

/* Toggle Button */
.wpap-toggle-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%!important;
    background: var(--wpap-accent);
    padding:0!important;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--wpap-shadow);
    transition: all 0.3s ease;
    z-index: 2147483645;
}

.wpap-toggle-button:hover {
    transform: scale(1.1);
}

.wpap-toggle-button svg {
    width: 28px;
    height: 28px;
    pointer-events: none;
    fill: #fff !important;
}

/* Posizioni bottone */
.wpap-toggle-button.bottom-left {
    left: 20px;
    right: auto;
}

.wpap-toggle-button.middle-right {
    top: 50%;
    transform: translateY(-50%);
    bottom: auto;
}

.wpap-toggle-button.middle-left {
    top: 50%;
    left: 20px;
    right: auto;
    transform: translateY(-50%);
    bottom: auto;
}

/* Overlay */
.wpap-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2147483646;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wpap-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar */
.wpap-sidebar {
    position: fixed;
    top: 0;
    right: -580px;
    width: 90%;
    max-width: 580px;
    height: 100%;
    background-color: #eef1f5;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 2147483647;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

.wpap-sidebar.active {
    right: 0;
}

.wpap-sidebar * {
    box-sizing: border-box;
    font-family: inherit !important;
}

/* Header */
.wpap-sidebar-header {
    background: var(--wpap-accent);
    padding: 30px 20px 25px;
    text-align: center!important;
    position: relative;
}
.wpap-sidebar-header * {
    text-align: center!important;
}
.wpap-close-button {
    position: absolute!important;
    top: 15px!important;
    right: 15px!important;
    background: rgba(255, 255, 255, 0.1)!important;
    /* [FIX A11Y 2026-06-14] Target size 44x44 (WCAG 2.5.5) */
    width: 44px!important;
    height: 44px!important;
    display: flex!important;
    align-items: center!important;
    justify-content: center!important;
    border-radius: 6px!important;
    transition: background 0.2s!important;
    border: none!important;
    cursor: pointer!important;
    padding:0!important;
}

.wpap-close-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wpap-close-button svg {
    width: 20px;
    height: 20px;
    color: #ffffff;
}

.wpap-header-icon {
    width: 35px;
    height: 40px;
    background: rgba(255, 255, 255, 0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.wpap-header-icon svg{
    height:40px;
}

.wpap-sidebar-header h2 {
    margin: 0 0 10px 0!important;
    font-size: 24px!important;
    line-height: 24px!important;
    letter-spacing: 0px!important;
    color: #ffffff;
    font-weight: 600;
    padding-top:20px;
}

body #wpap-sidebar .wpap-sidebar-header.wpap-new-header .wpap-header-subtitle {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    text-align:center!important;
}

.wpap-header-subtitle a {
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
}

/* Content */
.wpap-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}

/* Section */
.wpap-section {
    padding: 20px;
    background-color: #ffffff;
    margin-bottom: 20px;
    border-radius: 12px;
}

.wpap-section > p {
    font-weight: 600;
    text-transform: uppercase;
    margin: 0 0 15px 0;
    font-size: 13px;
    letter-spacing: 0.5px;
    color: #000000;
}

/* Controls Grid */
.wpap-controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* Control */
.wpap-control {
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    padding: 1.25em 0.25em;
    border: 1px solid var(--wpap-border);
    border-radius: 5px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: start !important;
}

/* Forza centratura per tutti gli elementi interni */
.wpap-control * {
    text-align: center !important;
    margin-left: auto;
    margin-right: auto;
}

.wpap-control:hover {
    border-color: var(--wpap-accent);
}

.wpap-control.active {
    background: var(--wpap-accent);
    color: white;
    border-color: var(--wpap-accent);
}

.wpap-control-icon {
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wpap-control-icon svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.wpap-control-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--wpap-text);
    width: 100%;
    text-align: center;
    display: block;
}

.wpap-control.active .wpap-control-label {
    color: white;
}

/* Progress Bars */
.wpap-control-progress {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 14px;
    width:70px;
    justify-content: center !important;
}

.wpap-progress-bar {
    flex: 1;
    background: #E2E8F0;
    border-radius: 15px;
    transition: all 0.3s ease;
    max-width: 14px;
    height: 14px;
}

.wpap-progress-bar.active {
    background: var(--wpap-accent);
}

.wpap-control.active .wpap-progress-bar {
    background: rgba(255, 255, 255, 0.3);
}

.wpap-control.active .wpap-progress-bar.active {
    background: white;
}

/* Reset Button */
.wpap-reset-button-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--wpap-border);
}

.wpap-reset-button {
    width: 100%;
    padding: 12px 20px;
    background: #F7FAFC;
    border: 1px solid var(--wpap-border);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--wpap-text);
    cursor: pointer;
    transition: all 0.2s;
}

.wpap-reset-button:hover {
    background: #EDF2F7;
    border-color: var(--wpap-accent);
}

/* Select Controls */
.wpap-control-select {
    margin-top: 10px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.wpap-control-select select {
    width: 110px;
    padding: 6px 10px;
    border: 1px solid var(--wpap-border);
    color:#000000!important;
    border-radius: 5px;
    font-size: 12px;
    background: white;
    cursor: pointer;
    text-align: center;
    text-align-last: center; /* Per centrare il testo nel select */
}

/* Toggle Controls */
.wpap-control-toggle {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wpap-control-toggle input[type="checkbox"] {
    display: none;
}

.wpap-control-toggle label {
    display: inline-block;
    width: 40px;
    height: 20px;
    background: #E2E8F0;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.wpap-control-toggle label::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.wpap-control-toggle input[type="checkbox"]:checked + label {
    background: var(--wpap-accent);
}

.wpap-control-toggle input[type="checkbox"]:checked + label::after {
    transform: translateX(20px);
}

/* Profiles Section */
.wpap-profiles-section {
    background: #f8f9fa;
}

.wpap-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid var(--wpap-border);
    transition: all 0.2s;
}

.wpap-profile:hover {
    border-color: var(--wpap-accent);
}

.wpap-profile.active {
    border-color: var(--wpap-accent);
    background: #f0f9ff;
}

.wpap-profile-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: #f0f9ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpap-profile-icon svg {
    width: 26px;
    height: 26px;
    fill: var(--wpap-accent);
}

.wpap-profile-content {
    flex: 1;
}

.wpap-profile-content h4 {
    margin: 0 0 4px 0;
    font-size: 14px!important;
    font-weight: 600;
    color: var(--wpap-text);
    line-height: 14px !important;
}

.wpap-profile-content small {
    font-size: 12px!important;
    color: var(--wpap-secondary);
}

.wpap-profile-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpap-toggle-label {
    font-size: 11px!important;
    font-weight: 500;
    color: var(--wpap-secondary);
    line-height: 14px !important;
}

.wpap-toggle-label.on {
    color: var(--wpap-accent);
}

.wpap-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.wpap-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wpap-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 24px;
}

.wpap-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .wpap-slider {
    background-color: var(--wpap-accent);
}

input:checked + .wpap-slider:before {
    transform: translateX(20px);
}

/* ==================================
   EFFETTI ACCESSIBILITÀ
   Modificati per NON influenzare il widget
   ================================== */

/* Bigger Text - gestito interamente via JavaScript per evitare effetti cascata */
/* Le classi wpap-bigger-text-1/2/3 vengono applicate al body solo come marker */

/* Line Height - escludi il sidebar */
body.wpap-line-height-1 #wpap-wrapper > *:not(#wpap-sidebar) *,
body.wpap-line-height-1 #wpap-wrapper > *:not(#wpap-sidebar) {
    line-height: 1.6 !important;
}
body.wpap-line-height-2 #wpap-wrapper > *:not(#wpap-sidebar) *,
body.wpap-line-height-2 #wpap-wrapper > *:not(#wpap-sidebar) {
    line-height: 1.8 !important;
}
body.wpap-line-height-3 #wpap-wrapper > *:not(#wpap-sidebar) *,
body.wpap-line-height-3 #wpap-wrapper > *:not(#wpap-sidebar) {
    line-height: 2 !important;
}

/* Letter Spacing - escludi il sidebar */
body.wpap-letter-spacing-1 #wpap-wrapper > *:not(#wpap-sidebar) *,
body.wpap-letter-spacing-1 #wpap-wrapper > *:not(#wpap-sidebar) {
    letter-spacing: 0.05em !important;
}
body.wpap-letter-spacing-2 #wpap-wrapper > *:not(#wpap-sidebar) *,
body.wpap-letter-spacing-2 #wpap-wrapper > *:not(#wpap-sidebar) {
    letter-spacing: 0.1em !important;
}
body.wpap-letter-spacing-3 #wpap-wrapper > *:not(#wpap-sidebar) *,
body.wpap-letter-spacing-3 #wpap-wrapper > *:not(#wpap-sidebar) {
    letter-spacing: 0.15em !important;
}

/* Readable Font - escludi il sidebar */
body.wpap-readable-font #wpap-wrapper > *:not(#wpap-sidebar) *,
body.wpap-readable-font #wpap-wrapper > *:not(#wpap-sidebar) {
    font-family: Arial, Helvetica, sans-serif !important;
}

/* Dyslexic Font - escludi il sidebar */
body.wpap-dyslexic-font #wpap-wrapper > *:not(#wpap-sidebar) *,
body.wpap-dyslexic-font #wpap-wrapper > *:not(#wpap-sidebar) {
    font-family: 'OpenDyslexic', Arial, sans-serif !important;
}

/* Text Alignment - escludi il sidebar */
body.wpap-align-left #wpap-wrapper > *:not(#wpap-sidebar) * {
    text-align: left !important;
}
body.wpap-align-center #wpap-wrapper > *:not(#wpap-sidebar) * {
    text-align: center !important;
}
body.wpap-align-right #wpap-wrapper > *:not(#wpap-sidebar) * {
    text-align: right !important;
}
body.wpap-align-justify #wpap-wrapper > *:not(#wpap-sidebar) * {
    text-align: justify !important;
}

/* Highlight Links - escludi i link nel sidebar */
body.wpap-highlight-links #wpap-wrapper a:not(#wpap-sidebar a):not(#wpap-sidebar *) {
    background: yellow !important;
    color: black !important;
    padding: 2px 4px !important;
    text-decoration: underline !important;
}

/* Highlight Titles - escludi i titoli nel sidebar */
body.wpap-highlight-titles #wpap-wrapper h1:not(#wpap-sidebar h1):not(#wpap-sidebar *),
body.wpap-highlight-titles #wpap-wrapper h2:not(#wpap-sidebar h2):not(#wpap-sidebar *),
body.wpap-highlight-titles #wpap-wrapper h3:not(#wpap-sidebar h3):not(#wpap-sidebar *),
body.wpap-highlight-titles #wpap-wrapper h4:not(#wpap-sidebar h4):not(#wpap-sidebar *),
body.wpap-highlight-titles #wpap-wrapper h5:not(#wpap-sidebar h5):not(#wpap-sidebar *),
body.wpap-highlight-titles #wpap-wrapper h6:not(#wpap-sidebar h6):not(#wpap-sidebar *) {
    background: #e3f2fd !important;
    padding: 5px 10px !important;
    border-left: 4px solid #2196F3 !important;
}

/* Hide Images - escludi le immagini nel sidebar */
body.wpap-hide-images #wpap-wrapper img:not(#wpap-sidebar img):not(#wpap-sidebar *) {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Cursor - escludi il sidebar */
body.wpap-cursor-pointer #wpap-wrapper > *:not(#wpap-sidebar) * {
    cursor: pointer !important;
}
body.wpap-cursor-crosshair #wpap-wrapper > *:not(#wpap-sidebar) * {
    cursor: crosshair !important;
}
body.wpap-cursor-text #wpap-wrapper > *:not(#wpap-sidebar) * {
    cursor: text !important;
}

/* [FIX A11Y 2026-06-14] Focus visibile SEMPRE sugli elementi interattivi del widget.
   Prima il focus era visibile solo dopo aver attivato la modalità "navigazione tastiera",
   che però non era raggiungibile senza un focus visibile (catch-22). Anello a due toni
   (bianco + blu) visibile su qualsiasi sfondo; outline trasparente per la modalità
   forced-colors / alto contrasto di Windows. */
#wpap-toggle-button:focus-visible,
#wpap-sidebar a:focus-visible,
#wpap-sidebar button:focus-visible,
#wpap-sidebar input:focus-visible,
#wpap-sidebar select:focus-visible,
#wpap-sidebar [role="button"]:focus-visible,
#wpap-sidebar [tabindex]:focus-visible {
    outline: 2px solid transparent !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #1323D4 !important;
    border-radius: 6px !important;
}

/* [FIX A11Y 2026-06-14] Rispetta prefers-reduced-motion: azzera animazioni/transizioni del widget
   (mini-player, reading line, transizioni pannello) per chi ha richiesto meno movimento. */
@media (prefers-reduced-motion: reduce) {
    #wpap-toggle-button, #wpap-sidebar, #wpap-sidebar *,
    #wpap-overlay, #wpap-reading-mini-player, #wpap-reading-line, #wpap-text-magnifier {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Keyboard Navigation Focus - escludi il sidebar */
body.wpap-keyboard-navigation #wpap-wrapper *:focus:not(#wpap-sidebar *) {
    outline: 3px solid #ff6b6b !important;
    outline-offset: 2px !important;
}

/* ==================================
   RESET FORZATO PER IL SIDEBAR
   Per garantire che il sidebar rimanga sempre normale
   ================================== */

#wpap-sidebar,
#wpap-sidebar *,
.wpap-toggle-button,
.wpap-overlay {
    /* Reset font size */
    font-size: initial !important;
    
    /* Reset line height */
    line-height: initial !important;
    
    /* Reset letter spacing */
    letter-spacing: initial !important;
    
    /* Reset text alignment */
    text-align: initial !important;
    
    /* Reset cursor */
    cursor: initial !important;
}

/* Ripristina stili specifici del sidebar */
#wpap-sidebar {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

#wpap-sidebar .wpap-sidebar-header h2 {
    font-size: 24px !important;
    line-height: 24px !important;
    letter-spacing: 0 !important;
    text-align:center!important;
}

#wpap-sidebar .wpap-control-label {
    font-size: 12px !important;
    line-height: 1.2 !important;
    text-align:center!important;
    margin-bottom:8px;
}

#wpap-sidebar .wpap-profile-content h4 {
    font-size: 14px !important;
    line-height: 14px !important;
}

#wpap-sidebar .wpap-profile-content small {
    font-size: 12px !important;
    line-height: 1.2 !important;
}

#wpap-sidebar .wpap-toggle-label {
    font-size: 11px !important;
    line-height: 14px !important;
}

#wpap-sidebar a {
    background: transparent !important;
    color: inherit !important;
    padding: 0 !important;
    text-decoration: none !important;
}

#wpap-sidebar .wpap-header-subtitle a {
    color: #ffffff !important;
}

#wpap-sidebar .wpap-declaration a {
    color: var(--wpap-accent) !important;
}

#wpap-sidebar .wpap-declaration a:hover {
    text-decoration: underline !important;
}

/* Assicura che i cursori nel sidebar siano corretti */
#wpap-sidebar button,
#wpap-sidebar .wpap-control,
#wpap-sidebar select,
#wpap-sidebar input,
#wpap-sidebar label[for] {
    cursor: pointer !important;
}

#wpap-sidebar {
    cursor: default !important;
}

/* Color Filters */
#wpap-wrapper.wpap-filters-active {
    transition: filter 0.3s ease;
}

/* Reading Line */
.wpap-reading-line {
    position: absolute;
    width: 100%;
    height: 20px;
    background: rgba(66, 153, 225, 0.3);
    border-top: 2px solid #4299E1;
    border-bottom: 2px solid #4299E1;
    pointer-events: none;
    z-index: 999997;
    left: 0;
    display: none;
}

/* Reading Mask */
.wpap-reading-mask {
    position: absolute;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 999996;
    left: 0;
    display: none;
}

#wpap-reading-mask-top {
    top: 0;
}

#wpap-reading-mask-bottom {
    bottom: 0;
}

/* Text Magnifier */
.wpap-text-magnifier {
    display: none;
    position: fixed!important;
    width: 300px;
    min-height: 80px;
    max-height: auto;
    background: white;
    border: 2px solid #4299E1;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    z-index: 999999;
    padding: 15px 20px;
    font-size: 150%;
    line-height: 1.4;
    overflow: hidden;
    color: #333;
    font-family: Arial, sans-serif;
}

/* Responsive */
@media (max-width: 768px) {
    .wpap-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .wpap-controls-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wpap-sidebar-header {
        padding: 20px 15px 15px;
    }
    
    .wpap-header-icon {
        width: 40px;
        height: 40px;
    }
    
    .wpap-header-icon svg {
        width: 25px;
        height: 25px;
    }
    
    .wpap-sidebar-header h2 {
        font-size: 22px!important;
    }
}

/* High Contrast Mode Override */
@media (prefers-contrast: high) {
    .wpap-control {
        border-width: 2px;
    }
    
    .wpap-control.active {
        outline: 2px solid white;
        outline-offset: 2px;
    }
}

/* Support for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    /* Disabilita tutte le animazioni del widget */
    .wpap-toggle-button,
    .wpap-overlay,
    .wpap-sidebar,
    .wpap-control,
    .wpap-progress-bar,
    .wpap-switch input + .wpap-slider,
    .wpap-switch input + .wpap-slider:before,
    #wpap-wrapper {
        animation: none !important;
        transition: none !important;
    }
    
    /* Mantieni le transizioni essenziali ma riducile a 0.001s */
    .wpap-sidebar.active {
        transition: right 0.001s !important;
    }
    
    .wpap-overlay.active {
        transition: opacity 0.001s !important;
    }
}

/* Disable Animations Mode */
body.wpap-no-animations * {
    animation: none !important;
}

/* Disabilita solo le transizioni decorative, non quelle funzionali */
body.wpap-no-animations .wpap-toggle-button,
body.wpap-no-animations .wpap-control,
body.wpap-no-animations .wpap-profile,
body.wpap-no-animations .wpap-progress-bar,
body.wpap-no-animations .wpap-switch input + .wpap-slider,
body.wpap-no-animations .wpap-switch input + .wpap-slider:before,
body.wpap-no-animations .wpap-reset-button,
body.wpap-no-animations .wpap-declaration-button {
    transition: none !important;
}

/* Mantieni visibilità ma senza animazione per sidebar e overlay */
body.wpap-no-animations .wpap-sidebar {
    transition: none !important;
}

body.wpap-no-animations .wpap-sidebar.active {
    right: 0 !important;
}

body.wpap-no-animations .wpap-overlay {
    transition: none !important;
}

body.wpap-no-animations .wpap-overlay.active {
    opacity: 1 !important;
}

/* Disabilita effetti hover animati */
body.wpap-no-animations .wpap-control:hover {
    transform: none !important;
    border-color: var(--wpap-accent) !important; /* Mantieni il feedback visivo */
}

body.wpap-no-animations .wpap-toggle-button:hover {
    transform: none !important;
}

/* Disabilita animazioni switch mantenendo la funzionalità */
body.wpap-no-animations .wpap-switch input:checked + .wpap-slider:before {
    transition: none !important;
    transform: translateX(20px);
}

/* Disabilita smooth scroll */
body.wpap-no-animations {
    scroll-behavior: auto !important;
}

/* Disabilita eventuali effetti parallasse */
body.wpap-no-animations [data-parallax],
body.wpap-no-animations .parallax,
body.wpap-no-animations [class*="parallax"] {
    transform: none !important;
    will-change: auto !important;
    background-attachment: scroll !important;
}

/* Fix per elementi che dipendono da transizioni per funzionare */
body.wpap-no-animations .wpap-reading-line,
body.wpap-no-animations .wpap-reading-mask,
body.wpap-no-animations .wpap-text-magnifier {
    transition: none !important;
}

/* Print styles */
@media print {
    .wpap-toggle-button,
    .wpap-sidebar,
    .wpap-overlay,
    .wpap-reading-line,
    .wpap-reading-mask,
    .wpap-text-magnifier {
        display: none !important;
    }
}

/* Dichiarazione di accessibilità */
.wpap-declaration-link {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--wpap-border);
}

.wpap-declaration-button {
    width: 100%;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--wpap-accent);
    color: var(--wpap-accent);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.wpap-declaration-button:hover {
    background: var(--wpap-accent);
    color: white;
}

.wpap-back-button {
    background: transparent!important;
    border: none!important;
    color: var(--wpap-accent)!important;
    font-size: 14px!important;
    cursor: pointer!important;
    padding: 10px 0!important;
    margin-bottom: 20px!important;
    display: flex!important;
    align-items: center!important;
    gap: 5px!important;
}

.wpap-back-button:hover {
    color: #000000!important;
    background: transparent!important;
}

.wpap-declaration {
    padding: 0 10px;
}

.wpap-declaration h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--wpap-text);
}

.wpap-declaration h3 {
    font-size: 16px;
    margin: 20px 0 10px 0;
    color: var(--wpap-text);
}

.wpap-declaration p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: var(--wpap-secondary);
}

.wpap-declaration ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.wpap-declaration li {
    line-height: 1.6;
    margin-bottom: 8px;
    color: var(--wpap-secondary);
}

.wpap-declaration a {
    color: var(--wpap-accent);
    text-decoration: none;
}

.wpap-declaration a:hover {
    text-decoration: underline;
}

.wpap-declaration-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--wpap-border);
    font-size: 12px;
    text-align: center;
    color: var(--wpap-secondary);
}

/* Nascondi widget su mobile quando l'opzione è attiva */
@media (max-width: 768px) {
    body.wpap-hide-on-mobile .wpap-toggle-button,
    body.wpap-hide-on-mobile .wpap-sidebar,
    body.wpap-hide-on-mobile .wpap-overlay,
    body.wpap-hide-on-mobile .wpap-reading-line,
    body.wpap-hide-on-mobile .wpap-reading-mask,
    body.wpap-hide-on-mobile .wpap-text-magnifier {
        display: none !important;
    }
}

/* Supporto per dispositivi con touch ma schermo grande (tablet landscape) */
@media (max-width: 1024px) and (hover: none) and (pointer: coarse) {
    body.wpap-hide-on-mobile .wpap-toggle-button,
    body.wpap-hide-on-mobile .wpap-sidebar,
    body.wpap-hide-on-mobile .wpap-overlay,
    body.wpap-hide-on-mobile .wpap-reading-line,
    body.wpap-hide-on-mobile .wpap-reading-mask,
    body.wpap-hide-on-mobile .wpap-text-magnifier {
        display: none !important;
    }
}

/* Stili per sezioni nascoste */
.wpap-section.wpap-hidden {
    display: none !important;
}

/* Messaggio quando tutte le sezioni sono disabilitate */
.wpap-no-sections-message {
    padding: 40px 20px;
    text-align: center;
    color: #718096;
    font-size: 14px;
}

.wpap-no-sections-message svg {
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}



/* Reading Controls */
.wpap-reading-controls {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--wpap-shadow);
    padding: 15px;
    z-index: 2147483644;
}

.wpap-reading-controls-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wpap-reading-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--wpap-border);
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.wpap-reading-btn:hover {
    background: #f7fafc;
    border-color: var(--wpap-accent);
}

.wpap-reading-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--wpap-text);
}

.wpap-reading-speed {
    padding: 8px 12px;
    border: 1px solid var(--wpap-border);
    border-radius: 6px;
    background: white;
    font-size: 14px;
}

/* Evidenziazione opzionale del testo letto */
.wpap-reading-highlight {
    background: yellow !important;
    color: black !important;
}

/* Click to Read Mode */
body.wpap-click-to-read-active #wpap-wrapper > *:not(#wpap-sidebar):not(#wpap-overlay):not(.wpap-toggle-button) {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" fill="%234299E1" opacity="0.3"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm3 14h-6c-.55 0-1-.45-1-1s.45-1 1-1h6c.55 0 1 .45 1 1s-.45 1-1 1zm0-4h-6c-.55 0-1-.45-1-1s.45-1 1-1h6c.55 0 1 .45 1 1s-.45 1-1 1zm0-4H9c-.55 0-1-.45-1-1s.45-1 1-1h6c.55 0 1 .45 1 1s-.45 1-1 1z" fill="%234299E1"/></svg>'), pointer !important;
}

/* Elemento attualmente in lettura */
.wpap-reading-active {
    background-color: rgba(66, 153, 225, 0.2) !important;
    outline: 2px solid #4299E1 !important;
    outline-offset: 2px !important;
    position: relative !important;
}

/* Mini Player */
.wpap-reading-mini-player {
    position: fixed;
    bottom: 20px;
    right: 90px;
    background: #2D3748;
    color: white;
    padding: 12px 20px;
    border-radius: 35px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 2147483645;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.wpap-stop-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.wpap-stop-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.wpap-stop-btn svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.wpap-reading-text {
    font-size: 14px;
    font-weight: 500;
}

/* Tooltip */
.wpap-click-to-read-tooltip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2D3748;
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 2147483648;
    animation: tooltipIn 0.4s ease-out;
}

@keyframes tooltipIn {
    from {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.wpap-click-to-read-tooltip.fade-out {
    animation: tooltipOut 0.3s ease-out forwards;
}

@keyframes tooltipOut {
    to {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

.wpap-tooltip-content {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 16px;
}

.wpap-tooltip-content svg {
    flex-shrink: 0;
}

/* Hover effect per elementi leggibili */
body.wpap-click-to-read-active p:hover,
body.wpap-click-to-read-active h1:hover,
body.wpap-click-to-read-active h2:hover,
body.wpap-click-to-read-active h3:hover,
body.wpap-click-to-read-active h4:hover,
body.wpap-click-to-read-active h5:hover,
body.wpap-click-to-read-active h6:hover,
body.wpap-click-to-read-active li:hover,
body.wpap-click-to-read-active td:hover,
body.wpap-click-to-read-active th:hover,
body.wpap-click-to-read-active blockquote:hover,
body.wpap-click-to-read-active a:hover,
body.wpap-click-to-read-active button:hover,
body.wpap-click-to-read-active label:hover {
    background-color: rgba(66, 153, 225, 0.1) !important;
    transition: background-color 0.2s;
}

/* Responsive */
@media (max-width: 768px) {
    .wpap-reading-mini-player {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: calc(100% - 40px);
    }
    
    .wpap-click-to-read-tooltip {
        width: 90%;
        padding: 15px 20px;
    }
    
    .wpap-tooltip-content {
        font-size: 14px;
    }
}

/* Mute Audio Visual Feedback */
body.wpap-audio-muted .wpap-control[data-feature="click_to_read"] {
    opacity: 0.6;
    pointer-events: none;
}

<!-- body.wpap-audio-muted .wpap-control[data-feature="click_to_read"] .wpap-control-label::after {
    content: ' (🔇)';
} -->

/* Evidenzia il controllo mute quando attivo */
.wpap-control[data-feature="mute_audio"].active {
    background: #f56565 !important;
    border-color: #e53e3e !important;
}

.wpap-control[data-feature="mute_audio"].active .wpap-control-label {
    color: white !important;
}

.wpap-control[data-feature="mute_audio"].active svg {
    fill: white !important;
}


/* Audio Notification */
.wpap-audio-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    z-index: 2147483648;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
}

.wpap-audio-notification svg {
    width: 20px;
    height: 20px;
}

.wpap-audio-notification.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* Indicatore visivo quando l'audio è disattivato */
body.wpap-audio-muted .wpap-control[data-feature="click_to_read"] {
    opacity: 0.5;
    pointer-events: none;
}

body.wpap-audio-muted .wpap-control[data-feature="click_to_read"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 5px;
}




/* Indicatore funzioni attive */
.wpap-active-indicator {
    position: absolute;
    top: -3px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: #22c55e;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: popIn 0.3s ease-out;
}
#wpap-toggle-button.wpap-toggle-button .wpap-active-indicator svg{
    width: 14px !important;
    height: 14px !important;
}
.wpap-active-indicator.show {
    display: flex;
}

.wpap-active-indicator svg {
    width: 12px;
    height: 12px;
    fill: white;
}

@keyframes popIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
