/**
 * Stili per Accessibilità WP Pro
 * Versione minimalista - solo stili essenziali del plugin
 */

/* Reset e variabili */
:root {
    --wpap-primary: #4A5568;
    --wpap-secondary: #718096;
    --wpap-accent: #34B3E4;
    --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);
}

/* Applica filtri SOLO quando esplicitamente attivati */
html.wpap-filters-active {
    /* I filtri verranno applicati via JS */
}

/* Nascondi elementi accessori di default */
/* .wpap-reading-line,
.wpap-reading-mask,
.wpap-text-magnifier {
    display: none !important;
} */

/* Bottone di apertura */
.wpap-toggle-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--wpap-accent);
    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: 999998;
}


.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;
}

.wpap-toggle-button:hover {
    transform: scale(1.1);
    background: #3182CE;
}

.wpap-toggle-button svg {
    width: 28px;
    height: 28px;
}

/* Overlay */
.wpap-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
    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: 999999;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

/* Header sidebar */
.wpap-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--wpap-border);
    background-color: var(--wpap-accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 999;
    position: relative;
}

/* Nuovo header con dichiarazione */
.wpap-sidebar-header.wpap-new-header {
    background: #34b3e4;
    padding: 30px 20px 25px;
    display: block;
    text-align: center;
    position: relative;
}
@media (max-width: 768px) {
  .wpap-sidebar-header.wpap-new-header{
        padding: 20px 15px 15px;

  }
}

.wpap-new-header .wpap-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}

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

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

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

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

@media (max-width: 768px) {
  .wpap-header-icon{
     width: 40px;
    height: 40px;
  }
  .wpap-header-icon svg {
    width: 25px;
    height: 25px;
}
}
.wpap-new-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #ffffff;
    font-weight: 600;
}
@media (max-width: 768px) {
  .wpap-new-header h2{
     font-size: 22px;
     margin: 0 0 0 0!important;
     padding: 0!important;
  }
}

.wpap-header-subtitle {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.wpap-header-subtitle a ,.wpap-header-subtitle a:hover{
    color: #ffffff;
    font-weight: 600;
}

.wpap-declaration-link {
    background: none;
    border: none;
    color: #ffffff;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    transition: opacity 0.2s;
}

.wpap-declaration-link:hover {
    opacity: 0.8;
}

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

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

.wpap-section.wpap-profiles-section>p {
  font-weight: 600;
  font-size: 90%;
    text-transform: uppercase;
    margin: 0 0 15px 0;
}

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

/* Singolo controllo */
.wpap-control {
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    padding: 1.25em 0.25em 1.25em 0.25em !important;
    border-style: solid !important;
    border-width: 1px 1px 1px 1px !important;
    border-color: var(--wpap-border) !important;
    border-radius: 8px 8px 8px 8px !important;
}

.wpap-control:hover {
    /* background: #EDF2F7; */
    border-color: var(--wpap-accent)!important;
    /* transform: translateY(-2px); */
    /* box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); */
}

.wpap-control.wpap-incremental:hover .wpap-progress-bar {
    transform: scaleY(1.2);
}

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

.wpap-control.active .wpap-control-icon svg {
    color: white;
}

/* Icona controllo */
.wpap-control-icon {
    margin-bottom: 8px;
}

.wpap-control-icon svg {
    width: 30px;
    height: 30px;
    color: #000000;
}

/* Label controllo */
.wpap-control-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--wpap-text);
}

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

/* Controlli incrementali stati */
.wpap-control.wpap-incremental {
    user-select: none;
}

.wpap-control.wpap-incremental:active {
    transform: scale(0.98);
}

/* Progress bars per controlli incrementali */
.wpap-control-progress {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 10px;
    height: 6px;
}

.wpap-progress-bar {
    flex: 1;
    background: #E2E8F0;
    border-radius: 3px;
    transition: all 0.3s ease;
    max-width: 25px;
    transform-origin: center;
}

.wpap-progress-bar.active {
    background: var(--wpap-accent);
    /* animation: fillBar 0.3s ease; */
}

@keyframes fillBar {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@keyframes barPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        filter: brightness(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.wpap-progress-bar.wpap-bar-pulse {
    animation: barPulse 0.4s ease;
}

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

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

/* Select control styling */
.wpap-control-select {
    margin-top: 10px;
}

.wpap-control-select select {
    width: 90%;
    padding: 4px;
    font-size: 11px;
    border: 1px solid var(--wpap-border);
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

/* Toggle switch */
.wpap-control-toggle {
    position: absolute;
    bottom: 10px;
    right: 10px;
}

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

.wpap-control-toggle input[type="checkbox"] + label {
    display: inline-block;
    width: 36px;
    height: 20px;
    background: #CBD5E0;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.wpap-control-toggle input[type="checkbox"] + label::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.3s;
}

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

.wpap-control-toggle input[type="checkbox"]:checked + label::after {
    left: 18px;
}

/* 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);
}

/* Effetti accessibilità - APPLICATI SOLO QUANDO ATTIVI */

/* Bigger Text */
body.wpap-bigger-text-1 { font-size: 110% !important; }
body.wpap-bigger-text-2 { font-size: 120% !important; }
body.wpap-bigger-text-3 { font-size: 130% !important; }

/* Mantieni le proporzioni degli heading */
body.wpap-bigger-text-1 h1 { font-size: 2.2em !important; }
body.wpap-bigger-text-1 h2 { font-size: 1.65em !important; }
body.wpap-bigger-text-1 h3 { font-size: 1.32em !important; }
body.wpap-bigger-text-1 h4 { font-size: 1.1em !important; }

body.wpap-bigger-text-2 h1 { font-size: 2.4em !important; }
body.wpap-bigger-text-2 h2 { font-size: 1.8em !important; }
body.wpap-bigger-text-2 h3 { font-size: 1.44em !important; }
body.wpap-bigger-text-2 h4 { font-size: 1.2em !important; }

body.wpap-bigger-text-3 h1 { font-size: 2.6em !important; }
body.wpap-bigger-text-3 h2 { font-size: 1.95em !important; }
body.wpap-bigger-text-3 h3 { font-size: 1.56em !important; }
body.wpap-bigger-text-3 h4 { font-size: 1.3em !important; }

/* Regole specifiche per WPBakery/Visual Composer */
body.wpap-bigger-text-1 .wpb_wrapper h1 { font-size: calc(32px + 2vw) !important; }
body.wpap-bigger-text-1 .wpb_wrapper h2 { font-size:calc(24px + 1.3vw) !important; }
body.wpap-bigger-text-1 .wpb_wrapper h3 { font-size: 1.32em !important; }
body.wpap-bigger-text-1 .wpb_wrapper h4 { font-size: calc(16px + 0.9vw) !important; }
body.wpap-bigger-text-1 .w-btn-wrapper .w-btn.us-btn-style_1 { font-size: 22px !important; }  

body.wpap-bigger-text-2 .wpb_wrapper h1 { font-size: calc(38px + 2vw) !important; }
body.wpap-bigger-text-2 .wpb_wrapper h2 { font-size: calc(32px + 1.3vw) !important; }
body.wpap-bigger-text-2 .wpb_wrapper h3 { font-size: 1.44em !important; }
body.wpap-bigger-text-2 .wpb_wrapper h4 { font-size: calc(22px + 0.9vw) !important; }
body.wpap-bigger-text-2 .w-btn-wrapper .w-btn.us-btn-style_1 { font-size: 28px !important; }  

body.wpap-bigger-text-3 .wpb_wrapper h1 { font-size: calc(46px + 2vw) !important; }  
body.wpap-bigger-text-3 .wpb_wrapper h2 { font-size: calc(40px + 1.3vw) !important; } 
body.wpap-bigger-text-3 .wpb_wrapper h3 { font-size: 1.56em !important; } 
body.wpap-bigger-text-3 .wpb_wrapper h4 { font-size: calc(28px + 0.9vw) !important; } 
body.wpap-bigger-text-3 .w-btn-wrapper .w-btn.us-btn-style_1 { font-size: 34px !important; }

/* Line Height */
body.wpap-line-height-1 * { line-height: 1.6 !important; }
body.wpap-line-height-2 * { line-height: 1.8 !important; }
body.wpap-line-height-3 * { line-height: 2 !important; }

/* Letter Spacing */
body.wpap-letter-spacing-1 * { letter-spacing: 0.05em !important; }
body.wpap-letter-spacing-2 * { letter-spacing: 0.1em !important; }
body.wpap-letter-spacing-3 * { letter-spacing: 0.15em !important; }

/* Readable Font */
body.wpap-readable-font * {
    font-family: Arial, Helvetica, sans-serif !important;
}

/* Dyslexic Font */
body.wpap-dyslexic-font * {
    font-family: 'OpenDyslexic', Arial, sans-serif !important;
}

/* Text Alignment */
body.wpap-align-left p, body.wpap-align-left div { text-align: left !important; }
body.wpap-align-center p, body.wpap-align-center div { text-align: center !important; }
body.wpap-align-right p, body.wpap-align-right div { text-align: right !important; }
body.wpap-align-justify p, body.wpap-align-justify div { text-align: justify !important; }

/* Highlight Links */
body.wpap-highlight-links a {
    background: #FFF3CD !important;
    color: #856404 !important;
    padding: 2px 4px !important;
    border-radius: 2px !important;
    text-decoration: underline !important;
}

/* Highlight Titles */
body.wpap-highlight-titles h1,
body.wpap-highlight-titles h2,
body.wpap-highlight-titles h3,
body.wpap-highlight-titles h4,
body.wpap-highlight-titles h5,
body.wpap-highlight-titles h6 {
    background: #D1ECF1 !important;
    color: #0C5460 !important;
    padding: 5px 10px !important;
    border-radius: 4px !important;
}

/* Hide Images */
body.wpap-hide-images img {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Nascondi elementi accessori di default */
.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;
}


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

.wpap-text-magnifier {
    display: none;
    position: fixed;
    width: 300px;
    min-height: 80px;
    max-height: 150px;
    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;
    word-wrap: break-word;
}


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

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

/* Cursor styles */
body.wpap-cursor-pointer * { cursor: pointer !important; }
body.wpap-cursor-crosshair * { cursor: crosshair !important; }
body.wpap-cursor-text * { cursor: text !important; }

/* Keyboard Navigation Enhancement */
body.wpap-keyboard-navigation *:focus {
    outline: 3px solid #4299E1 !important;
    outline-offset: 2px !important;
    z-index: 999999;
    position: relative;
}

/* Responsive */
@media (max-width: 768px) {
    .wpap-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .wpap-controls-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animazioni */
@keyframes clickFeedback {
    0% {
        transform: scale(1) translateY(0);
    }
    50% {
        transform: scale(0.95) translateY(1px);
    }
    100% {
        transform: scale(1) translateY(0);
    }
}

.wpap-control.wpap-clicked {
    animation: clickFeedback 0.2s ease;
}

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

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




/* Sezione Profili */
.wpap-profiles-section {
    background-color: #ffffff;
    margin-bottom: 20px;
}

.wpap-profile {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid var(--wpap-border);
    transition: all 0.3s ease;
}

.wpap-profile:last-child {
    margin-bottom: 0;
}

.wpap-profile:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.wpap-profile-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    background-color: #f5f5f5;
    border-radius: 50%;
}

.wpap-profile-icon svg {
    width: 24px;
    height: 24px;
    color: var(--wpap-secondary);
}

.wpap-profile.active .wpap-profile-icon {
    background-color: var(--wpap-accent);
}

.wpap-profile.active .wpap-profile-icon svg {
    color: white;
}

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

.wpap-profile-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--wpap-text);
    margin: 0 0 4px 0;
}

.wpap-profile-content p {
    font-size: 80%;
    margin: 0;
}

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

.wpap-toggle-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--wpap-secondary);
}

.wpap-toggle-label.off {
    opacity: 1;
}

.wpap-toggle-label.on {
    opacity: 0.5;
}

.wpap-profile.active .wpap-toggle-label.off {
    opacity: 0.5;
}

.wpap-profile.active .wpap-toggle-label.on {
    opacity: 1;
    color: var(--wpap-accent);
}

/* Switch style per i profili */
.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: .4s;
    border-radius: 24px;
}

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

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

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

.wpap-declaration-content{
    padding: 20px;
    background-color: #ffffff;
    margin-bottom: 30px;
    border-radius: 12px 12px 12px 12px !important;
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.wpap-declaration-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--wpap-border);
}

.wpap-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid var(--wpap-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: var(--wpap-text);
}

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

.wpap-back-button svg {
    width: 20px;
    height: 20px;
}

.wpap-declaration-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--wpap-text);
}

.wpap-declaration-body h4 {
    margin-top: 24px;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--wpap-primary);
}

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

.wpap-declaration-body ul li {
    margin-bottom: 8px;
}

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