/* Accessibility Widget — widget i načini rada.
   Sve mjere widgeta su u px kako skaliranje teksta ne bi mijenjalo sam widget. */

/* ---------------------------------------------------------------- Načini rada
   Vizualni filteri idu na omotač sadržaja (#awgt-content), a filter se
   aktivira tek kad je bar jedan uključen (klasa .awgt-has-filter). */
#awgt-content {
	--awgt-grayscale: 0;
	--awgt-invert: 0;
	--awgt-contrast: 1;
}
#awgt-content.awgt-grayscale { --awgt-grayscale: 1; }
#awgt-content.awgt-invert    { --awgt-invert: 1; }
#awgt-content.awgt-contrast  { --awgt-contrast: 1.4; }

#awgt-content.awgt-has-filter {
	filter: grayscale(var(--awgt-grayscale))
	        invert(var(--awgt-invert))
	        contrast(var(--awgt-contrast));
}
/* Kod inverzije vrati slike/videe u normalu da ne izgledaju kao negativ. */
#awgt-content.awgt-invert img,
#awgt-content.awgt-invert video,
#awgt-content.awgt-invert picture,
#awgt-content.awgt-invert iframe,
#awgt-content.awgt-invert [style*="background-image"] {
	filter: invert(1);
}

/* Istakni linkove */
#awgt-content.awgt-links a {
	outline: 2px solid #ffbf00 !important;
	outline-offset: 2px !important;
	text-decoration: underline !important;
	background: rgba(255, 191, 0, 0.15) !important;
}

/* Čitljivi font */
#awgt-content.awgt-readable,
#awgt-content.awgt-readable * {
	font-family: Verdana, Tahoma, "Segoe UI", Arial, sans-serif !important;
	letter-spacing: 0.03em !important;
	word-spacing: 0.08em !important;
	line-height: 1.7 !important;
}

/* Bez animacija */
#awgt-content.awgt-noanim *,
#awgt-content.awgt-noanim *::before,
#awgt-content.awgt-noanim *::after {
	animation-duration: 0.001ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.001ms !important;
	scroll-behavior: auto !important;
}

/* Veliki kursor (SVG strelica ~48px) */
#awgt-content.awgt-cursor,
#awgt-content.awgt-cursor * {
	cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M6 4 L6 40 L16 30 L23 44 L30 40 L23 27 L38 27 Z" fill="black" stroke="white" stroke-width="2"/></svg>') 4 4, auto !important;
}

/* ----------------------------------------------------------- Plutajući gumb */
#awgt-launcher {
	position: fixed;
	left: 20px;
	bottom: 90px;
	z-index: 2147483000;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: none;
	background: #1a4a7a;
	color: #fff;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: transform 0.15s ease, background 0.15s ease;
}
#awgt-launcher:hover { background: #123a61; transform: scale(1.05); }
#awgt-launcher:focus-visible { outline: 3px solid #ffbf00; outline-offset: 3px; }
#awgt-launcher svg { width: 32px; height: 32px; display: block; }

/* Ikona u naslovu panela */
.awgt-h-icon { display: inline-flex; }
.awgt-h-icon svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- Panel */
#awgt-panel {
	position: fixed;
	left: 20px;
	bottom: 156px;
	z-index: 2147483000;
	width: 300px;
	max-width: calc(100vw - 40px);
	max-height: calc(100vh - 176px);
	overflow-y: auto;
	background: #fff;
	color: #1a1a1a;
	border-radius: 12px;
	box-shadow: 0 6px 28px rgba(0, 0, 0, 0.28);
	padding: 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.4;
}
#awgt-panel[hidden] { display: none; }

.awgt-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}
#awgt-panel h2 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #1a4a7a;
	display: flex;
	align-items: center;
	gap: 6px;
}
.awgt-close {
	border: none;
	background: transparent;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #666;
	padding: 0 4px;
}
.awgt-close:hover { color: #000; }

/* Red za veličinu teksta */
.awgt-font {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 12px;
}
.awgt-font button {
	flex: 1;
	padding: 10px 0;
	font-size: 16px;
	font-weight: 700;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background: #f1f5f9;
	color: #1a1a1a;
	cursor: pointer;
}
.awgt-font button:hover { background: #e2e8f0; }
.awgt-font-pct {
	min-width: 54px;
	text-align: center;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* Mreža prekidača */
.awgt-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-bottom: 12px;
}
.awgt-toggle {
	padding: 10px 8px;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background: #f8fafc;
	color: #1a1a1a;
	cursor: pointer;
	min-height: 48px;
}
.awgt-toggle:hover { background: #eef2f7; }
.awgt-toggle[aria-pressed="true"] {
	background: #1a4a7a;
	border-color: #1a4a7a;
	color: #fff;
}

.awgt-reset {
	width: 100%;
	padding: 10px;
	font-size: 14px;
	font-weight: 600;
	border: 1px solid #dc2626;
	border-radius: 8px;
	background: #fff;
	color: #dc2626;
	cursor: pointer;
}
.awgt-reset:hover { background: #dc2626; color: #fff; }

/* Vidljiv fokus na svim kontrolama panela (tastatura) */
#awgt-panel button:focus-visible {
	outline: 3px solid #ffbf00;
	outline-offset: 2px;
}

/* Poštuj korisnički izbor smanjenih animacija */
@media (prefers-reduced-motion: reduce) {
	#awgt-launcher { transition: none; }
}
