/* タイムライン アニメーション用 CSS */

/* スライダー横の時刻表示 */
.time-display.compact {
	background: rgba(255, 255, 255, 0.9);
	border-radius: 4px;
	padding: 4px 8px;
	margin: 0;
	width: 120px;
	min-width: 120px;
	text-align: center;
	flex-shrink: 0;
}

.time-display.compact span {
	font-family: 'Times New Roman', 'Yu Mincho', '游明朝', serif;
	font-size: 1.1em;
	font-weight: 600;
	color: #333;
	white-space: nowrap;
}

/* エラーメッセージ */
.error-message {
	position: fixed;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	background: #ff4444;
	color: white;
	padding: 15px 25px;
	border-radius: 5px;
	z-index: 10000;
	font-weight: bold;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* タイムラインコントロール */
.timeline-controls {
	position: absolute;
	bottom: 15px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(255, 255, 255, 0.95);
	border-radius: 8px;
	padding: 15px;
	box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
	z-index: 1000;
	backdrop-filter: blur(10px);
	max-height: 200px;
	width: 700px;
	max-width: calc(100vw - 30px);
}

/* コンパクトバージョン */
.timeline-controls.compact {
	padding: 8px 12px;
	max-height: 60px;
}

.timeline-content {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	flex-wrap: wrap;
}

.timeline-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid #e0e0e0;
}

.timeline-header h3 {
	margin: 0;
	color: #333;
	font-size: 1.1em;
}

.current-stats {
	font-size: 0.85em;
	color: #666;
	text-align: right;
	line-height: 1.3;
}

/* タイムライン進捗バー（削除：スライダーと統一） */

/* タイムラインスライダー */
.timeline-slider-container {
	margin: 10px 0;
}

.timeline-slider-container label {
	display: block;
	font-weight: bold;
	margin-bottom: 6px;
	color: #333;
	font-size: 0.9em;
}

.timeline-slider {
	width: 100%;
	height: 8px;
	border-radius: 4px;
	background: linear-gradient(
		to right,
		#ff6b6b 0%,
		#ff6b6b var(--progress, 0%),
		#e0e0e0 var(--progress, 0%),
		#e0e0e0 100%
	);
	outline: none;
	-webkit-appearance: none;
	margin: 8px 0;
	cursor: pointer;
	transition: background 0.2s ease;
}

.timeline-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #ff6b6b;
	cursor: pointer;
	border: 2px solid white;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
	transition: all 0.2s ease;
}

.timeline-slider::-webkit-slider-thumb:hover {
	transform: scale(1.1);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.timeline-slider::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #ff6b6b;
	cursor: pointer;
	border: 2px solid white;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.year-labels {
	display: flex;
	justify-content: space-between;
	font-size: 0.8em;
	color: #666;
	margin-top: 5px;
}

/* 再生コントロール */
.playback-controls {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin: 10px 0;
}

.control-btn {
	padding: 8px 12px;
	border: none;
	border-radius: 4px;
	font-size: 0.85em;
	font-weight: bold;
	cursor: pointer;
	transition: all 0.2s ease;
	min-width: 80px;
}

.play-btn {
	background: #4caf50;
	color: white;
}

.play-btn:hover:not(:disabled) {
	background: #45a049;
	transform: translateY(-1px);
}

.pause-btn {
	background: #ff9800;
	color: white;
}

.pause-btn:hover:not(:disabled) {
	background: #e68900;
	transform: translateY(-1px);
}

.stop-btn {
	background: #f44336;
	color: white;
}

.stop-btn:hover:not(:disabled) {
	background: #da190b;
	transform: translateY(-1px);
}

.control-btn:disabled {
	background: #cccccc;
	color: #666;
	cursor: not-allowed;
	transform: none;
}

/* 速度コントロール */
.speed-controls {
	text-align: center;
	margin-top: 10px;
}

.speed-controls label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.8em;
	color: #333;
}

.speed-slider {
	width: 150px;
	height: 4px;
	border-radius: 2px;
	background: #e0e0e0;
	outline: none;
	-webkit-appearance: none;
}

.speed-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #2196f3;
	cursor: pointer;
	border: 1px solid white;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.speed-slider::-moz-range-thumb {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #2196f3;
	cursor: pointer;
	border: 1px solid white;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* モードコントロール */
.mode-controls {
	margin-bottom: 15px;
}

.mode-toggle-btn {
	background: #6c5ce7;
	color: white;
	border: none;
	padding: 8px 16px;
	border-radius: 5px;
	cursor: pointer;
	font-size: 0.9em;
	transition: background 0.2s ease;
}

.mode-toggle-btn:hover {
	background: #5a4fcf;
}

/* 凡例スタイル */
.legend {
	margin-top: 15px;
}

.legend h4 {
	margin: 0 0 10px 0;
	color: #333;
	font-size: 1em;
}

.legend-item {
	display: flex;
	align-items: center;
	margin-bottom: 8px;
	font-size: 0.9em;
}

.legend-symbol {
	width: 16px;
	height: 16px;
	margin-right: 8px;
	border-radius: 50%;
	display: inline-block;
}

.legend-symbol.main-point {
	background: #ff4444;
	border: 2px solid white;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.legend-symbol.sub-point {
	background: #4444ff;
	border: 1px solid white;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.legend-symbol.triangle-line {
	background: none;
	border: 2px solid #ff6666;
	border-radius: 0;
	width: 20px;
	height: 3px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
	.timeline-controls {
		bottom: 10px;
		left: 10px;
		right: 10px;
		padding: 15px;
	}

	.timeline-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	.current-stats {
		text-align: left;
		font-size: 0.8em;
	}

	.playback-controls {
		flex-wrap: wrap;
		gap: 8px;
	}

	.control-btn {
		min-width: 80px;
		padding: 8px 12px;
		font-size: 0.8em;
	}

	.speed-slider {
		width: 150px;
	}
}

/* コンパクト版スタイル */
.timeline-slider.compact {
	width: 300px;
	height: 4px;
}

.timeline-slider.compact::-webkit-slider-thumb {
	width: 14px;
	height: 14px;
}

.playback-controls.compact {
	display: flex;
	gap: 4px;
	margin: 0;
}

.control-btn.compact {
	padding: 4px 8px;
	font-size: 0.9em;
	min-width: auto;
	border-radius: 3px;
	background: #f5f5f5;
	color: #333;
	border: 1px solid #ccc;
}

.control-btn.compact:hover {
	background: #e0e0e0;
}

.control-btn.compact:disabled {
	background: #f9f9f9;
	color: #aaa;
}

.speed-controls.compact {
	display: flex;
	align-items: center;
	gap: 6px;
}

.speed-controls.compact label {
	font-size: 0.85em;
	color: #666;
	margin: 0;
}

.speed-select.compact {
	padding: 2px 6px;
	font-size: 0.8em;
	border: 1px solid #ccc;
	border-radius: 3px;
	background: white;
	min-width: 50px;
}

.current-stats.compact {
	font-size: 0.75em;
	color: #666;
	margin: 0;
	white-space: nowrap;
}

/* モバイル対応 */
@media (max-width: 768px) {
	.timeline-controls.compact {
		width: calc(100vw - 20px);
		padding: 6px 8px;
	}

	.timeline-content {
		gap: 8px;
	}

	.timeline-slider.compact {
		width: 200px;
	}

	.control-btn.compact {
		padding: 6px 10px;
		font-size: 0.8em;
	}

	.speed-select.compact {
		font-size: 0.75em;
		padding: 1px 4px;
	}

	.speed-controls.compact label {
		font-size: 0.8em;
	}

	.map-time-display {
		width: 160px;
		padding: 10px 16px;
	}

	.map-time-display span {
		font-size: 1.4em;
	}

	.map-controls {
		bottom: 80px;
		right: 10px;
		max-width: 200px;
	}

	.info-panel {
		padding: 10px;
	}
}

@media (max-width: 480px) {
	.timeline-controls.compact {
		width: calc(100vw - 10px);
		padding: 4px 6px;
	}

	.timeline-content {
		gap: 6px;
		flex-wrap: nowrap;
		overflow-x: auto;
	}

	.time-display.compact {
		width: 100px;
		min-width: 100px;
		font-size: 0.9em;
	}

	.timeline-slider.compact {
		width: 120px;
		flex-shrink: 0;
	}

	.control-btn.compact {
		padding: 4px 6px;
		font-size: 0.75em;
		min-width: 28px;
		flex-shrink: 0;
	}

	.speed-controls.compact {
		flex-shrink: 0;
	}

	.speed-select.compact {
		min-width: 45px;
	}

	.map-time-display {
		width: 140px;
		padding: 8px 12px;
		left: 10px;
	}

	.map-time-display span {
		font-size: 1.2em;
	}
}

/* マップコントロール */
.map-controls {
	position: absolute;
	bottom: 90px;
	right: 20px;
	z-index: 1000;
	max-width: 250px;
}

.info-panel {
	background: rgba(255, 255, 255, 0.95);
	border-radius: 8px;
	padding: 15px;
	margin-bottom: 10px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	backdrop-filter: blur(10px);
}

.basemap-controls {
	background: rgba(255, 255, 255, 0.95);
	border-radius: 8px;
	padding: 15px;
	margin-bottom: 10px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	backdrop-filter: blur(10px);
}

.basemap-controls h3 {
	margin: 0 0 10px 0;
	color: #333;
	font-size: 14px;
}

.basemap-controls select {
	width: 100%;
	padding: 8px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: white;
	font-size: 12px;
}

/* アニメーション効果 */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.timeline-controls {
	animation: fadeIn 0.5s ease;
}

/* 三角点が追加される際のアニメーション（将来の拡張用） */
.point-appear {
	animation: pointFadeIn 0.5s ease;
}

@keyframes pointFadeIn {
	from {
		opacity: 0;
		transform: scale(0.5);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}
