/* Ultimate WP Accessibility Frontend Toolbar CSS */
.uwpa-toolbar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.uwpa-toolbar-toggle {
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.uwpa-toolbar-toggle:hover, .uwpa-toolbar-toggle:focus {
    background-color: #005177;
    outline: 2px solid #fff;
}

.uwpa-toolbar-toggle .dashicons {
    font-weight: bold;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

/* =========================================
   Motion & Animation Reducer (Pro Feature)
   ========================================= */

/* Triggers automatically if OS setting is active */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Triggers manually when the toolbar button is clicked */
body.uwpa-reduce-motion *,
body.uwpa-reduce-motion *::before,
body.uwpa-reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

/* =========================================
   ADHD Reading Tools (Pro Feature)
   ========================================= */

#uwpa-reading-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
    pointer-events: none;
    display: none;
    /* clip-path will be updated dynamically via JS to create a clear strip */
}
body.uwpa-reading-mask-active #uwpa-reading-mask {
    display: block;
}

#uwpa-reading-guide {
    position: fixed;
    left: 0;
    width: 100vw;
    height: 4px;
    background-color: #ffeb3b; /* High contrast yellow */
    border-bottom: 1px solid #000;
    z-index: 999999;
    pointer-events: none;
    display: none;
}
body.uwpa-reading-guide-active #uwpa-reading-guide {
    display: block;
}

.uwpa-toolbar-panel {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 300px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
}

.uwpa-toolbar-panel[aria-hidden="false"] {
    display: flex;
}

.uwpa-toolbar-header {
    background: #f1f1f1;
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.uwpa-toolbar-header h2 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

#uwpa-toolbar-close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

#uwpa-toolbar-close:hover {
    color: #d63638;
}

.uwpa-toolbar-options {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.uwpa-option-btn {
    background: #f9f9f9;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
}

a.uwpa-option-btn {
    text-decoration: none !important;
    display: block;
    box-sizing: border-box;
}

.uwpa-locked-pro {
    position: relative;
    opacity: 0.8;
}

.uwpa-option-btn:hover, .uwpa-option-btn:focus {
    background: #e6e6e6;
}

.uwpa-option-btn.active {
    background: #0073aa;
    color: #fff;
    border-color: #005177;
}

.uwpa-reset-btn {
    background: #d63638;
    color: #fff;
    border-color: #b32d2e;
    text-align: center;
    margin-top: 10px;
}
.uwpa-reset-btn:hover {
    background: #b32d2e;
}

/* Accessibility Modifications applied to body */
body.uwpa-high-contrast {
    background-color: #000 !important;
    color: #fff !important;
}

body.uwpa-high-contrast * {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}

body.uwpa-high-contrast a {
    color: #ff0 !important;
    text-decoration: underline !important;
}

body.uwpa-grayscale {
    filter: grayscale(100%) !important;
}

body.uwpa-dyslexia-font, body.uwpa-dyslexia-font * {
    font-family: 'OpenDyslexic', 'Comic Sans MS', sans-serif !important;
}

/* Screen reader text (standard WP class) */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* =========================================
   Global Accessibility Fixes
   ========================================= */

/* Ensure highly visible focus outlines for keyboard users */
*:focus-visible {
    outline: 3px solid #005fcc !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.8) !important;
}

/* Force underlines on all links for colorblind users */
body.uwpa-highlight-links-active a {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-decoration-color: #d63638 !important;
}
