/**
 * Wingate Golf Club - Course Layout Page Styles
 * Built for daisyUI 5 and Tailwind v4.
 * Scoped to .wingate-course-layout and Leaflet components.
 */

/* Map container */
.wingate-course-layout .layout-map {
	position: relative;
	width: 100%;
	height: calc(100dvh - 16rem);
	min-height: 460px;
	z-index: 10;
}

body.has-mobile-dock .wingate-course-layout .layout-map {
	height: calc(100dvh - 17.5rem - env(safe-area-inset-bottom, 0px));
	min-height: 440px;
}

@media (min-width: 1024px) {
	.wingate-course-layout .layout-map {
		height: 72vh;
		min-height: 600px;
	}
	body.has-mobile-dock .wingate-course-layout .layout-map {
		height: 72vh;
		min-height: 600px;
	}
}

/* Ensure Leaflet controls don't overlap custom overlay bars */
.wingate-course-layout .leaflet-top.leaflet-left {
	top: 12px;
	left: 12px;
}

.wingate-course-layout .leaflet-control-zoom {
	border: 1px solid var(--color-base-300, rgba(0, 0, 0, 0.15)) !important;
	border-radius: var(--radius-field, 0.375rem) !important;
	overflow: hidden;
	box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.25) !important;
}

.wingate-course-layout .leaflet-control-zoom a {
	background: var(--color-base-100, #ffffff) !important;
	color: var(--color-base-content, #1a1a1a) !important;
	border-bottom: 1px solid var(--color-base-300, rgba(0, 0, 0, 0.15)) !important;
	width: 36px !important;
	height: 36px !important;
	line-height: 36px !important;
	font-size: 18px !important;
	transition: background-color 0.15s ease;
}

.wingate-course-layout .leaflet-control-zoom a:hover {
	background: var(--color-base-200, #f5f5f5) !important;
}

/* Leaflet Attribution */
.wingate-course-layout .leaflet-control-attribution {
	background: rgba(255, 255, 255, 0.8) !important;
	color: #334155 !important;
	font-size: 10px !important;
	border-radius: 4px;
	padding: 2px 6px !important;
}

[data-theme="wingate-dark"] .wingate-course-layout .leaflet-control-attribution {
	background: rgba(5, 9, 21, 0.85) !important;
	color: #94a3b8 !important;
}

/* Custom Leaflet DivIcons */
.tee-marker-icon {
	background: none !important;
	border: none !important;
}

.tee-marker-wrap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 9999px;
	background: #0e1b3d;
	color: #ffffff;
	border: 2px solid #ffcc00;
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
	font-family: inherit;
	font-size: 11px;
	font-weight: 800;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	user-select: none;
}

.tee-marker-wrap:hover {
	transform: scale(1.15);
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6);
}

.green-marker-icon {
	background: none !important;
	border: none !important;
}

.green-marker-wrap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 9999px;
	background: #1a472a;
	color: #ffffff;
	border: 2px solid #ffffff;
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.green-marker-wrap:hover {
	transform: scale(1.15);
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6);
}

/* Lay-up markers along hole line (100m, 150m, 200m to green) */
.layup-marker-icon {
	background: none !important;
	border: none !important;
}

.layup-marker-wrap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 2px 6px;
	border-radius: 9999px;
	background: rgba(14, 27, 61, 0.92);
	color: #ffcc00;
	border: 1px solid #ffcc00;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.05em;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
	white-space: nowrap;
	pointer-events: none;
	user-select: none;
	transform: translate(-50%, -50%);
}

/* Route Hole labels */
.route-label-icon {
	background: none !important;
	border: none !important;
}

.route-label-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 2px 8px;
	border-radius: 9999px;
	background: rgba(14, 27, 61, 0.9);
	color: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.85);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
	white-space: nowrap;
	cursor: pointer;
	transition: transform 0.15s ease;
	user-select: none;
}

.route-label-chip.active {
	background: #ffcc00;
	color: #0e1b3d;
	border-color: #0e1b3d;
	font-weight: 800;
	transform: scale(1.08);
}

/* Measure mode waypoint marker */
.measure-waypoint-icon {
	background: none !important;
	border: none !important;
}

.measure-waypoint-wrap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 9999px;
	background: #ffcc00;
	color: #0e1b3d;
	border: 2px solid #0e1b3d;
	font-size: 11px;
	font-weight: 800;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
	transform: translate(-50%, -50%);
}

/* GPS User location beacon */
.user-gps-icon {
	background: none !important;
	border: none !important;
}

.user-gps-beacon {
	position: relative;
	width: 18px;
	height: 18px;
	border-radius: 9999px;
	background: #2563eb;
	border: 2px solid #ffffff;
	box-shadow: 0 0 10px rgba(37, 99, 235, 0.75);
	transform: translate(-50%, -50%);
}

.user-gps-beacon::after {
	content: "";
	position: absolute;
	inset: -6px;
	border-radius: 9999px;
	border: 2px solid rgba(37, 99, 235, 0.6);
	animation: gps-pulse 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes gps-pulse {
	0% {
		transform: scale(0.6);
		opacity: 1;
	}
	100% {
		transform: scale(2.2);
		opacity: 0;
	}
}

/* Leaflet Popups daisyUI harmony */
.wingate-course-layout .leaflet-popup-content-wrapper {
	background: var(--color-base-100, #ffffff);
	color: var(--color-base-content, #1a1a1a);
	border: 1px solid var(--color-base-300, rgba(0, 0, 0, 0.12));
	border-radius: var(--radius-box, 0.75rem);
	box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.35);
	padding: 4px;
}

.wingate-course-layout .leaflet-popup-tip {
	background: var(--color-base-100, #ffffff);
}

.wingate-course-layout .leaflet-popup-content {
	margin: 10px 14px;
	line-height: 1.4;
	font-family: inherit;
}

[data-theme="wingate-dark"] .wingate-course-layout .leaflet-popup-content-wrapper,
.dark .wingate-course-layout .leaflet-popup-content-wrapper {
	background: var(--color-base-200, #081023) !important;
	color: var(--color-base-content, #cbd5e1) !important;
	border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="wingate-dark"] .wingate-course-layout .leaflet-popup-tip,
.dark .wingate-course-layout .leaflet-popup-tip {
	background: var(--color-base-200, #081023) !important;
}

/* Two-finger gesture hint overlay */
#two-finger-hint {
	transition: opacity 0.3s ease;
	pointer-events: none;
}

/* Mobile horizontal swipe strip */
.no-scrollbar::-webkit-scrollbar {
	display: none;
}
.no-scrollbar {
	-ms-overflow-style: none;
	scrollbar-width: none;
}

/* Mobile Draggable Bottom Sheet (Fixed touch overlay) */
@media (max-width: 1023px) {
	.mobile-bottom-sheet {
		position: fixed !important;
		left: 0.5rem !important;
		right: 0.5rem !important;
		bottom: 0.5rem !important;
		z-index: 50 !important;
		max-height: calc(85dvh - 5.5rem) !important;
		display: flex !important;
		flex-direction: column !important;
		border-radius: 1.25rem !important;
		touch-action: pan-x pan-y;
		transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
		box-shadow: 0 -8px 28px -6px rgba(0, 0, 0, 0.45);
	}

	body.has-mobile-dock .mobile-bottom-sheet {
		/* Clears the mobile dock when collapsed and expanded */
		bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px) + 0.5rem) !important;
	}

	.mobile-bottom-sheet.state-peek {
		transform: translateY(calc(100% - 74px));
	}

	.mobile-bottom-sheet.state-expanded {
		transform: translateY(0);
	}

	.mobile-bottom-sheet.is-dragging {
		transition: none !important;
	}

	.mobile-bottom-sheet-content {
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		max-height: calc(75dvh - 120px);
	}
}

/* Fullscreen Map Mode */
.wingate-course-layout.is-fullscreen {
	position: fixed !important;
	inset: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	z-index: 9999 !important;
	background: var(--color-base-100, #ffffff) !important;
	display: flex;
	flex-direction: column;
}

[data-theme="wingate-dark"] .wingate-course-layout.is-fullscreen,
.dark .wingate-course-layout.is-fullscreen {
	background: var(--color-base-100, #050915) !important;
}

.wingate-course-layout.is-fullscreen .layout-hero-section {
	display: none !important;
}

.wingate-course-layout.is-fullscreen .layout-sidebar {
	display: none !important;
}

.wingate-course-layout.is-fullscreen .mobile-strip-container {
	display: none !important;
}

.wingate-course-layout.is-fullscreen .layout-shell {
	grid-template-columns: 1fr !important;
	max-width: none !important;
	height: 100vh !important;
	padding: 0 !important;
	margin: 0 !important;
	gap: 0 !important;
}

.wingate-course-layout.is-fullscreen .layout-map-wrap {
	border-radius: 0 !important;
	border: none !important;
	height: 100vh !important;
	padding: 0 !important;
}

.wingate-course-layout.is-fullscreen .layout-map {
	height: 100vh !important;
	min-height: 100vh !important;
	border-radius: 0 !important;
	border: none !important;
}

/* Hide admin bar and site header when full page is active */
body.wingate-fullscreen-active #wpadminbar,
body.wingate-fullscreen-active header,
body.wingate-fullscreen-active footer,
body.wingate-fullscreen-active #wingate-dock-root {
	display: none !important;
}

/* Selected hole row is navy: make its inner muted text readable (it carries its own text-base-content/* classes). */
.wingate-course-layout .hole-row[aria-selected="true"] :is(p, span, small, div):not(.hole-badge) {
	color: var(--color-neutral-content);
}
.wingate-course-layout .hole-row[aria-selected="true"] :is(.text-base-content\/60, .text-base-content\/50, .text-base-content\/70) {
	color: color-mix(in oklab, var(--color-neutral-content) 75%, transparent);
}
