/* ============================================================
   ACCESSIBILITY WIDGET
   ============================================================ */

/* Toggle button */
#a11y-toggle {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 9998;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #1565c0;
	color: #fff;
	border: none;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(21, 101, 192, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
}

#a11y-toggle:hover {
	background: #0d47a1;
	transform: scale(1.1);
}

/* Panel */
#a11y-panel {
	position: fixed;
	left: 16px;
	bottom: 76px;
	z-index: 9999;
	width: 320px;
	max-height: 80vh;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.15);
	overflow: hidden;
	transition: all 0.3s ease;
	transform-origin: bottom left;
}

#a11y-panel.a11y-panel-hidden {
	opacity: 0;
	transform: scale(0.8);
	pointer-events: none;
}

.a11y-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	background: #1565c0;
	color: #fff;
}

.a11y-panel-title {
	font-size: 16px;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 8px;
}

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

.a11y-panel-body {
	padding: 12px 16px;
	max-height: calc(80vh - 52px);
	overflow-y: auto;
}

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

.a11y-section-title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #888;
	margin-bottom: 8px;
}

/* Font controls */
.a11y-font-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
}

.a11y-btn-round {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 2px solid #1565c0;
	background: #fff;
	color: #1565c0;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.15s;
}

.a11y-btn-round:hover {
	background: #1565c0;
	color: #fff;
}

#a11y-font-value {
	font-size: 16px;
	font-weight: 700;
	color: #333;
	min-width: 50px;
	text-align: center;
}

/* Option buttons */
.a11y-options-row,
.a11y-options-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.a11y-option {
	padding: 8px 12px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: #fafafa;
	color: #333;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s;
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.a11y-option:hover {
	border-color: #1565c0;
	background: #e3f2fd;
}

.a11y-option-active {
	background: #1565c0 !important;
	color: #fff !important;
	border-color: #1565c0 !important;
}

/* Reset */
.a11y-reset-section {
	border-top: 1px solid #eee;
	padding-top: 12px;
}

.a11y-btn-reset {
	width: 100%;
	padding: 10px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: #fff;
	color: #d32f2f;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s;
}

.a11y-btn-reset:hover {
	background: #fde8e8;
	border-color: #d32f2f;
}

/* ============================================================
   ACCESSIBILITY EFFECTS
   ============================================================ */

/* Contrasto alto */
.a11y-contrast-high {
	filter: contrast(1.5);
}

/* Contrasto scuro */
.a11y-contrast-dark {
	filter: invert(1) hue-rotate(180deg);
}
.a11y-contrast-dark img,
.a11y-contrast-dark video,
.a11y-contrast-dark iframe {
	filter: invert(1) hue-rotate(180deg);
}

/* Contrasto chiaro */
.a11y-contrast-light {
	background: #fff !important;
	color: #000 !important;
}
.a11y-contrast-light * {
	color: #000 !important;
	border-color: #000 !important;
}

/* Font dislessia */
.a11y-dyslexia,
.a11y-dyslexia * {
	font-family: 'OpenDyslexic', 'Comic Sans MS', 'Arial', sans-serif !important;
	letter-spacing: 0.05em !important;
	word-spacing: 0.1em !important;
}

/* Evidenzia link */
.a11y-link-highlight a {
	outline: 3px solid #ff9800 !important;
	outline-offset: 2px;
	text-decoration: underline !important;
}

/* Cursore grande */
.a11y-big-cursor,
.a11y-big-cursor * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='16' cy='16' r='14' fill='%231565c0' stroke='white' stroke-width='2'/%3E%3C/svg%3E") 16 16, auto !important;
}

/* Spaziatura testo */
.a11y-text-spacing {
	letter-spacing: 0.12em !important;
	word-spacing: 0.3em !important;
	line-height: 2 !important;
}

/* Scala di grigi */
.a11y-grayscale {
	filter: grayscale(1);
}

/* Alta saturazione */
.a11y-high-saturation {
	filter: saturate(2);
}

/* Stop animazioni */
.a11y-no-animations,
.a11y-no-animations * {
	animation: none !important;
	transition: none !important;
}

/* Mobile */
@media (max-width: 767px) {
	#a11y-panel {
		width: calc(100vw - 32px);
		left: 16px;
		right: 16px;
	}

	#a11y-toggle {
		width: 42px;
		height: 42px;
		bottom: 12px;
		left: 12px;
	}
}
