/**
 * EVAS Accessibility Features Styles
 *
 * Styles for all 40+ accessibility features.
 *
 * @package Everyone_Accessibility_Suite
 * @version 1.0.0
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    --evas-content-scale: 1;
    --evas-font-size: 100%;
    --evas-line-height: 1.5;
    --evas-letter-spacing: 0px;
    --evas-highlight-color: #ffeb3b;
    --evas-highlight-title-bg: rgba(255, 235, 59, 0.3);
    --evas-highlight-link-bg: rgba(33, 150, 243, 0.2);
    --evas-cursor-size: 48px;
}

/* ==========================================================================
   Readable Font
   ========================================================================== */

.evas-readable-font,
.evas-readable-font * {
    font-family: 'Arial', 'Helvetica Neue', 'Helvetica', sans-serif !important;
}

/* ==========================================================================
   Dyslexia Font
   ========================================================================== */

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

/* ==========================================================================
   Color Modes
   ========================================================================== */

/* Dark Contrast */
.evas-dark-contrast {
    background-color: #000 !important;
    color: #fff !important;
}

.evas-dark-contrast *:not(.evas-panel):not(.evas-panel *) {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}

.evas-dark-contrast a:not(.evas-panel a) {
    color: #ffff00 !important;
}

.evas-dark-contrast img:not(.evas-panel img) {
    filter: invert(1) hue-rotate(180deg);
}

/* Light Contrast */
.evas-light-contrast {
    background-color: #fff !important;
    color: #000 !important;
}

.evas-light-contrast *:not(.evas-panel):not(.evas-panel *) {
    background-color: #fff !important;
    color: #000 !important;
    border-color: #000 !important;
}

.evas-light-contrast a:not(.evas-panel a) {
    color: #0000ff !important;
}

/* Monochrome */
body.evas-monochrome {
    filter: grayscale(100%) !important;
}

/* High Saturation */
body.evas-high-saturation {
    filter: saturate(200%) !important;
}

/* Low Saturation */
body.evas-low-saturation {
    filter: saturate(50%) !important;
}

/* Exclude admin bar, toggle wrapper and panel from saturation filter */
body.evas-low-saturation #wpadminbar,
body.evas-low-saturation .evas-toggle-wrapper,
body.evas-low-saturation .evas-toggle-wrapper *,
body.evas-low-saturation #evas-panel,
body.evas-low-saturation #evas-panel * {
    filter: none !important;
}

/* High Contrast */
body.evas-high-contrast {
    filter: contrast(150%) !important;
}

/* Ensure toggle wrapper and panel are never affected by body filters */
.evas-toggle-wrapper,
#evas-panel,
#evas-panel * {
    filter: none !important;
}

/* ==========================================================================
   Visual Adjustments
   ========================================================================== */

/* Highlight Titles */
.evas-highlighted-title {
    background-color: var(--evas-highlight-title-bg) !important;
    padding: 0.25em 0.5em !important;
    border-left: 4px solid var(--evas-highlight-color) !important;
}

/* Highlight Links */
.evas-highlighted-link {
    background-color: var(--evas-highlight-link-bg) !important;
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
    padding: 0.1em 0.2em !important;
}

/* Highlight Hover */
.evas-highlight-hover *:hover {
    outline: 3px solid #2196f3 !important;
    outline-offset: 2px !important;
}

/* Highlight Focus */
.evas-highlight-focus *:focus {
    outline: 3px solid #ff5722 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 6px rgba(255, 87, 34, 0.3) !important;
}

/* Text Alignment */
.evas-align-left *:not(.evas-panel):not(.evas-panel *) {
    text-align: left !important;
}

.evas-align-center *:not(.evas-panel):not(.evas-panel *) {
    text-align: center !important;
}

.evas-align-right *:not(.evas-panel):not(.evas-panel *) {
    text-align: right !important;
}

/* ==========================================================================
   Media Control
   ========================================================================== */

/* Hide Images */
.evas-hidden-image {
    opacity: 0.1 !important;
    filter: blur(5px) !important;
}

/* Hide Emoji */
.evas-hide-emoji img.emoji,
.evas-hide-emoji img.wp-smiley,
.evas-hide-emoji .emoji {
    display: none !important;
}

/* Stop Animations */
.evas-stop-animations *,
.evas-stop-animations *::before,
.evas-stop-animations *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
}

/* ==========================================================================
   Helpful Tools
   ========================================================================== */

/* Text Magnifier */
#evas-text-magnifier {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 24px;
    line-height: 1.4;
    max-width: 400px;
    pointer-events: none;
    z-index: 999998;
    display: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 2px solid #fff;
}

/* Reading Guide */
#evas-reading-guide {
    position: fixed;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, #ff5722, transparent);
    pointer-events: none;
    z-index: 999997;
    box-shadow: 0 0 10px rgba(255, 87, 34, 0.5);
}

/* Reading Mask */
#evas-reading-mask-top,
#evas-reading-mask-bottom {
    position: fixed;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    pointer-events: none;
    z-index: 999996;
}

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

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

/* Cognitive Reading */
.evas-cognitive-bold {
    font-weight: 700 !important;
    color: inherit;
}

/* Useful Links Panel */
#evas-useful-links {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 999995;
    width: 300px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#evas-useful-links .evas-useful-links-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #2271b1;
    color: #fff;
}

#evas-useful-links .evas-useful-links-header h3 {
    margin: 0;
    font-size: 16px;
}

#evas-useful-links .evas-close-useful-links {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

#evas-useful-links .evas-useful-links-list {
    list-style: none;
    margin: 0;
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}

#evas-useful-links .evas-useful-links-list li {
    margin: 0;
    padding: 0;
}

#evas-useful-links .evas-useful-links-list a {
    display: block;
    padding: 10px 15px;
    color: #1e1e1e;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s;
}

#evas-useful-links .evas-useful-links-list a:hover {
    background: #f0f0f1;
}

/* ==========================================================================
   Big Cursors
   ========================================================================== */

.evas-big-black-cursor,
.evas-big-black-cursor * {
    cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24"><path fill="%23000" stroke="%23fff" stroke-width="1" d="M5.5 3.21V20.79l4.5-4.5h7.62l-12.12-13.08z"/></svg>') 0 0, auto !important;
}

.evas-big-black-cursor a,
.evas-big-black-cursor button,
.evas-big-black-cursor [role="button"],
.evas-big-black-cursor input[type="submit"],
.evas-big-black-cursor input[type="button"] {
    cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24"><path fill="%23000" stroke="%23fff" stroke-width="1" d="M11 1v6h2V1zm-4.5 2.3l-1.4 1.4 4.2 4.2 1.4-1.4zM17.5 3.3l-4.2 4.2 1.4 1.4 4.2-4.2zM11 9c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zM1 11v2h6v-2zm16 0v2h6v-2zm-10.3 6.5l-4.2 4.2 1.4 1.4 4.2-4.2zm8.6 0l-1.4 1.4 4.2 4.2 1.4-1.4zM11 17v6h2v-6z"/></svg>') 12 12, pointer !important;
}

.evas-big-white-cursor,
.evas-big-white-cursor * {
    cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24"><path fill="%23fff" stroke="%23000" stroke-width="1" d="M5.5 3.21V20.79l4.5-4.5h7.62l-12.12-13.08z"/></svg>') 0 0, auto !important;
}

.evas-big-white-cursor a,
.evas-big-white-cursor button,
.evas-big-white-cursor [role="button"],
.evas-big-white-cursor input[type="submit"],
.evas-big-white-cursor input[type="button"] {
    cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24"><path fill="%23fff" stroke="%23000" stroke-width="1" d="M11 1v6h2V1zm-4.5 2.3l-1.4 1.4 4.2 4.2 1.4-1.4zM17.5 3.3l-4.2 4.2 1.4 1.4 4.2-4.2zM11 9c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zM1 11v2h6v-2zm16 0v2h6v-2zm-10.3 6.5l-4.2 4.2 1.4 1.4 4.2-4.2zm8.6 0l-1.4 1.4 4.2 4.2 1.4-1.4zM11 17v6h2v-6z"/></svg>') 12 12, pointer !important;
}

/* ==========================================================================
   Keyboard Navigation
   ========================================================================== */

.evas-keyboard-navigation *:focus {
    outline: 3px solid #2271b1 !important;
    outline-offset: 2px !important;
}

.evas-keyboard-navigation a:focus,
.evas-keyboard-navigation button:focus,
.evas-keyboard-navigation input:focus,
.evas-keyboard-navigation select:focus,
.evas-keyboard-navigation textarea:focus {
    box-shadow: 0 0 0 4px rgba(34, 113, 177, 0.3) !important;
}

/* ==========================================================================
   Controls Panel Styles
   ========================================================================== */

.evas-af-controls-wrapper {
    padding: 10px 0;
}

.evas-section {
    margin-bottom: 20px;
}

.evas-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 12px 0;
    padding: 8px 12px;
    background: #f6f7f7;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.evas-controls-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.evas-profiles-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Action Box (Toggle) */
.evas-action-box {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 80px;
    justify-content: center;
}

.evas-action-box:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.evas-action-box:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.evas-action-box.evas-active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.evas-action-box-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.evas-action-box .evas-icon {
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.8;
}

.evas-action-box.evas-active .evas-icon {
    filter: brightness(0) invert(1);
}

.evas-action-box .evas-title {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
    padding-bottom: 10px;
}

/* Spinner Box */
.evas-spinner-box {
    flex-direction: row;
    justify-content: space-between;
    min-height: 50px;
    padding: 8px 12px;
}

.evas-spinner-box .evas-action-box-content {
    flex-direction: row;
    gap: 8px;
}

.evas-input-spinner-box {
    display: flex;
    align-items: center;
}

.evas-input-spinner-box .evas-control {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f0f0f1;
    border-radius: 20px;
    padding: 2px;
}

.evas-input-spinner-box button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: #1e1e1e;
    transition: background 0.2s;
}

.evas-input-spinner-box button:hover {
    background: #2271b1;
    color: #fff;
}

.evas-input-spinner-box .evas-value {
    min-width: 60px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    padding: 0 8px;
}

/* Profile Box */
.evas-profile-box {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 16px;
}

.evas-profile-box:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.evas-profile-box:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.evas-profile-box.evas-active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.evas-profile-icon {
    width: 40px;
    height: 40px;
    background-color: #f0f0f1;
    border-radius: 50%;
    flex-shrink: 0;
}

.evas-profile-box.evas-active .evas-profile-icon {
    background-color: rgba(255, 255, 255, 0.2);
}

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

.evas-profile-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.evas-profile-description {
    font-size: 12px;
    opacity: 0.8;
    margin: 0;
    line-height: 1.4;
}

/* Reset Button */
.evas-reset-section {
    padding-top: 10px;
    border-top: 1px solid #dcdcde;
    margin-top: 10px;
}

.evas-reset-button {
    width: 100%;
    padding: 12px;
    background: #fff;
    border: 1px solid #dc3232;
    color: #dc3232;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.evas-reset-button:hover {
    background: #dc3232;
    color: #fff;
}

/* ==========================================================================
   Prevent Horizontal Scroll
   ========================================================================== */

/* Fix WooCommerce drawer causing horizontal scroll */
.wc-block-components-drawer__screen-overlay--is-hidden,
.wc-block-components-drawer__screen-overlay--is-hidden * {
    display: none !important;
}

/* Prevent horizontal overflow */
html,
body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 400px) {
    .evas-controls-grid {
        grid-template-columns: 1fr;
    }
}

