/* Root UI Styles */
#native-a11y-ui-root {
	position: fixed;
	bottom: 25px;
	right: 25px;
	z-index: 1000000;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

#native-a11y-toggle {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #005a9c;
	color: #fff;
	border: 3px solid #fff;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0,0,0,0.3);
	display: flex;
	align-items: center;
	justify-content: center;
}

#native-a11y-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	align-items: center;
	justify-content: center;
	z-index: 1000001;
}

#native-a11y-modal:not([hidden]) {
	display: flex;
}

.a11y-modal-overlay {
	position: absolute;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.5);
}

.a11y-modal-content {
	position: relative;
	background: #fff;
	width: 400px;
	max-width: 90%;
	max-height: 85vh;
	border-radius: 12px;
	box-shadow: 0 20px 40px rgba(0,0,0,0.4);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.a11y-modal-header {
	padding: 20px;
	background: #f8f9fa;
	border-bottom: 1px solid #eee;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.a11y-modal-body {
	padding: 20px;
	overflow-y: auto;
}

.a11y-section {
	margin-bottom: 25px;
}

.a11y-section h3 {
	font-size: 0.9rem;
	text-transform: uppercase;
	color: #666;
	margin-bottom: 15px;
	border-bottom: 2px solid #005a9c;
}

.a11y-control {
	margin-bottom: 10px;
}

.a11y-control label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	font-size: 0.95rem;
	color: #444;
}

.a11y-button-group {
	display: flex;
	gap: 5px;
	margin-bottom: 10px;
}

.a11y-small-btn {
	flex: 1;
	padding: 8px;
	background: #eee;
	border: 1px solid #ccc;
	border-radius: 4px;
	cursor: pointer;
	font-weight: bold;
}

.a11y-small-btn:hover {
	background: #ddd;
}

.a11y-small-btn:focus {
	outline: 2px solid #005a9c;
}

.a11y-action-btn {
	width: 100%;
	padding: 10px;
	background: #005a9c;
	color: #fff;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-weight: bold;
}

.a11y-modal-footer {
	padding: 15px 20px;
	background: #f8f9fa;
	border-top: 1px solid #eee;
}

.a11y-reset-btn {
	background: #cc0000;
	color: #fff;
	border: none;
	padding: 8px 16px;
	cursor: pointer;
	border-radius: 4px;
}

/* --- Abilities Implementation --- */

/* Distraction-Free Focus Mode (ADHD/Autism) */
html[data-a11y-focus-mode="true"] aside,
html[data-a11y-focus-mode="true"] .sidebar,
html[data-a11y-focus-mode="true"] .widgets,
html[data-a11y-focus-mode="true"] footer:not(#main-footer) {
	display: none !important;
}
html[data-a11y-focus-mode="true"] main,
html[data-a11y-focus-mode="true"] article,
html[data-a11y-focus-mode="true"] #main-content,
html[data-a11y-focus-mode="true"] #content {
	max-width: 900px !important;
	margin: 0 auto !important;
	padding: 40px !important;
	float: none !important;
	background: #fff !important;
}

/* Vestibular / Freeze Motion - simplified to avoid "invisible" paused states */
html[data-a11y-freeze-motion="true"] *,
html[data-a11y-freeze-motion="true"] *::before,
html[data-a11y-freeze-motion="true"] *::after {
	animation-duration: 0.001s !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.001s !important;
}

/* Visual Audio Toast */
.a11y-visual-toast {
	position: fixed;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	background: #333;
	color: #fff;
	padding: 15px 30px;
	border-radius: 50px;
	border: 2px solid #ffcc00;
	z-index: 2000000;
	box-shadow: 0 10px 30px rgba(0,0,0,0.5);
	font-weight: bold;
}

/* High Contrast - Expanded targeting to prevent "yellow on white" */
html[data-a11y-high-contrast="true"] *:not(#native-a11y-ui-root):not(#native-a11y-ui-root *):not(img):not(video) {
	background-color: #000 !important;
	color: #fff !important;
	border-color: #fff !important;
	background-image: none !important;
}

html[data-a11y-high-contrast="true"] a:not(#native-a11y-ui-root *) {
	color: #00ffff !important;
	text-decoration: underline !important;
}

html[data-a11y-high-contrast="true"] h1,
html[data-a11y-high-contrast="true"] h2,
html[data-a11y-high-contrast="true"] h3,
html[data-a11y-high-contrast="true"] h4,
html[data-a11y-high-contrast="true"] p,
html[data-a11y-high-contrast="true"] li,
html[data-a11y-high-contrast="true"] span,
html[data-a11y-high-contrast="true"] strong,
html[data-a11y-high-contrast="true"] em,
html[data-a11y-high-contrast="true"] i,
html[data-a11y-high-contrast="true"] b {
	color: #fff !important;
}

/* Specific yellow highlighting for emphasis in high contrast if needed, but primary text should be white or yellow */
html[data-a11y-high-contrast="true"] .highlight,
html[data-a11y-high-contrast="true"] mark {
	background-color: #ffcc00 !important;
	color: #000 !important;
}

/* Monochrome */
html[data-a11y-monochrome="true"] {
	filter: grayscale(100%) !important;
}

/* Reading Ruler */
#a11y-reading-ruler {
	position: fixed;
	left: 0;
	width: 100%;
	height: 40px;
	background: rgba(255, 255, 0, 0.25);
	border-top: 2px solid yellow;
	border-bottom: 2px solid yellow;
	pointer-events: none;
	z-index: 1000002;
}

/* Large Targets - only affects content links and buttons, not plugin UI */
html[data-a11y-large-targets="true"] #page a,
html[data-a11y-large-targets="true"] #page button,
html[data-a11y-large-targets="true"] #main-content a,
html[data-a11y-large-targets="true"] #main-content button {
	min-width: 44px !important;
	min-height: 44px !important;
	padding: 10px !important;
}

/* Focus Highlight - scoped to content area */
html[data-a11y-focus-highlight="true"] #page *:focus,
html[data-a11y-focus-highlight="true"] #main-content *:focus {
	outline: 3px solid #ffcc00 !important;
	outline-offset: 2px !important;
}

/* Dyslexia Typography - scoped to content areas */
html[data-a11y-dyslexia="true"] body,
html[data-a11y-dyslexia="true"] #page,
html[data-a11y-dyslexia="true"] #main-content,
html[data-a11y-dyslexia="true"] article,
html[data-a11y-dyslexia="true"] .entry-content {
	font-family: "Comic Sans MS", "Comic Sans", cursive, sans-serif !important;
	line-height: 1.8 !important;
	word-spacing: 0.2em !important;
	letter-spacing: 0.05em !important;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}
