/**
 * Helmut CF7 Nice Date — frontend styly.
 *
 * Barvy jdou přes CSS proměnné. Vlastní hodnoty z nastavení pluginu se
 * vkládají inline a přepíšou fallback řetězec níže.
 */

.hcnd-cal {
	--hcnd-accent: var( --color-primary, var( --np-accent-color, #1e73be ) );
	--hcnd-arrow: currentColor;
	--hcnd-bg: #fff;
	--hcnd-border: rgba( 0, 0, 0, .14 );
	--hcnd-muted: rgba( 0, 0, 0, .38 );
	--hcnd-hover: rgba( 0, 0, 0, .06 );

	position: absolute;
	z-index: 999999;
	top: 0;
	left: 0;
	box-sizing: border-box;
	width: 288px;
	padding: 10px;
	border: 1px solid var( --hcnd-border );
	border-radius: 6px;
	background: var( --hcnd-bg );
	box-shadow: 0 6px 24px rgba( 0, 0, 0, .16 );
	color: inherit;
	font-size: 14px;
	line-height: 1.3;
	text-align: center;
}

.hcnd-cal[hidden] {
	display: none;
}

.hcnd-cal *,
.hcnd-cal *::before,
.hcnd-cal *::after {
	box-sizing: border-box;
}

.hcnd-cal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

.hcnd-cal__title {
	flex: 1 1 auto;
	font-weight: 600;
	text-transform: capitalize;
}

.hcnd-nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: var( --hcnd-arrow );
	cursor: pointer;
	transition: background-color .15s ease;
}

.hcnd-nav:hover,
.hcnd-nav:focus-visible {
	background: var( --hcnd-hover );
}

.hcnd-nav svg {
	display: block;
	pointer-events: none;
}

.hcnd-cal__dow,
.hcnd-cal__grid {
	display: grid;
	grid-template-columns: repeat( 7, 1fr );
	gap: 2px;
}

.hcnd-cal__dow {
	margin-bottom: 4px;
}

.hcnd-cal__dow-cell {
	padding: 4px 0;
	color: var( --hcnd-muted );
	font-size: 12px;
	font-weight: 600;
	text-transform: capitalize;
}

.hcnd-day {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	min-height: 34px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	transition: background-color .15s ease;
}

.hcnd-day--empty {
	cursor: default;
}

.hcnd-day:not( [disabled] ):hover,
.hcnd-day:focus-visible {
	background: var( --hcnd-hover );
}

.hcnd-day--today:not( .hcnd-day--selected ) {
	box-shadow: inset 0 0 0 1px var( --hcnd-accent );
}

.hcnd-day--selected {
	background: var( --hcnd-accent );
	color: #fff;
	font-weight: 600;
}

.hcnd-day--selected:hover {
	background: var( --hcnd-accent );
}

.hcnd-day--blocked {
	position: relative;
	color: var( --hcnd-muted );
	cursor: not-allowed;
	text-decoration: line-through;
	text-decoration-thickness: 1px;
}

.hcnd-cal__foot {
	display: flex;
	justify-content: space-between;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid var( --hcnd-border );
}

.hcnd-action {
	padding: 4px 8px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: var( --hcnd-accent );
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}

.hcnd-action:hover,
.hcnd-action:focus-visible {
	background: var( --hcnd-hover );
}

.hcnd-input {
	cursor: pointer;
}

@media ( prefers-reduced-motion: reduce ) {
	.hcnd-nav,
	.hcnd-day {
		transition: none;
	}
}

/* Diagnostický panel — zobrazuje se jen správci s parametrem hcnd_debug=1. */

.hcnd-debug {
	position: fixed;
	z-index: 1000000;
	right: 16px;
	bottom: 16px;
	box-sizing: border-box;
	max-width: min( 560px, calc( 100vw - 32px ) );
	max-height: 60vh;
	overflow: auto;
	padding: 12px 14px;
	border: 1px solid #444;
	border-radius: 6px;
	background: #1d2327;
	color: #f0f0f1;
	font-family: Menlo, Consolas, monospace;
	font-size: 12px;
	line-height: 1.5;
	text-align: left;
	box-shadow: 0 8px 32px rgba( 0, 0, 0, .35 );
}

.hcnd-debug__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
	font-family: system-ui, sans-serif;
}

.hcnd-debug__close {
	padding: 0 6px;
	border: 0;
	border-radius: 3px;
	background: transparent;
	color: #f0f0f1;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.hcnd-debug ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hcnd-debug__item {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
	padding: 4px 0;
	border-top: 1px solid #3c434a;
	word-break: break-all;
}

.hcnd-debug__status {
	flex: 0 0 auto;
	padding: 1px 6px;
	border-radius: 10px;
	background: #d63638;
	color: #fff;
	font-family: system-ui, sans-serif;
	font-size: 11px;
}

.hcnd-debug__item--taken .hcnd-debug__status {
	background: #00a32a;
}

.hcnd-debug code {
	background: none;
	color: inherit;
	font-size: 12px;
}

.hcnd-debug__suggest {
	flex: 1 0 100%;
	color: #72aee6;
}

.hcnd-debug__hint {
	margin: 10px 0 0;
	font-family: system-ui, sans-serif;
	color: #c3c4c7;
}

/* Kalendář připojený k poli jiným skriptem — nahrazen vlastním. */

.hcnd-legacy-hidden {
	display: none !important;
}

.hcnd-debug__actions {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.hcnd-debug__refresh {
	padding: 2px 8px;
	border: 1px solid #50575e;
	border-radius: 3px;
	background: transparent;
	color: #f0f0f1;
	font-family: system-ui, sans-serif;
	font-size: 11px;
	cursor: pointer;
}

.hcnd-debug__refresh:hover {
	background: #2c3338;
}

.hcnd-debug__section {
	margin: 12px 0 4px;
	color: #c3c4c7;
	font-family: system-ui, sans-serif;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
}

.hcnd-action[disabled] {
	opacity: .4;
	cursor: default;
}

.hcnd-action[disabled]:hover {
	background: transparent;
}
