/**
 * Teamfy Japan Map Styles - タイルグリッド形式
 * 都道府県別チーム数を表示するインタラクティブな日本地図
 */

/* ========== Container Styles ========== */
.tf-japan-map {
	margin: 2rem 0;
}

.tf-japan-map-container,
.tf-japan-map__container {
	position: relative;
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
	aspect-ratio: 4 / 3.2;
}

/* ========== Map Wrapper ========== */
.tf-map-wrapper {
	position: relative;
	width: 100%;
	height: 100%;
	background: #ffffff;
	border-radius: 0.75rem;
	box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
	border: 1px solid #e2e8f0;
	padding: 2rem;
	box-sizing: border-box;
}

@media (max-width: 768px) {
	.tf-map-wrapper {
		padding: 1rem;
	}
}

/* ========== SVG Styles ========== */
.tf-japan-map-svg,
.tf-japan-map__svg {
	width: 100%;
	height: 100%;
	display: block;
	overflow: visible;
}

/* ========== Prefecture Tile Styles ========== */
.tf-pref-rect {
	cursor: pointer;
	rx: 6;
	ry: 6;
	stroke: #ffffff;
	stroke-width: 2.5;
	transition: opacity 0.15s ease;
}

.tf-pref-rect:hover {
	opacity: 0.85;
}

.tf-pref-rect--disabled {
	cursor: default;
}

.tf-pref-rect--disabled:hover {
	opacity: 0.5;
}

.tf-pref-rect:focus-visible {
	outline: 3px solid #2563eb;
	outline-offset: 2px;
}

/* ========== Region Color Palette ========== */
.tf-region-hokkaido {
	fill: #8b5cf6;
}

.tf-region-tohoku {
	fill: #3b82f6;
}

.tf-region-kanto {
	fill: #10b981;
}

.tf-region-koshinetsu {
	fill: #f59e0b;
}

.tf-region-hokuriku {
	fill: #06b6d4;
}

.tf-region-tokai {
	fill: #f97316;
}

.tf-region-kinki {
	fill: #ef4444;
}

.tf-region-chugoku_shikoku {
	fill: #ec4899;
}

.tf-region-kyushu_okinawa {
	fill: #14b8a6;
}

/* ========== Prefecture Label Styles ========== */
.tf-pref-label,
.tf-japan-map__label {
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell",
		"Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
	font-size: 11px;
	font-weight: 700;
	fill: #ffffff;
	text-anchor: middle;
	dominant-baseline: middle;
	pointer-events: none;
	user-select: none;
	text-shadow:
		0 1px 3px rgba(0, 0, 0, 0.6),
		0 0 1px rgba(0, 0, 0, 0.4);
}

/* ========== Tooltip Styles ========== */
#tf-tooltip {
	position: absolute;
	display: none;
	padding: 0.5rem 0.75rem;
	background: rgba(30, 41, 59, 0.95);
	color: #ffffff;
	border-radius: 0.375rem;
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
	z-index: 1000;
	pointer-events: none;
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell",
		"Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#tf-tooltip.active {
	display: block;
}

/* ========== Region Border Styles ========== */
.tf-region-border-path {
	fill: none;
	stroke-width: 5;
	stroke-linecap: round;
	stroke-linejoin: round;
	pointer-events: none;
	opacity: 0.8;
	filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
}

/* ========== Tooltip Content Styles ========== */
.tf-tooltip-region {
	font-size: 10px;
	font-weight: 600;
	margin-bottom: 2px;
}

.tf-tooltip-name {
	font-size: 13px;
	font-weight: 700;
}

.tf-tooltip-count {
	font-size: 14px;
	font-weight: 700;
	margin-top: 4px;
	color: #ffffff;
}

.tf-tooltip-count--disabled {
	color: #94a3b8;
	font-size: 12px;
}

/* ========== Accessibility Styles ========== */
.tf-japan-map__sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* ========== Legend Styles ========== */
.tf-japan-map__legend {
	margin-top: 1rem;
	padding: 1rem;
	background: #f8fafc;
	border-radius: 0.375rem;
	border: 1px solid #e2e8f0;
	text-align: center;
}

.tf-japan-map__legend-text {
	margin: 0;
	font-size: 14px;
	color: #64748b;
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell",
		"Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
}

/* ========== Title Styles ========== */
.tf-japan-map__title {
	text-align: center;
	font-size: 1.5rem;
	font-weight: bold;
	color: #1e293b;
	margin-bottom: 1.5rem;
	margin-top: 0;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
	.tf-japan-map-container,
	.tf-japan-map__container {
		aspect-ratio: 1 / 1.2;
	}

	.tf-japan-map__title {
		font-size: 1.25rem;
		margin-bottom: 1rem;
	}

	.tf-pref-label,
	.tf-japan-map__label {
		font-size: 9px;
	}

	#tf-tooltip {
		font-size: 11px;
	}
}

@media (max-width: 480px) {
	.tf-japan-map-container,
	.tf-japan-map__container {
		aspect-ratio: 1 / 1.4;
	}

	.tf-japan-map__title {
		font-size: 1.125rem;
	}

	.tf-pref-label,
	.tf-japan-map__label {
		font-size: 8px;
	}

	.tf-map-wrapper {
		padding: 0.75rem;
	}

	.tf-japan-map__legend-text {
		font-size: 0.75rem;
	}
}

/* ========== High Contrast Mode ========== */
@media (prefers-contrast: high) {
	.tf-pref-rect {
		stroke-width: 2;
	}

}

/* ========== Print Styles ========== */
@media print {
	.tf-japan-map-container,
	.tf-japan-map__container {
		break-inside: avoid;
	}
}
