/* TrailsIQ Frontend Map CSS */

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
.trailsiq-map-wrap {
	position: relative;
	width: 100%;
	border-radius: 10px;
	overflow: hidden;
}

/* ── Popup ────────────────────────────────────────────────────────────────── */
.maplibregl-popup-content {
	padding: 0;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 12px 32px rgba(0,0,0,0.3);
	font-family: system-ui, -apple-system, sans-serif;
	width: 280px;
}
.maplibregl-popup-close-button {
	color: rgba(255,255,255,0.75);
	font-size: 20px;
	line-height: 1;
	padding: 10px 12px;
	right: 0; top: 0;
	background: none;
	z-index: 1;
}
.maplibregl-popup-close-button:hover { color: #fff; }
.maplibregl-popup-tip { border-top-color: #1a1a1a; }

/* Popup header */
.tp-header {
	padding: 16px 40px 14px 16px;
	background: #1a1a1a;
	color: #fff;
}
.tp-header h3 {
	font-size: 1.05rem;
	font-weight: 700;
	margin: 0 0 6px;
	letter-spacing: .01em;
}
.tp-badge {
	display: inline-block;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: .07em;
	text-transform: uppercase;
	padding: 3px 9px;
	border-radius: 20px;
}

/* Elevation profile */
.tp-profile { background: #1a1a1a; padding: 0; line-height: 0; }
.tp-profile svg { display: block; width: 100%; }

/* Stats grid */
.tp-stats {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 1px;
	background: #eee;
	border-top: 1px solid #eee;
}
.tp-stat {
	background: #fff;
	padding: 10px 12px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.tp-stat .lbl {
	font-size: 0.6rem;
	font-weight: 700;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: #aaa;
}
.tp-stat .val {
	font-size: 0.9rem;
	font-weight: 800;
	color: #1a1a1a;
	line-height: 1.1;
}
.tp-stat .unit {
	font-size: 0.65rem;
	font-weight: 500;
	color: #888;
}

/* Grade bar */
.tp-grade-row {
	padding: 10px 12px;
	background: #fff;
	border-top: 1px solid #eee;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.tp-grade-label {
	display: flex;
	justify-content: space-between;
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: #aaa;
}
.tp-grade-bar-wrap {
	height: 6px;
	background: #f0f0f0;
	border-radius: 3px;
	overflow: hidden;
}
.tp-grade-bar {
	height: 100%;
	border-radius: 3px;
	transition: width .4s ease;
}

/* Explore buttons */
.tp-explore { display: flex; border-top: 1px solid #eee; }
.tp-explore button {
	flex: 1;
	padding: 11px 8px;
	border: none;
	background: #fff;
	font-size: 0.78rem;
	font-weight: 700;
	cursor: pointer;
	color: #333;
	font-family: system-ui, sans-serif;
	letter-spacing: .02em;
	transition: background .15s;
}
.tp-explore button:first-child { border-right: 1px solid #eee; }
.tp-explore button:hover { background: #f5f5f5; }

/* ── Flyover UI ───────────────────────────────────────────────────────────── */
.tiq-flyover-ui {
	position: absolute;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(20,20,20,0.9);
	backdrop-filter: blur(8px);
	color: #fff;
	border-radius: 40px;
	padding: 10px 20px;
	display: flex;
	align-items: center;
	gap: 16px;
	z-index: 10;
	font-family: system-ui, sans-serif;
	box-shadow: 0 4px 20px rgba(0,0,0,0.4);
	white-space: nowrap;
}
.tiq-flyover-label {
	font-size: 0.8rem;
	font-weight: 600;
	opacity: .7;
	letter-spacing: .05em;
	text-transform: uppercase;
}
.tiq-flyover-name { font-size: 0.9rem; font-weight: 700; }
.tiq-flyover-speed-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.75rem;
	opacity: .8;
}
.tiq-flyover-speed {
	width: 80px;
	accent-color: #e45419;
	cursor: pointer;
}
.tiq-flyover-stop {
	background: rgba(255,255,255,0.15);
	border: none;
	color: #fff;
	border-radius: 20px;
	padding: 6px 14px;
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
	font-family: system-ui, sans-serif;
	transition: background .15s;
}
.tiq-flyover-stop:hover { background: rgba(255,255,255,0.25); }

/* ── Camera cross ─────────────────────────────────────────────────────────── */
.tiq-camera-cross {
	position: absolute;
	bottom: 24px;
	right: 16px;
	width: 108px;
	height: 108px;
	display: grid;
	grid-template-columns: repeat(3, 36px);
	grid-template-rows: repeat(3, 36px);
	z-index: 10;
}
.tiq-cam-btn {
	width: 36px; height: 36px;
	border: none;
	background: rgba(255,255,255,0.92);
	box-shadow: 0 2px 8px rgba(0,0,0,.2);
	cursor: pointer;
	font-size: 15px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #222;
	transition: background .15s;
	-webkit-appearance: none;
	appearance: none;
}
.tiq-cam-btn:hover  { background: #f0f0f0; }
.tiq-cam-btn:active { background: #e0e0e0; }

/* Grid placement: tilt-up=top, rotate-left=left, reset=centre, rotate-right=right, tilt-down=bottom */
.tiq-cam-btn[data-action="tilt-up"]     { grid-column:2; grid-row:1; border-radius:8px 8px 0 0; }
.tiq-cam-btn[data-action="rotate-left"] { grid-column:1; grid-row:2; border-radius:8px 0 0 8px; }
.tiq-cam-reset                          { grid-column:2; grid-row:2; border-radius:4px; font-size:11px; font-weight:700; color:#555; }
.tiq-cam-btn[data-action="rotate-right"]{ grid-column:3; grid-row:2; border-radius:0 8px 8px 0; }
.tiq-cam-btn[data-action="tilt-down"]   { grid-column:2; grid-row:3; border-radius:0 0 8px 8px; }

/* ── Style switcher ───────────────────────────────────────────────────────── */
.tiq-style-switcher {
	position: absolute;
	bottom: 24px;
	left: 16px;
	display: flex;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0,0,0,.25);
	z-index: 10;
}
.tiq-style-btn {
	padding: 8px 14px;
	border: none;
	background: none;
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
	color: #666;
	font-family: system-ui, sans-serif;
	transition: background .15s, color .15s;
}
.tiq-style-btn.active { background: #1a1a1a; color: #fff; }
.tiq-style-btn:not(.active):hover { background: #f0f0f0; }

/* ── Maintenance map ──────────────────────────────────────────────────────── */
.trailsiq-maint-wrap { border-radius: 10px; overflow: hidden; }

/* Report button ("+") */
.tiq-maint-report-btn {
	position: absolute;
	bottom: 24px;
	right: 16px;
	z-index: 10;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #e45419;
	color: #fff;
	border: none;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 3px 12px rgba(0,0,0,.35);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s, transform .1s;
}
.tiq-maint-report-btn:hover { background: #c93d10; transform: scale(1.07); }

/* Click-to-place banner */
.tiq-maint-banner {
	position: absolute;
	top: 12px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	background: rgba(0,0,0,.75);
	color: #fff;
	padding: 8px 16px;
	border-radius: 8px;
	font-size: 0.85rem;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 90%;
	text-align: center;
	pointer-events: all;
}
.tiq-maint-banner-cancel {
	background: none;
	border: none;
	color: #fff;
	font-size: 1rem;
	cursor: pointer;
	opacity: .7;
	flex-shrink: 0;
}
.tiq-maint-banner-cancel:hover { opacity: 1; }

/* Report modal overlay */
.tiq-maint-modal {
	position: absolute;
	inset: 0;
	z-index: 20;
	background: rgba(0,0,0,.45);
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 0;
}
.tiq-maint-modal-inner {
	background: #fff;
	border-radius: 16px 16px 0 0;
	padding: 24px 20px 28px;
	width: 100%;
	max-width: 480px;
	max-height: 80vh;
	overflow-y: auto;
	font-family: system-ui, sans-serif;
	box-shadow: 0 -4px 24px rgba(0,0,0,.2);
}
.tiq-maint-modal-inner h3 { margin: 0 0 6px; font-size: 1.05rem; }
.tiq-maint-trail-label { margin: 0 0 14px; font-size: 0.82rem; color: #888; }
.tiq-maint-modal-inner label {
	display: block;
	font-size: 0.82rem;
	font-weight: 600;
	margin-bottom: 12px;
	color: #333;
}
.tiq-maint-modal-inner label input,
.tiq-maint-modal-inner label textarea {
	display: block;
	width: 100%;
	margin-top: 4px;
	padding: 8px 10px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 0.9rem;
	font-family: inherit;
	box-sizing: border-box;
	resize: vertical;
}
.tiq-maint-modal-error {
	color: #c00;
	font-size: 0.82rem;
	margin-bottom: 10px;
}
.tiq-maint-modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.tiq-maint-modal-actions .tiq-maint-submit { background: #e45419; border-color: #c93d10; color: #fff; }
.tiq-maint-modal-actions .tiq-maint-submit:hover { background: #c93d10; }

/* ── Maintenance photo upload ─────────────────────────────────────────────── */
.tiq-maint-photo-label input[type="file"] {
	margin-top: 6px;
	font-size: 0.85rem;
	padding: 6px 0;
	cursor: pointer;
}
.tiq-maint-photo-preview {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
}
.tiq-maint-photo-thumb {
	width: 52px;
	height: 52px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid #ddd;
	display: block;
}
.tiq-maint-photo-remove {
	background: none;
	border: 1px solid #ccc;
	border-radius: 50%;
	width: 24px;
	height: 24px;
	cursor: pointer;
	font-size: 0.75rem;
	line-height: 1;
	color: #666;
	padding: 0;
	flex-shrink: 0;
}
