/* =====================================================================
   VT Pristupačnost – stilovi
   Sve je vlastito i lokalno (bez vanjskih fontova/poziva).
   Widget koristi px mjere da ga povećanje teksta na stranici ne mijenja.
   ===================================================================== */

#vtp-root {
	--vtp-accent: #1a56db;
	--vtp-accent-text: #ffffff;
	--vtp-panel-bg: #ffffff;
	--vtp-panel-text: #15202b;
	--vtp-border: #d7dde5;
	--vtp-btn-size: 56px;
	--vtp-icon: 26px;
	position: fixed;
	bottom: 20px;
	z-index: 2147483000; /* iznad gotovo svega */
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
	line-height: 1.4 !important;
}

#vtp-root.vtp-pos-right { right: 20px; }
#vtp-root.vtp-pos-left  { left: 20px; }

#vtp-root.vtp-size-large {
	--vtp-btn-size: 66px;
	--vtp-icon: 32px;
}

/* ---------- Glavni gumb ---------- */
#vtp-toggle {
	width: var(--vtp-btn-size);
	height: var(--vtp-btn-size);
	border-radius: 50%;
	border: none;
	background: var(--vtp-accent);
	color: var(--vtp-accent-text);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
	transition: transform .15s ease, box-shadow .15s ease;
	padding: 0;
}
#vtp-toggle svg { width: var(--vtp-icon); height: var(--vtp-icon); display: block; }
#vtp-toggle:hover { transform: scale(1.06); }
#vtp-toggle:focus-visible {
	outline: 3px solid #ffffff;
	box-shadow: 0 0 0 6px var(--vtp-accent);
}

/* ---------- Panel ---------- */
#vtp-panel {
	position: absolute;
	bottom: calc(var(--vtp-btn-size) + 12px);
	width: 300px;
	max-width: calc(100vw - 40px);
	max-height: 78vh;
	overflow-y: auto;
	background: var(--vtp-panel-bg) !important;
	color: var(--vtp-panel-text) !important;
	border: 1px solid var(--vtp-border);
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
	padding: 14px;
	display: none;
}
#vtp-root.vtp-pos-right #vtp-panel { right: 0; }
#vtp-root.vtp-pos-left  #vtp-panel { left: 0; }
#vtp-panel.vtp-open { display: block; }

.vtp-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
	border-bottom: 1px solid var(--vtp-border);
	padding-bottom: 8px;
}
.vtp-title {
	font-size: 17px !important;
	margin: 0 !important;
	color: var(--vtp-panel-text) !important;
	font-weight: 700 !important;
	padding: 0 !important;
}
.vtp-close {
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: var(--vtp-panel-text) !important;
	padding: 0 4px;
	border-radius: 6px;
}
.vtp-close:focus-visible { outline: 2px solid var(--vtp-accent); }

.vtp-options { display: flex; flex-direction: column; gap: 8px; }

/* Red s veličinom teksta */
.vtp-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	border: 1px solid var(--vtp-border);
	border-radius: 10px;
	padding: 8px 10px;
}
.vtp-row-label { font-size: 14px !important; font-weight: 600 !important; color: var(--vtp-panel-text) !important; }
.vtp-textsize-controls { display: flex; align-items: center; gap: 8px; }
.vtp-textsize-controls button {
	width: 34px; height: 34px;
	border: 1px solid var(--vtp-border);
	background: #f2f5f9;
	border-radius: 8px;
	cursor: pointer;
	font-size: 15px !important;
	font-weight: 700 !important;
	color: var(--vtp-panel-text) !important;
}
.vtp-textsize-controls button:hover { background: #e6ebf2; }
.vtp-textsize-controls button:focus-visible { outline: 2px solid var(--vtp-accent); }
.vtp-textsize-val { min-width: 42px; text-align: center; font-size: 13px !important; font-weight: 600 !important; color: var(--vtp-panel-text) !important; }

/* Prekidači */
.vtp-toggle-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	text-align: left;
	border: 1px solid var(--vtp-border);
	background: #fff !important;
	border-radius: 10px;
	padding: 10px;
	cursor: pointer;
	font-size: 14px !important;
	color: var(--vtp-panel-text) !important;
}
.vtp-toggle-btn:hover { background: #f5f8fc !important; }
.vtp-toggle-btn:focus-visible { outline: 2px solid var(--vtp-accent); }
.vtp-toggle-label { font-weight: 600 !important; color: var(--vtp-panel-text) !important; }
.vtp-check {
	width: 20px; height: 20px;
	border: 2px solid var(--vtp-border);
	border-radius: 5px;
	flex: 0 0 auto;
	position: relative;
	background: #fff;
}
.vtp-toggle-btn[aria-pressed="true"] { border-color: var(--vtp-accent); background: #eef3ff !important; }
.vtp-toggle-btn[aria-pressed="true"] .vtp-check { background: var(--vtp-accent); border-color: var(--vtp-accent); }
.vtp-toggle-btn[aria-pressed="true"] .vtp-check::after {
	content: "";
	position: absolute;
	left: 5px; top: 1px;
	width: 6px; height: 11px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* Reset */
.vtp-reset {
	margin-top: 12px;
	width: 100%;
	border: none;
	background: var(--vtp-accent);
	color: var(--vtp-accent-text) !important;
	border-radius: 10px;
	padding: 11px;
	cursor: pointer;
	font-size: 14px !important;
	font-weight: 700 !important;
}
.vtp-reset:hover { filter: brightness(.93); }
.vtp-reset:focus-visible { outline: 3px solid var(--vtp-panel-text); }

.vtp-note {
	margin: 10px 2px 0 !important;
	font-size: 11px !important;
	color: #5a6b7b !important;
	text-align: center;
	line-height: 1.4 !important;
}

/* Vodič za čitanje (vodoravna linija koja prati miš) */
#vtp-reading-line {
	position: fixed;
	left: 0;
	width: 100%;
	height: 0;
	border-top: 3px solid rgba(20, 60, 200, .9);
	box-shadow: 0 0 0 9999px rgba(0, 0, 0, .04);
	pointer-events: none;
	display: none;
	z-index: 2147482000;
}
#vtp-reading-line.vtp-on { display: block; }

/* Mobilno */
@media (max-width: 480px) {
	#vtp-panel { width: calc(100vw - 32px); }
}

/* =====================================================================
   ZNAČAJKE KOJE SE PRIMJENJUJU NA CIJELU STRANICU
   (klase se dodaju na <html> element)
   ===================================================================== */

/* Visoki kontrast */
html.vtp-contrast body {
	background: #000 !important;
	color: #fff !important;
}
html.vtp-contrast body :is(p, span, li, h1, h2, h3, h4, h5, h6, td, th, dt, dd, blockquote, label, figcaption, strong, em, small) {
	background-color: transparent !important;
	color: #fff !important;
}
html.vtp-contrast body a { color: #ffea00 !important; }
html.vtp-contrast body :is(header, footer, section, article, aside, nav, div) {
	background-color: transparent !important;
}
html.vtp-contrast body :is(input, textarea, select) {
	background: #111 !important;
	color: #fff !important;
	border: 1px solid #fff !important;
}

/* Čitljiv font */
html.vtp-readable-font body :is(p, span, li, a, h1, h2, h3, h4, h5, h6, td, th, dt, dd, blockquote, label, figcaption, button, input, textarea, select) {
	font-family: Verdana, Tahoma, "Segoe UI", Arial, sans-serif !important;
}

/* Istakni poveznice */
html.vtp-highlight-links body a {
	text-decoration: underline !important;
	text-underline-offset: 3px !important;
	outline: 2px solid currentColor !important;
	outline-offset: 1px !important;
	font-weight: 700 !important;
}

/* Veći razmak teksta */
html.vtp-spacing body :is(p, span, li, a, h1, h2, h3, h4, h5, h6, td, th, dt, dd, blockquote, label, figcaption) {
	letter-spacing: .08em !important;
	word-spacing: .14em !important;
	line-height: 1.85 !important;
}

/* Sivi tonovi (na korijenskom elementu = sigurno za fixed widget) */
html.vtp-grayscale { filter: grayscale(100%); }

/* Zaustavi animacije */
html.vtp-stop-animations *,
html.vtp-stop-animations *::before,
html.vtp-stop-animations *::after {
	animation-duration: .001ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: .001ms !important;
	scroll-behavior: auto !important;
}

/* Veći pokazivač (SVG strelica kao data URI – bez vanjske datoteke) */
html.vtp-big-cursor,
html.vtp-big-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 2 L6 38 L15 29 L21 44 L28 41 L22 26 L34 26 Z" fill="black" stroke="white" stroke-width="2"/></svg>') 4 2, auto !important;
}

/* ---------------------------------------------------------------------
   IMUNITET WIDGETA: što god gore bilo uključeno, sam widget
   zadržava svoj izgled (id specifičnost + !important nadjačavaju klase).
   --------------------------------------------------------------------- */
#vtp-root,
#vtp-root * {
	letter-spacing: normal !important;
	word-spacing: normal !important;
	line-height: 1.4 !important;
	text-decoration: none !important;
	outline-offset: 0 !important;
	font-weight: inherit;
}
#vtp-root .vtp-title,
#vtp-root .vtp-row-label,
#vtp-root .vtp-toggle-label,
#vtp-root .vtp-textsize-controls button,
#vtp-root .vtp-reset { font-weight: 700 !important; }
