/**
 * Accessibility Toolkit - Frontend Styles
 * Version: 2.1.0 - Bug Fixes
 */

/* ==========================================================================
   CSS Custom Properties (can be overridden by admin settings)
   ========================================================================== */
:root {
    --atk-primary: #2563eb;
    --atk-primary-dark: #1d4ed8;
    --atk-primary-light: #3b82f6;
    --atk-white: #ffffff;
    --atk-gray-50: #f8fafc;
    --atk-gray-100: #f1f5f9;
    --atk-gray-200: #e2e8f0;
    --atk-gray-300: #cbd5e1;
    --atk-gray-400: #94a3b8;
    --atk-gray-500: #64748b;
    --atk-gray-600: #475569;
    --atk-gray-700: #334155;
    --atk-gray-800: #1e293b;
    --atk-gray-900: #0f172a;
    --atk-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --atk-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --atk-radius: 24px;
    --atk-radius-md: 16px;
    --atk-radius-sm: 12px;
    --atk-transition: 0.2s ease;
    /* --atk-panel-width: 420px;  */
    --atk-panel-width: 45%;
    --atk-panel-min-width: 400px;
    --atk-panel-max-width: 800px;
    --atk-z-index: 999999;
}

/* ==========================================================================
   Screen Reader Only
   ========================================================================== */
.atk-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================================================================
   Widget Container - MUST NOT BE AFFECTED BY FILTERS
   ========================================================================== */
#atk-widget {
    position: fixed !important;
    bottom: 24px !important;
    z-index: var(--atk-z-index) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent any filters from affecting widget */
    filter: none !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#atk-widget *,
#atk-widget *::before,
#atk-widget *::after {
    box-sizing: border-box;
    filter: none !important;
}

#atk-widget.atk-position-right {
    right: 24px !important;
}

#atk-widget.atk-position-left {
    left: 24px !important;
}

/* ==========================================================================
   Toggle Button
   ========================================================================== */
.atk-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: var(--atk-primary);
    color: var(--atk-white);
    cursor: pointer;
    box-shadow: var(--atk-shadow);
    transition: transform var(--atk-transition), box-shadow var(--atk-transition);
    outline: none;
}

.atk-toggle-btn:hover {
    transform: scale(1.05);
}

.atk-toggle-btn:focus {
    outline: 3px solid rgba(37, 99, 235, 0.5);
    outline-offset: 3px;
}

.atk-toggle-btn .atk-icon {
    width: 32px;
    height: 32px;
}

/* Size variations */
.atk-size-small .atk-toggle-btn {
    width: 48px;
    height: 48px;
}

.atk-size-small .atk-toggle-btn .atk-icon {
    width: 24px;
    height: 24px;
}

.atk-size-large .atk-toggle-btn {
    width: 72px;
    height: 72px;
}

.atk-size-large .atk-toggle-btn .atk-icon {
    width: 36px;
    height: 36px;
}

/* ==========================================================================
   Panel - Full Overlay Style
   ========================================================================== */
.atk-panel {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: var(--atk-panel-width);
    min-width: var(--atk-panel-min-width);
    max-width: var(--atk-panel-max-width);
    height: 100vh !important;
    background: var(--atk-gray-100) !important;
    box-shadow: var(--atk-shadow);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    display: flex;
    flex-direction: column;
    filter: none !important;
}

.atk-position-left .atk-panel {
    right: auto !important;
    left: 0 !important;
    transform: translateX(-100%);
}

.atk-panel.atk-panel-open {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Panel Header */
.atk-panel-header {
    background: var(--atk-primary);
    color: var(--atk-white);
    padding: 24px 20px 20px;
    text-align: center;
    flex-shrink: 0;
    position: relative;
}

.atk-panel-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

/* Language Selector */
.atk-lang-selector {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.atk-lang-dropdown {
    padding: 6px 32px 6px 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    color: var(--atk-white);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--atk-transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 140px;
}

.atk-lang-dropdown:hover {
    border-color: rgba(255,255,255,0.6);
}

.atk-lang-dropdown:focus {
    outline: none;
    border-color: var(--atk-white);
    background-color: rgba(255,255,255,0.2);
}

.atk-lang-dropdown option {
    background: var(--atk-gray-900);
    color: var(--atk-white);
    padding: 8px;
}

/* Accessibility Statement Button */
.atk-statement-link {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 18px;
    background: rgba(255,255,255,0.15);
    color: var(--atk-white);
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    text-decoration: none;
    transition: all var(--atk-transition);
    border: 1px solid rgba(255,255,255,0.3);
    cursor: pointer;
}

.atk-statement-link:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.6);
    color: var(--atk-white);
}

/* Statement Panel */
.atk-statement-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.atk-statement-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    color: var(--atk-gray-700);
    font-size: 14px;
    line-height: 1.7;
}

.atk-statement-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--atk-gray-900);
    margin: 24px 0 8px 0;
}

.atk-statement-content h3:first-child {
    margin-top: 0;
}

.atk-statement-content p {
    margin: 0 0 12px 0;
}

.atk-statement-content ul {
    margin: 0 0 12px 0;
    padding-left: 20px;
}

.atk-statement-content li {
    margin-bottom: 6px;
}

.atk-statement-content a {
    color: var(--atk-primary);
    text-decoration: underline;
}

.atk-statement-date {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--atk-gray-200);
    color: var(--atk-gray-500);
    font-size: 13px;
}

.atk-panel-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: var(--atk-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--atk-transition);
}

.atk-panel-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.atk-panel-close svg {
    width: 20px;
    height: 20px;
}

/* Panel Content */
.atk-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.atk-panel-content::-webkit-scrollbar {
    width: 6px;
}

.atk-panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.atk-panel-content::-webkit-scrollbar-thumb {
    background: var(--atk-gray-300);
    border-radius: 3px;
}

/* ==========================================================================
   Profile Section
   ========================================================================== */
.atk-profiles-card {
    background: var(--atk-white);
    border-radius: var(--atk-radius);
    padding: 20px;
    margin-bottom: 16px;
}

.atk-profiles-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--atk-gray-800);
    margin: 0 0 16px 0;
}

.atk-profile-item {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--atk-gray-100);
}

.atk-profile-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.atk-profile-item:first-of-type {
    padding-top: 0;
}

.atk-profile-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--atk-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;
}

.atk-profile-icon svg {
    width: 24px;
    height: 24px;
    color: var(--atk-gray-600);
}

.atk-profile-info {
    flex: 1;
}

.atk-profile-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--atk-gray-800);
    margin: 0 0 3px 0;
}

.atk-profile-desc {
    font-size: 13px;
    color: var(--atk-gray-500);
    margin: 0;
}

/* Toggle Switch */
.atk-toggle-switch {
    position: relative;
    width: 52px;
    height: 30px;
    flex-shrink: 0;
}

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

.atk-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--atk-gray-300);
    transition: 0.3s;
    border-radius: 30px;
}

.atk-toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.atk-toggle-switch input:checked + .atk-toggle-slider {
    background-color: var(--atk-primary);
}

.atk-toggle-switch input:checked + .atk-toggle-slider:before {
    transform: translateX(22px);
}

/* ==========================================================================
   Module Cards
   ========================================================================== */
.atk-modules-card {
    background: var(--atk-white);
    border-radius: var(--atk-radius);
    padding: 20px;
    margin-bottom: 16px;
}

.atk-modules-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--atk-gray-800);
    margin: 0 0 16px 0;
}

.atk-modules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.atk-modules-grid.atk-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Individual Module */
.atk-module {
    background: var(--atk-gray-50);
    border-radius: var(--atk-radius-sm);
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: all var(--atk-transition);
    border: 2px solid transparent;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.atk-module:hover {
    background: var(--atk-gray-100);
}

.atk-module:focus {
    outline: 2px solid var(--atk-primary);
    outline-offset: 2px;
}

.atk-module.atk-module-active {
    background: #eff6ff;
    border-color: var(--atk-primary);
}

.atk-module-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 12px;
    color: var(--atk-gray-700);
}

.atk-module.atk-module-active .atk-module-icon {
    color: var(--atk-primary);
}

.atk-module-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 1.5;
}

.atk-module-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--atk-gray-700);
    line-height: 1.3;
}

.atk-module.atk-module-active .atk-module-label {
    color: var(--atk-primary);
}

/* ==========================================================================
   Stepper Module (Font Size, Line Height - 0% to 100% in 10% steps)
   ========================================================================== */
.atk-module-stepper {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    min-height: auto;
}

.atk-module-stepper .atk-module-label {
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
}

.atk-stepper-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    justify-content: center;
}

.atk-stepper-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--atk-primary);
    color: var(--atk-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--atk-transition);
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
}

.atk-stepper-btn:hover {
    background: var(--atk-primary-dark);
    transform: scale(1.05);
}

.atk-stepper-btn:disabled {
    background: var(--atk-gray-300);
    cursor: not-allowed;
    transform: none;
}

.atk-stepper-btn svg {
    width: 22px;
    height: 22px;
}

.atk-stepper-value {
    min-width: 80px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--atk-gray-700);
    padding: 8px 16px;
    background: var(--atk-white);
    border-radius: 8px;
    border: 1px solid var(--atk-gray-200);
}

/* ==========================================================================
   Cycle Module
   ========================================================================== */
.atk-module-cycle {
    flex-direction: column;
    gap: 4px;
}

.atk-cycle-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--atk-primary);
    margin-top: 2px;
}

/* ==========================================================================
   Reset Button
   ========================================================================== */
.atk-reset-btn {
    width: 100%;
    padding: 18px;
    background: var(--atk-primary);
    color: var(--atk-white);
    border: none;
    border-radius: var(--atk-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--atk-transition);
    margin-top: 8px;
}

.atk-reset-btn:hover {
    background: var(--atk-primary-dark);
}

/* ==========================================================================
   Reading Line - Black inner, colored outer border
   ========================================================================== */
.atk-reading-line {
    position: fixed;
    left: 0;
    right: 0;
    height: 18px;
    background: #000000;
    border-top: 3px solid var(--atk-primary);
    border-bottom: 3px solid var(--atk-primary);
    pointer-events: none;
    z-index: calc(var(--atk-z-index) - 1);
    opacity: 0;
    transition: opacity var(--atk-transition);
    /* box-shadow: 0 0 15px var(--atk-primary); */
}

.atk-reading-line.atk-active {
    opacity: 1;
}

/* ==========================================================================
   Reading Mask
   ========================================================================== */
.atk-reading-mask {
    position: fixed;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: calc(var(--atk-z-index) - 1);
    opacity: 0;
    transition: opacity var(--atk-transition);
}

.atk-reading-mask.atk-active {
    opacity: 1;
}

.atk-reading-mask-top {
    top: 0;
}

.atk-reading-mask-bottom {
    bottom: 0;
}

/* Reading Handle - Touch drag handle for mobile */
.atk-reading-handle {
    position: fixed;
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--atk-primary);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: calc(var(--atk-z-index) + 1);
    transform: translateY(-50%);
    touch-action: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    cursor: grab;
}

.atk-reading-handle.atk-active {
    display: flex;
}

.atk-reading-handle-grip {
    color: var(--atk-white);
    font-size: 20px;
    line-height: 1;
    user-select: none;
    pointer-events: none;
}

/* ==========================================================================
   Text Magnifier
   ========================================================================== */
.atk-magnifier {
    position: fixed;
    padding: 16px 20px;
    background: var(--atk-gray-900);
    color: var(--atk-white);
    font-size: 28px;
    line-height: 1.4;
    border-radius: var(--atk-radius-sm);
    pointer-events: none;
    z-index: calc(var(--atk-z-index) + 1);
    opacity: 0;
    transition: opacity var(--atk-transition);
    max-width: 450px;
    box-shadow: var(--atk-shadow);
}

.atk-magnifier.atk-active {
    opacity: 1;
}

/* ==========================================================================
   Custom Cursor
   ========================================================================== */
.atk-custom-cursor {
    position: fixed;
    width: 64px;
    height: 64px;
    border: 4px solid var(--atk-gray-900);
    outline: 2px solid var(--atk-primary-dark);
    outline-offset: 0px;
    border-radius: 50%;
    pointer-events: none;
    z-index: calc(var(--atk-z-index) + 2);
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity var(--atk-transition);
}

.atk-custom-cursor::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: var(--atk-gray-900);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    outline: 2px solid var(--atk-primary-dark);
    outline-offset: 0px;
}

.atk-custom-cursor.atk-active {
    opacity: 1;
}

body.atk-bigger-cursor,
body.atk-bigger-cursor * {
    cursor: none !important;
}

/* ==========================================================================
   Accessibility Styles Applied to Body
   ========================================================================== */

/* Text Size - Applied to html for rem inheritance + all text elements for px-based sizes */
html.atk-text-size-10 { font-size: 110% !important; }
html.atk-text-size-20 { font-size: 120% !important; }
html.atk-text-size-30 { font-size: 130% !important; }
html.atk-text-size-40 { font-size: 140% !important; }
html.atk-text-size-50 { font-size: 150% !important; }
html.atk-text-size-60 { font-size: 160% !important; }
html.atk-text-size-70 { font-size: 170% !important; }
html.atk-text-size-80 { font-size: 180% !important; }
html.atk-text-size-90 { font-size: 190% !important; }
html.atk-text-size-100 { font-size: 200% !important; }

/* Scale elements that use px-based font sizes */
html[class*="atk-text-size-"] body p,
html[class*="atk-text-size-"] body span,
html[class*="atk-text-size-"] body a,
html[class*="atk-text-size-"] body li,
html[class*="atk-text-size-"] body td,
html[class*="atk-text-size-"] body th,
html[class*="atk-text-size-"] body label,
html[class*="atk-text-size-"] body input,
html[class*="atk-text-size-"] body textarea,
html[class*="atk-text-size-"] body select,
html[class*="atk-text-size-"] body button,
html[class*="atk-text-size-"] body h1,
html[class*="atk-text-size-"] body h2,
html[class*="atk-text-size-"] body h3,
html[class*="atk-text-size-"] body h4,
html[class*="atk-text-size-"] body h5,
html[class*="atk-text-size-"] body h6,
html[class*="atk-text-size-"] body blockquote,
html[class*="atk-text-size-"] body figcaption,
html[class*="atk-text-size-"] body div {
    font-size: inherit !important;
}

/* Exclude the accessibility widget from text scaling */
html[class*="atk-text-size-"] #atk-widget,
html[class*="atk-text-size-"] #atk-widget * {
    font-size: revert !important;
}

/* Line Height - 10% increments from 0 to 100% */
body.atk-line-height-10 * { line-height: 1.6 !important; }
body.atk-line-height-20 * { line-height: 1.7 !important; }
body.atk-line-height-30 * { line-height: 1.8 !important; }
body.atk-line-height-40 * { line-height: 1.9 !important; }
body.atk-line-height-50 * { line-height: 2.0 !important; }
body.atk-line-height-60 * { line-height: 2.1 !important; }
body.atk-line-height-70 * { line-height: 2.2 !important; }
body.atk-line-height-80 * { line-height: 2.3 !important; }
body.atk-line-height-90 * { line-height: 2.4 !important; }
body.atk-line-height-100 * { line-height: 2.5 !important; }

/* Letter Spacing - Simple on/off */
body.atk-letter-spacing * { 
    letter-spacing: 0.12em !important; 
}

/* Font Weight */
body.atk-font-weight * { font-weight: 700 !important; }

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

/* Dyslexic Font */
@font-face {
    font-family: 'OpenDyslexic';
    src: url('../fonts/OpenDyslexic-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenDyslexic';
    src: url('../fonts/OpenDyslexic-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

body.atk-dyslexic-font,
body.atk-dyslexic-font * {
    font-family: 'OpenDyslexic', Arial, sans-serif !important;
}

/* Text Align */
body.atk-text-align-left * { text-align: left !important; }
body.atk-text-align-center * { text-align: center !important; }
body.atk-text-align-right * { text-align: right !important; }

/* Highlight Links */
body.atk-highlight-links a {
    background-color: #ffff00 !important;
    color: #000000 !important;
    padding: 2px 6px !important;
    text-decoration: underline !important;
    border-radius: 3px !important;
}

/* ==========================================================================
   Color Contrast Modes - EXCLUDE WIDGET
   ========================================================================== */

/* Dark Contrast */
body.atk-dark-contrast {
    background: #000 !important;
}

body.atk-dark-contrast *:not(#atk-widget):not(#atk-widget *):not(.atk-backdrop) {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #333 !important;
}

body.atk-dark-contrast img:not(#atk-widget img) {
    opacity: 0.85;
}

/* Light Contrast */
body.atk-light-contrast {
    background: #fff !important;
}

body.atk-light-contrast *:not(#atk-widget):not(#atk-widget *):not(.atk-backdrop):not(img) {
    background-color: #fff !important;
    color: #000 !important;
    border-color: #000 !important;
}

/* Don't affect images in light contrast */
body.atk-light-contrast img {
    /* Keep images as they are */
}

/* High Contrast */
body.atk-high-contrast {
    background: #000 !important;
}

body.atk-high-contrast *:not(#atk-widget):not(#atk-widget *):not(.atk-backdrop):not(img) {
    background-color: #000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}

body.atk-high-contrast a:not(#atk-widget a) {
    color: #00ffff !important;
}

/* Don't affect images in high contrast */
body.atk-high-contrast img {
    /* Keep images as they are */
}

/* Monochrome - EXCLUDE WIDGET */
body.atk-monochrome *:not(#atk-widget):not(#atk-widget *):not(.atk-backdrop):not(.atk-reading-line):not(.atk-reading-mask):not(.atk-magnifier):not(.atk-custom-cursor) {
    filter: grayscale(100%) !important;
}

/* Saturation - applied to html to avoid stacking filters on individual elements */
html.atk-saturation-10 { filter: saturate(1.2) !important; }
html.atk-saturation-20 { filter: saturate(1.4) !important; }
html.atk-saturation-30 { filter: saturate(1.6) !important; }
html.atk-saturation-40 { filter: saturate(1.8) !important; }
html.atk-saturation-50 { filter: saturate(2.0) !important; }
html.atk-saturation-60 { filter: saturate(2.2) !important; }
html.atk-saturation-70 { filter: saturate(2.4) !important; }
html.atk-saturation-80 { filter: saturate(2.6) !important; }
html.atk-saturation-90 { filter: saturate(2.8) !important; }
html.atk-saturation-100 { filter: saturate(3.0) !important; }

/* ==========================================================================
   Orientation Styles
   ========================================================================== */

/* Stop Animations - EXCLUDE WIDGET */
body.atk-stop-animations *:not(#atk-widget):not(#atk-widget *):not(.atk-panel):not(.atk-backdrop),
body.atk-stop-animations *:not(#atk-widget):not(#atk-widget *):not(.atk-panel):not(.atk-backdrop)::before,
body.atk-stop-animations *:not(#atk-widget):not(#atk-widget *):not(.atk-panel):not(.atk-backdrop)::after {
    animation: none !important;
    animation-duration: 0s !important;
    transition: none !important;
}

/* Highlight Titles - BLACK text on YELLOW background */
body.atk-highlight-titles h1:not(#atk-widget h1),
body.atk-highlight-titles h2:not(#atk-widget h2),
body.atk-highlight-titles h3:not(#atk-widget h3),
body.atk-highlight-titles h4:not(#atk-widget h4),
body.atk-highlight-titles h5:not(#atk-widget h5),
body.atk-highlight-titles h6:not(#atk-widget h6) {
    background: linear-gradient(to right, #fef08a, #fde047) !important;
    color: #000000 !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    /* display: inline-block !important; */
}

/* Highlight Content */
body.atk-highlight-content *:not(#atk-widget):not(#atk-widget *):hover {
    outline: 3px solid var(--atk-primary) !important;
    outline-offset: 3px !important;
}

/* Keyboard Navigation */
body.atk-keyboard-nav *:focus {
    outline: 3px solid var(--atk-primary) !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.25) !important;
}

/* Hide Images - COMPLETELY HIDDEN */
body.atk-hide-images img:not(#atk-widget img),
body.atk-hide-images svg:not(#atk-widget svg),
body.atk-hide-images picture,
body.atk-hide-images figure img,
body.atk-hide-images [style*="background-image"]:not(#atk-widget *) {
    visibility: hidden !important;
    opacity: 0 !important;
}

/* ==========================================================================
   Accessibility Profiles - EXCLUDE WIDGET FROM ALL FILTERS
   ========================================================================== */

/* ==========================================================================
   TTS Highlight for clicked text
   ========================================================================== */
.atk-tts-highlight {
    background-color: var(--atk-primary) !important;
    color: #fff !important;
    padding: 2px 4px;
    border-radius: 3px;
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */
@media (max-width: 480px) {
    #atk-widget {
        bottom: 16px !important;
    }
    
    #atk-widget.atk-position-right {
        right: 16px !important;
    }
    
    #atk-widget.atk-position-left {
        left: 16px !important;
    }
    
    .atk-panel {
        width: 100% !important;
    }
    
    .atk-modules-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .atk-modules-grid.atk-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .atk-module {
        padding: 16px 10px;
        min-height: 90px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    #atk-widget,
    .atk-reading-line,
    .atk-reading-mask,
    .atk-magnifier,
    .atk-custom-cursor,
    .atk-backdrop {
        display: none !important;
    }
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .atk-panel,
    .atk-toggle-btn,
    .atk-module {
        transition: none !important;
    }
}

/* ==========================================================================
   Backdrop Overlay
   ========================================================================== */
.atk-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.4) !important;
    z-index: calc(var(--atk-z-index) - 1) !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    filter: none !important;
}

.atk-backdrop.atk-active {
    opacity: 1;
    visibility: visible;
}
