/* Court search homepage — mock-up styling.
   Palette taken from the existing theme: lime #ccff00 on near-black #04011c. */

:root {
	--pd-bg: #04011c;
	--pd-surface: #0c0930;
	--pd-line: #221f45;
	--pd-text: #ffffff;
	--pd-muted: #b1b1b8;
	--pd-accent: #ccff00;
}

* { box-sizing: border-box; }

body.padeludo-search-page {
	margin: 0;
	background: var(--pd-bg);
	color: var(--pd-text);
	font-family: "DM Sans", system-ui, sans-serif;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

h1, .pd-logo, .pd-value, .pd-submit, .pd-court-name {
	font-family: "Space Grotesk", system-ui, sans-serif;
}

.pd-wrap {
	width: min(1120px, 100% - 2.5rem);
	margin-inline: auto;
}

/*
 * The parent theme (nexi) has a `body::before` overlay — position: fixed,
 * opacity: 0, pointer-events: auto — used elsewhere as a mobile-menu backdrop.
 * Fixed-position elements paint above plain static content regardless of DOM
 * order, so on this template (which skips the theme's normal header/footer
 * scaffolding) that invisible overlay sits on top of everything and silently
 * eats every click, including on the date field and club checkboxes. Giving
 * our own top-level sections a real stacking context lifts them above it.
 */
header, main, footer {
	position: relative;
	z-index: 1;
}

/* header */

.pd-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgba(4, 1, 28, 0.9);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--pd-line);
}

.pd-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 0;
}

.pd-logo {
	color: var(--pd-text);
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	text-decoration: none;
}

.pd-logo span { color: var(--pd-accent); }

.pd-nav {
	display: flex;
	gap: 1.75rem;
}

.pd-nav-link {
	color: var(--pd-muted);
	font-size: 0.95rem;
	text-decoration: none;
	transition: color 0.15s;
}

.pd-nav-link:hover { color: var(--pd-text); }

.pd-nav-link.is-active {
	color: var(--pd-text);
	font-weight: 500;
}

.pd-burger {
	display: none;
	flex-direction: column;
	gap: 4px;
	padding: 8px;
	border: 0;
	background: none;
	cursor: pointer;
}

.pd-burger span {
	display: block;
	width: 22px;
	height: 2px;
	background: var(--pd-text);
}

.pd-lang {
	display: flex;
	margin-left: 1.75rem;
	border: 1px solid var(--pd-line);
	border-radius: 8px;
	overflow: hidden;
}

.pd-lang-btn {
	padding: 0.3rem 0.6rem;
	border: 0;
	background: none;
	color: var(--pd-muted);
	font: inherit;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	cursor: pointer;
}

.pd-lang-btn + .pd-lang-btn {
	border-left: 1px solid var(--pd-line);
}

.pd-lang-btn.is-active {
	background: var(--pd-accent);
	color: var(--pd-bg);
}

.pd-lang-btn:not(.is-active):hover {
	color: var(--pd-text);
}

/* hero */

.pd-hero { padding: 4.5rem 0 2.5rem; }

.pd-eyebrow {
	margin: 0 0 1rem;
	color: var(--pd-accent);
	font-size: 0.8rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.pd-soon { color: var(--pd-muted); }

.pd-hero h1 {
	margin: 0 0 1rem;
	font-size: clamp(2rem, 5vw, 3.4rem);
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.08;
}

.pd-lead {
	max-width: 46ch;
	margin: 0;
	color: var(--pd-muted);
	font-size: 1.05rem;
}

/* search panel */

.pd-search { padding-bottom: 5rem; }

.pd-mode-tabs {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.pd-mode-tab {
	padding: 0.55rem 1.1rem;
	border: 1px solid var(--pd-line);
	border-radius: 10px;
	background: transparent;
	color: var(--pd-muted);
	font: inherit;
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
}

.pd-mode-tab.is-active {
	border-color: var(--pd-accent);
	background: var(--pd-surface);
	color: var(--pd-text);
}

.pd-mode-tab:not(.is-active):hover {
	color: var(--pd-text);
}

.pd-fields-events {
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.pd-panel {
	padding: 1.75rem;
	border: 1px solid var(--pd-line);
	border-radius: 18px;
	background: var(--pd-surface);
}

.pd-fields {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 1.75rem;
}

.pd-label-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.6rem;
}

.pd-label {
	display: block;
	margin-bottom: 0.6rem;
	color: var(--pd-muted);
	font-size: 0.72rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.pd-label-row .pd-label { margin-bottom: 0; }

.pd-value {
	font-size: 0.95rem;
	font-variant-numeric: tabular-nums;
}

/*
 * Same theme-leak as the checkboxes: a global nexi/WooCommerce input rule sets
 * a mid-grey text colour that beats plain `.pd-input` on specificity, so the
 * date reads as disabled even though it's fully editable.
 */
body.padeludo-search-page .pd-input {
	width: 100%;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--pd-line);
	border-radius: 10px;
	background: var(--pd-bg);
	color: var(--pd-text);
	font: inherit;
	color-scheme: dark;
}

/*
 * iOS Safari specifically: <input type="date"> renders with its own internal
 * chrome around the value, which doesn't fully respect custom border/padding/
 * background/border-radius the way it does on other engines -- confirmed as
 * the actual complaint (icon fine, the picker itself fine when open, just the
 * closed field's box looking wrong). -webkit-appearance: none strips that
 * internal styling so our own box renders cleanly; tapping to open the native
 * picker still works exactly the same, this only affects the visual chrome.
 */
body.padeludo-search-page .pd-date-field input[type="date"] {
	-webkit-appearance: none;
	appearance: none;
}

.pd-input:focus-visible {
	outline: none;
	border-color: var(--pd-accent);
}

/*
 * Native <input type="date"> renders its calendar affordance wildly
 * differently across browsers -- Chrome/Edge draw their own icon, iOS Safari
 * draws NONE at all (just the bare value, no visual hint it's tappable),
 * confirmed as the actual mobile complaint. Drawing our own icon guarantees a
 * consistent look everywhere; on Chrome we hide (not remove) its native
 * icon, stretching its real hit area to the same spot so opening the picker
 * still works the same way, just without a visible duplicate icon.
 */
.pd-date-field {
	position: relative;
}

body.padeludo-search-page .pd-date-field .pd-input {
	padding-right: 2.75rem;
}

.pd-date-icon {
	position: absolute;
	top: 50%;
	right: 0.9rem;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	color: var(--pd-text);
	pointer-events: none;
}

.pd-date-field input[type="date"]::-webkit-calendar-picker-indicator {
	position: absolute;
	right: 0;
	width: 2.75rem;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

/* sliders */

.pd-slider {
	position: relative;
	height: 26px;
}

.pd-track,
.pd-fill {
	position: absolute;
	top: 12px;
	height: 3px;
	border-radius: 2px;
}

.pd-track {
	left: 0;
	right: 0;
	background: var(--pd-line);
}

.pd-fill { background: var(--pd-accent); }

.pd-slider input[type="range"] {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 26px;
	margin: 0;
	background: none;
	appearance: none;
	pointer-events: none;
}

.pd-slider input[type="range"]::-webkit-slider-thumb {
	appearance: none;
	width: 16px;
	height: 16px;
	border: 2px solid var(--pd-accent);
	border-radius: 50%;
	background: var(--pd-bg);
	cursor: grab;
	pointer-events: auto;
}

.pd-slider input[type="range"]:active::-webkit-slider-thumb {
	background: var(--pd-accent);
	cursor: grabbing;
}

/*
 * A 16px thumb is fine for a mouse pointer but genuinely hard to grab with a
 * fingertip -- confirmed complaint: missing it by ~1mm does nothing at all,
 * since the rest of the slider is deliberately pointer-events:none (avoids
 * ambiguity between the two overlapping range inputs that make up each dual
 * handle). The thumb's own box IS its hit area for a native range input --
 * there's no separate way to pad out a bigger tap target -- so the visual
 * size has to grow to fix this. `pointer: coarse` targets touch specifically
 * rather than guessing from screen width, so a touchscreen laptop at desktop
 * width still gets the bigger target, and a resized desktop browser doesn't.
 */
@media (pointer: coarse) {
	.pd-slider {
		height: 34px;
	}

	/* keep the track line centered against the now-taller thumb/input box */
	.pd-track,
	.pd-fill {
		top: 15.5px;
	}

	.pd-slider input[type="range"] {
		height: 34px;
	}

	.pd-slider input[type="range"]::-webkit-slider-thumb {
		width: 30px;
		height: 30px;
		border-width: 3px;
	}
}

/* clubs */

.pd-clubs {
	margin-top: 1.75rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--pd-line);
}

.pd-clubs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1.25rem;
}

/* event type / gender filter chips */

.pd-event-filters {
	display: grid;
	gap: 1.25rem;
	margin-top: 1.75rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--pd-line);
}

.pd-chip-options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.6rem;
}

.pd-chip-option {
	position: relative; /* contains the hidden checkbox below -- see its comment */
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.4rem 0.8rem;
	border: 1px solid var(--pd-line);
	border-radius: 999px;
	font-size: 0.85rem;
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}

/*
 * Without a positioned ancestor, this absolutely-positioned checkbox escapes
 * to the nearest one up the tree -- which turned out to be <body> (the theme
 * sets position:relative on it) -- landing far from its visible label. When
 * a label click focused it there, the browser scrolled the whole page to
 * bring that stray focus target into view. `position: relative` on
 * .pd-chip-option above keeps it properly contained.
 */
.pd-chip-option input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.pd-chip-option:has(input:checked) {
	border-color: var(--pd-accent);
	background: var(--pd-accent);
	color: var(--pd-bg);
	font-weight: 600;
}

.pd-chip-option:hover {
	border-color: var(--pd-accent);
}

.pd-filter-note {
	margin: 0;
	color: var(--pd-muted);
	font-size: 0.78rem;
	line-height: 1.5;
}

.pd-city-name {
	margin: 0 0 0.5rem;
	color: var(--pd-muted);
	font-size: 0.8rem;
}

.pd-check {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.2rem 0;
	font-size: 0.92rem;
	cursor: pointer;
}

/*
 * Same theme-leak again: nexi greys out `label` generally and
 * `input[type="checkbox"] + span` specifically (both more specific than a
 * plain `.pd-check span` rule), so club names read as disabled text.
 */
body.padeludo-search-page .pd-check,
body.padeludo-search-page .pd-check span {
	color: var(--pd-text);
}

/*
 * The parent theme globally resets input[type="checkbox"] to appearance:none
 * with its own circular custom styling (toggled by a "wgl-style-input" body
 * class), which needs the theme's own markup/JS for a checked-state indicator
 * we don't have — so our checkboxes render as invisible blanks. Restoring
 * native appearance needs a selector at least as specific as the theme's
 * `.wgl-style-input input[type="checkbox"]` to actually win.
 */
body.padeludo-search-page .pd-check input[type="checkbox"] {
	appearance: auto;
	-webkit-appearance: checkbox;
	width: 16px;
	height: 16px;
	min-width: 16px;
	min-height: 16px;
	margin: 0;
	border-radius: 0;
	accent-color: var(--pd-accent);
	cursor: pointer;
}

.pd-city-soon { opacity: 0.5; }

.pd-soon-note {
	margin: 0;
	font-size: 0.85rem;
}

.pd-link-btn {
	padding: 0;
	border: 0;
	background: none;
	color: var(--pd-muted);
	font: inherit;
	font-size: 0.8rem;
	text-decoration: underline;
	cursor: pointer;
}

.pd-link-btn:hover { color: var(--pd-text); }

/* submit */

.pd-submit {
	width: 100%;
	margin-top: 1.75rem;
	padding: 0.9rem;
	border: 0;
	border-radius: 12px;
	background: var(--pd-accent);
	color: #04011c;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: filter 0.15s;
}

.pd-submit:hover { filter: brightness(1.08); }

.pd-submit:disabled {
	cursor: default;
	opacity: 0.6;
}

/* results */

.pd-results:not(:empty) { margin-top: 2rem; }

.pd-status {
	margin: 0;
	color: var(--pd-muted);
}

.pd-demo-note {
	margin: 0 0 1rem;
	padding: 0.7rem 0.9rem;
	border: 1px dashed var(--pd-line);
	border-radius: 10px;
	color: var(--pd-muted);
	font-size: 0.88rem;
}

.pd-result {
	padding: 1.1rem 1.25rem;
	border: 1px solid var(--pd-line);
	border-radius: 14px;
	background: var(--pd-surface);
}

.pd-result + .pd-result { margin-top: 0.75rem; }

.pd-result-club {
	margin: 0 0 0.15rem;
	font-size: 1rem;
	font-weight: 700;
}

.pd-result-city {
	margin: 0 0 0.75rem;
	color: var(--pd-muted);
	font-size: 0.82rem;
}

.pd-courts {
	display: grid;
	grid-template-columns: minmax(0, max-content) 1fr;
	align-items: start;
	column-gap: 0.9rem;
	row-gap: 0.5rem;
}

.pd-court-name {
	color: var(--pd-muted);
	font-size: 0.9rem;
	overflow-wrap: anywhere;
}

.pd-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.pd-chip {
	padding: 0.15rem 0.55rem;
	border: 1px solid var(--pd-line);
	border-radius: 6px;
	font-size: 0.82rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

a.pd-chip {
	color: inherit;
	text-decoration: none;
}

.pd-chip:hover {
	border-color: var(--pd-accent);
	color: var(--pd-accent);
}

.pd-result-empty {
	margin: 0;
	color: var(--pd-muted);
	font-size: 0.9rem;
}

/* events list: date > club > rows, like a nested outline */

.pd-event-date-group + .pd-event-date-group {
	margin-top: 2.25rem;
	padding-top: 1.75rem;
	border-top: 1px solid var(--pd-line);
}

.pd-event-date-heading {
	margin: 0 0 1rem;
	color: var(--pd-text);
	font-family: "Space Grotesk", system-ui, sans-serif;
	font-size: 1.15rem;
	font-weight: 700;
}

.pd-event-club-group {
	position: relative;
	padding-left: 1rem;
	border-left: 2px solid var(--pd-line);
}

.pd-event-club-group + .pd-event-club-group {
	margin-top: 1.25rem;
}

.pd-event-club-heading {
	margin: 0 0 0.4rem;
	color: var(--pd-accent);
	font-size: 0.85rem;
	font-weight: 600;
}

.pd-event-row {
	display: grid;
	grid-template-columns: auto 1fr auto auto;
	align-items: baseline;
	gap: 0.9rem;
	padding: 0.5rem 0.4rem;
	border-radius: 8px;
	color: inherit;
	text-decoration: none;
	transition: background-color 0.15s;
}

.pd-event-row:hover {
	background: var(--pd-surface);
}

.pd-event-row + .pd-event-row {
	border-top: 1px solid var(--pd-line);
}

.pd-event-time {
	color: var(--pd-accent);
	font-size: 0.82rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.pd-event-title {
	overflow: hidden;
	font-size: 0.92rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pd-event-participants {
	color: var(--pd-muted);
	font-size: 0.82rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.pd-event-price {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

@media (max-width: 640px) {
	.pd-event-row {
		grid-template-columns: 1fr auto;
		grid-template-areas:
			"time price"
			"title title"
			"participants participants";
		row-gap: 0.15rem;
		padding: 0.6rem 0.4rem;
	}

	.pd-event-time { grid-area: time; }
	.pd-event-price { grid-area: price; }
	.pd-event-title { grid-area: title; white-space: normal; }
	.pd-event-participants { grid-area: participants; }
}

/* footer */

.pd-footer {
	padding: 2rem 0 3rem;
	border-top: 1px solid var(--pd-line);
	color: var(--pd-muted);
	font-size: 0.85rem;
}

.pd-footer p { margin: 0; }

/* mobile */

@media (max-width: 720px) {
	.pd-burger { display: flex; }

	.pd-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		flex-direction: column;
		gap: 0;
		padding: 0.5rem 1.25rem 1rem;
		background: var(--pd-bg);
		border-bottom: 1px solid var(--pd-line);
	}

	.pd-nav.is-open { display: flex; }

	.pd-nav-link { padding: 0.6rem 0; }

	.pd-header-inner { position: relative; }

	.pd-courts { grid-template-columns: 1fr; }
}
