/* stats.css - Version 1.12.5 */

/* --- Faneblade i toppen (Alle løb / Statistik) --- */
.hm-view-tabs {
	display: flex;
	gap: 8px;
	border-bottom: 1px solid #e5e7eb;
	margin: 22px 0 20px;
	padding-bottom: 0;
}

.hm-view-tab {
	background: transparent !important;
	border: 0 !important;
	border-bottom: 3px solid transparent !important;
	padding: 10px 18px !important;
	font-size: 14px;
	font-weight: 600;
	color: #6b7280 !important;
	cursor: pointer;
	border-radius: 8px 8px 0 0 !important;
	transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
	box-shadow: none !important;
}

.hm-view-tab:hover {
	color: #111827 !important;
	background: #f9fafb !important;
}

.hm-view-tab.is-active {
	color: var(--hm-accent, #6366f1) !important;
	border-bottom-color: var(--hm-accent, #6366f1) !important;
	background: var(--hm-accent-bg, rgba(99, 102, 241, 0.08)) !important;
}

/* --- Statistik-visning & Moduler --- */
.hm-stats-view {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.hm-stats-module {
	width: 100%;
}

.hm-stats-mod-body {
	padding: 22px 26px 26px;
}

.hm-stats-sub-hint {
	font-size: 12px;
	color: #6b7280;
	font-weight: 400;
}

/* --- KPI Kort --- */
.hm-stats-kpi-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
	margin-bottom: 22px;
}

.hm-stats-kpi-grid.hm-stats-kpi-2 {
	grid-template-columns: repeat(2, 1fr);
}

.hm-stats-kpi {
	background: #f8fafc;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 14px 16px;
}

.hm-stats-kpi span {
	display: block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6b7280;
	margin-bottom: 4px;
}

.hm-stats-kpi b {
	display: block;
	font-size: 22px;
	color: #111827;
	line-height: 1.25;
}

.hm-stats-kpi small {
	display: block;
	margin-top: 3px;
	font-size: 12px;
	color: #6b7280;
}

/* --- Chart.js Containere --- */
.hm-stats-chart-wrap {
	position: relative;
	width: 100%;
	height: 270px;
	margin-bottom: 22px;
}

.hm-stats-chart-tall {
	height: 340px;
	margin-bottom: 4px;
}

.hm-stats-chart-tags {
	height: 300px;
}

.hm-stats-chart-month {
	height: 250px;
	margin-bottom: 0;
}

/* --- Tabeller --- */
.hm-stats-table-wrap {
	width: 100%;
	overflow-x: auto;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
}

.hm-stats-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13.5px;
	text-align: left;
	margin: 0 !important;
}

.hm-stats-table th {
	background: #f9fafb;
	color: #6b7280;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 11px 14px;
	border-bottom: 1px solid #e5e7eb;
	white-space: nowrap;
}

.hm-stats-table td {
	padding: 10px 14px;
	border-bottom: 1px solid #f3f4f6;
	color: #374151;
	vertical-align: middle;
	white-space: nowrap;
}

.hm-stats-table tbody tr:last-child td {
	border-bottom: 0;
}

.hm-stats-table tbody tr:hover {
	background: #fafafc;
}

.hm-stats-pace-pill {
	display: inline-block;
	background: var(--hm-accent-bg, rgba(99, 102, 241, 0.1));
	color: var(--hm-accent, #6366f1);
	font-weight: 700;
	font-size: 12px;
	padding: 2px 8px;
	border-radius: 6px;
}

.hm-stats-tag-chip {
	cursor: default !important;
}

.hm-stats-race-link {
	background: none !important;
	border: 0 !important;
	padding: 0 !important;
	color: var(--hm-accent, #6366f1) !important;
	font-family: inherit !important;
	font-weight: 600;
	font-size: inherit;
	text-transform: none !important;
	letter-spacing: normal !important;
	text-align: left;
	cursor: pointer;
	text-decoration: underline;
	box-shadow: none !important;
}

.hm-stats-race-link:hover {
	opacity: 0.8;
}

.hm-stats-two-col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	align-items: start;
}

.hm-stats-mini-h {
	margin: 0 0 12px 0 !important;
	font-size: 13px !important;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6b7280;
}

/* --- Omskifter i Tids- & tempoudvikling (Efter dato / Efter løbsnr.) --- */
.hm-stats-card-h-flex {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

.hm-stats-card-h-titles {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.hm-stats-mode-toggle {
	display: inline-flex;
	background: #f3f4f6;
	padding: 3px;
	border-radius: 8px;
	border: 1px solid #e5e7eb;
}

.hm-stats-mode-btn {
	background: transparent !important;
	border: 0 !important;
	padding: 5px 12px !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	color: #6b7280 !important;
	border-radius: 6px !important;
	cursor: pointer;
	transition: all 0.15s ease;
	box-shadow: none !important;
}

.hm-stats-mode-btn:hover {
	color: #111827 !important;
}

.hm-stats-mode-btn.is-active {
	background: #ffffff !important;
	color: var(--hm-accent, #6366f1) !important;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

/* --- Diskret mellemrum ved oversprungne år i Årsoverblik-tabellen --- */
.hm-stats-year-gap td {
	background: #f8fafc !important;
	color: #9ca3af !important;
	text-align: center !important;
	font-size: 12px !important;
	letter-spacing: 3px;
	padding: 5px 14px !important;
	border-bottom: 1px solid #f3f4f6;
	user-select: none;
}

.hm-stats-table tbody tr.hm-stats-year-gap:hover td {
	background: #f8fafc !important;
}

/* --- Diskret grå opsamlingsrække for "Løb uden tags" --- */
.hm-stats-row-untagged td {
	background: #f9fafb;
	color: #6b7280;
	border-top: 1px solid #e5e7eb;
}

.hm-stats-tag-untagged {
	background: #e5e7eb !important;
	color: #4b5563 !important;
	border-color: #d1d5db !important;
	cursor: default !important;
	pointer-events: none;
}

.hm-stats-pace-pill-muted {
	background: #e5e7eb !important;
	color: #4b5563 !important;
}

@media (max-width: 960px) {
	.hm-stats-kpi-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.hm-stats-two-col {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 600px) {
	.hm-stats-mod-body {
		padding: 16px;
	}
	.hm-stats-kpi-grid,
	.hm-stats-kpi-grid.hm-stats-kpi-2 {
		grid-template-columns: 1fr;
	}
}

/* --- Samlet Rutekort modul under Statistik --- */
.hm-rmap-controls {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.hm-rmap-select {
	padding: 6px 12px !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	color: #111827 !important;
	background: #ffffff !important;
	border: 1px solid #d1d5db !important;
	border-radius: 8px !important;
	cursor: pointer;
	min-width: 170px;
}

.hm-rmap-status-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
	font-size: 13px;
	color: #6b7280;
}

.hm-rmap-loading {
	font-weight: 600;
	color: var(--hm-accent, #6366f1);
}

.hm-stats-route-map {
	height: 440px;
	width: 100%;
	border-radius: 10px;
	border: 1px solid #d1d5db;
	background: #f3f4f6;
	z-index: 1;
	overflow: hidden;
	position: relative;
}

.hm-stats-route-map.is-heatmap {
	background: #1a1d24;
	border-color: #374151;
}

.hm-stats-route-map.is-heatmap .leaflet-tile-pane {
	filter: invert(100%) hue-rotate(180deg) brightness(88%) contrast(92%) saturate(65%);
}

.hm-stats-route-map.is-heatmap .leaflet-control-attribution {
	background: rgba(26, 29, 36, 0.85) !important;
	color: #9ca3af !important;
}

.hm-stats-route-map.is-heatmap .leaflet-control-attribution a {
	color: #93c5fd !important;
}

.hm-stats-route-map.is-heatmap .leaflet-overlay-pane svg path {
	mix-blend-mode: screen;
}

.hm-rmap-checklist-wrap {
	margin-top: 18px;
	border-top: 1px solid #e5e7eb;
	padding-top: 16px;
}

.hm-rmap-checklist-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
	flex-wrap: wrap;
}

.hm-rmap-bulk-actions {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
}

.hm-rmap-link-btn {
	background: none !important;
	border: 0 !important;
	padding: 0 !important;
	color: var(--hm-accent, #6366f1) !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	cursor: pointer;
	text-decoration: underline;
	box-shadow: none !important;
}

.hm-rmap-link-btn:hover {
	opacity: 0.8;
}

.hm-rmap-checklist {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 8px;
	max-height: 220px;
	overflow-y: auto;
	padding: 2px;
}

.hm-rmap-race-item {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #f8fafc;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 7px 10px;
	font-size: 12.5px;
	color: #374151;
	cursor: pointer;
	user-select: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
	margin: 0 !important;
}

.hm-rmap-race-item:hover {
	background: #f1f5f9;
	border-color: #cbd5e1;
}

.hm-rmap-race-item input[type="checkbox"] {
	margin: 0 !important;
	cursor: pointer;
	flex-shrink: 0;
}

.hm-rmap-color-dot {
	display: none;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}

.hm-rmap-checklist.is-individual .hm-rmap-color-dot {
	display: inline-block;
}

.hm-rmap-race-txt {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hm-rmap-race-txt small {
	color: #6b7280;
}

@media (max-width: 768px) {
	.hm-stats-route-map {
		height: 320px;
	}
	.hm-rmap-checklist {
		grid-template-columns: 1fr;
	}
}

/* --- Næste milepæle modul under Statistik --- */
.hm-ms-hero {
	background: #f8fafc;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 18px 20px 30px;
	margin-bottom: 18px;
}

.hm-ms-hero-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}

.hm-ms-hero-title {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.hm-ms-hero-title strong {
	font-size: 16px;
	color: #111827;
}

.hm-ms-pct-badge {
	display: inline-block;
	background: #e5e7eb;
	color: #374151;
	font-size: 12px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 6px;
}

.hm-ms-left-pill {
	display: inline-block;
	background: var(--hm-accent-bg, rgba(99, 102, 241, 0.1));
	color: var(--hm-accent, #6366f1);
	border: 1px solid var(--hm-accent, #6366f1);
	font-size: 12.5px;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 999px;
}

.hm-ms-main-track {
	position: relative;
	width: 100%;
	height: 14px;
	background: #e5e7eb;
	border-radius: 999px;
}

.hm-ms-main-fill {
	height: 100%;
	background: var(--hm-accent, #6366f1);
	border-radius: 999px;
	transition: width 0.4s ease;
}

.hm-ms-tick {
	position: absolute;
	top: 0;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	pointer-events: none;
}

.hm-ms-tick.is-end {
	transform: translateX(-100%);
}

.hm-ms-tick-mark {
	width: 2px;
	height: 14px;
	background: rgba(255, 255, 255, 0.85);
}

.hm-ms-tick.is-end .hm-ms-tick-mark {
	background: transparent;
}

.hm-ms-tick-lbl {
	margin-top: 5px;
	font-size: 11px;
	font-weight: 700;
	color: #6b7280;
}

.hm-ms-tick.is-reached .hm-ms-tick-lbl {
	color: var(--hm-accent, #6366f1);
}

.hm-ms-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}

.hm-ms-card {
	background: #f8fafc;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.hm-ms-card.is-record-hit {
	background: #fefce8;
	border-color: #fde047;
}

.hm-ms-card-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 24px;
}

.hm-ms-card-top > span:first-child {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6b7280;
}

.hm-ms-card-val {
	font-size: 16px;
	font-weight: 700;
	color: #111827;
	line-height: 1.3;
}

.hm-ms-bar-sm {
	width: 100%;
	height: 8px;
	background: #e5e7eb;
	border-radius: 999px;
	overflow: hidden;
}

.hm-ms-bar-fill {
	height: 100%;
	background: var(--hm-accent, #6366f1);
	border-radius: 999px;
	transition: width 0.35s ease;
}

.hm-ms-card.is-record-hit .hm-ms-bar-fill {
	background: #eab308;
}

.hm-ms-card-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: 12px;
	color: #6b7280;
}

.hm-ms-card-foot b {
	color: #374151;
}

@media (max-width: 768px) {
	.hm-ms-grid {
		grid-template-columns: 1fr;
	}
}

/* --- Seneste fem milepæle boks inde i Næste milepæle --- */
.hm-ms-recent-box {
	margin-top: 18px;
	background: linear-gradient(135deg, #fefce8 0%, #fffbeb 100%);
	border: 1px solid #fde047;
	border-radius: 12px;
	padding: 16px 18px;
}

.hm-ms-recent-head {
	font-size: 11.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #854d0e;
	margin-bottom: 12px;
}

.hm-ms-recent-list {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.hm-ms-recent-item {
	margin: 0 !important;
	padding: 10px 14px !important;
	list-style: none !important;
	background: rgba(255, 255, 255, 0.88);
	border: 1px solid #fef08a;
	border-radius: 8px;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.hm-ms-recent-left {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	flex: 1;
}

.hm-ms-recent-main {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13.5px;
	font-weight: 700;
	color: #111827;
	flex-wrap: wrap;
}

.hm-ms-recent-lbl {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.hm-ms-recent-lbl .hm-stats-tag-chip {
	margin-left: 2px;
}

.hm-ms-recent-ico {
	font-size: 15px;
	line-height: 1;
	flex-shrink: 0;
}

.hm-ms-recent-right {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 3px;
	min-width: 0;
	max-width: 50%;
	text-align: right;
}

.hm-ms-recent-date {
	flex-shrink: 0;
	white-space: nowrap;
	font-size: 12.5px;
	font-weight: 600;
	color: #4b5563;
	text-align: right;
	padding-top: 2px;
}

.hm-ms-recent-race {
	font-size: 12.5px;
	color: #4b5563;
	line-height: 1.35;
	text-align: right;
}

.hm-ms-recent-race .hm-stats-race-link {
	text-align: right;
}

@media (max-width: 768px) {
	.hm-ms-recent-item {
		gap: 10px;
		padding: 9px 11px !important;
	}
	.hm-ms-recent-right {
		max-width: 52%;
	}
	.hm-ms-recent-date,
	.hm-ms-recent-race {
		font-size: 12px;
	}
}

/* --- Mount Everest-bestigninger modul under Statistik --- */
.hm-ev-header-badges {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.hm-ev-count-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: #fefce8;
	border: 1px solid #fde047;
	color: #854d0e;
	font-size: 12.5px;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 999px;
}

.hm-ev-trophies-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.hm-ev-trophy-pill {
	display: inline-flex !important;
	align-items: center;
	gap: 5px;
	background: linear-gradient(135deg, #fef08a 0%, #fde047 100%) !important;
	border: 1px solid #eab308 !important;
	color: #422006 !important;
	text-decoration: none !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	padding: 4px 11px !important;
	border-radius: 999px !important;
	box-shadow: 0 1px 2px rgba(202, 138, 4, 0.25) !important;
}

.hm-ev-trophy-pill small {
	font-weight: 600;
	opacity: 0.85;
}

.hm-ev-prog-bar-wrap {
	background: #f8fafc;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 12px 16px;
	margin-bottom: 16px;
}

.hm-ev-prog-labels {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 8px;
	font-size: 13px;
}

.hm-ev-prog-labels strong {
	color: #111827;
}

.hm-ev-prog-labels span {
	color: #4b5563;
	font-weight: 600;
}

.hm-ev-stage {
	position: relative;
	width: 100%;
	height: 420px;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid #94a3b8;
	background: #0f172a;
}

.hm-ev-svg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	pointer-events: none;
}

.hm-ev-camp-row {
	position: absolute;
	right: 16px;
	transform: translateY(50%);
	display: flex;
	align-items: center;
	z-index: 3;
	pointer-events: none;
}

.hm-ev-camp-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #ffffff;
	border: 2px solid #334155;
	flex-shrink: 0;
}

.hm-ev-camp-row.is-reached .hm-ev-camp-dot {
	background: #10b981;
	border-color: #ffffff;
}

.hm-ev-camp-row.is-next .hm-ev-camp-dot {
	background: #facc15;
	border-color: #854d0e;
	width: 10px;
	height: 10px;
}

.hm-ev-camp-dash {
	flex: 1;
	min-width: 14px;
	height: 1px;
	border-bottom: 1px dashed rgba(255, 255, 255, 0.65);
}

.hm-ev-camp-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: rgba(255, 255, 255, 0.94);
	border: 1px solid #cbd5e1;
	border-radius: 999px;
	padding: 2px 9px;
	font-size: 11.5px;
	line-height: 1.25;
	color: #1e293b;
	box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
	white-space: nowrap;
}

.hm-ev-camp-row.is-reached .hm-ev-camp-pill {
	background: #ecfdf5;
	border-color: #6ee7b7;
	color: #065f46;
}

.hm-ev-camp-row.is-next .hm-ev-camp-pill {
	background: #fefce8;
	border: 1.5px solid #eab308;
	color: #713f12;
	font-weight: 700;
	box-shadow: 0 2px 6px rgba(202, 138, 4, 0.35);
}

.hm-ev-camp-m {
	font-weight: 700;
	opacity: 0.85;
}

.hm-ev-runner-pin {
	position: absolute;
	transform: translate(-6px, 50%);
	display: inline-flex;
	align-items: center;
	gap: 6px;
	z-index: 5;
	pointer-events: none;
}

.hm-ev-runner-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--hm-accent, #6366f1);
	border: 2.5px solid #ffffff;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.45);
	flex-shrink: 0;
}

.hm-ev-runner-tag {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: var(--hm-accent, #6366f1);
	color: #ffffff;
	border: 2px solid #ffffff;
	border-radius: 999px;
	padding: 3px 11px;
	font-size: 12px;
	box-shadow: 0 3px 10px rgba(15, 23, 42, 0.4);
	white-space: nowrap;
}

@media (max-width: 768px) {
	.hm-ev-stage {
		height: 360px;
	}
	.hm-ev-camp-row {
		right: 10px;
	}
	.hm-ev-camp-pill {
		font-size: 10.5px;
		padding: 2px 8px;
		gap: 4px;
	}
	.hm-ev-runner-tag {
		font-size: 11px;
		padding: 2px 9px;
	}
}
