* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	background: black;
}

body {
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	overflow: hidden;
	background: white;
}

body.recording {
	position: absolute !important;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: min(100vw, calc(100vh * 16 / 9));
	height: min(100vh, calc(100vw * 9 / 16));
}

body.recording,
body.recording * {
	cursor: none !important;
}

body.recording #map {
	width: 100%;
	height: 100%;
}

#map {
	width: 100vw;
	height: 100vh;
}

.controls,
.info-box {
	position: absolute;
	z-index: 1000;
	border-radius: 10px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.controls {
	top: 20px;
	right: 20px;
	background: white;
	padding: 15px;
	transition: all 0.3s ease;
}

.controls.collapsed {
	padding: 8px;
}

.controls.collapsed .controls-content {
	display: none;
}

.controls-content {
	transition: opacity 0.3s ease;
}

.toggle-btn {
	padding: 8px 12px !important;
	margin: 0 0 10px 0 !important;
	background: #666 !important;
	font-size: 12px !important;
	min-width: auto !important;
	transition: transform 0.3s ease, background 0.3s ease;
}

.toggle-btn:hover {
	background: #555 !important;
}

.controls.collapsed .toggle-btn {
	margin: 0 !important;
	transform: rotate(180deg);
}

.info-box {
	bottom: 30px;
	left: 30px;
	background: rgba(255, 255, 255, 0.95);
	padding: 20px;
	max-width: 90vw;
	transition: opacity 0.8s;
}

.info-box.hidden {
	opacity: 0;
	pointer-events: none;
}

.info-box h2 {
	margin-bottom: 10px;
	color: #333;
	font-size: 20px;
}

.info-box p {
	color: #666;
	line-height: 1.3;
	margin: 5px 0;
}

strong {
	font-weight: lighter;
}

button,
.upload-btn,
.delete-btn {
	border: none;
	border-radius: 6px;
	color: white;
	cursor: pointer;
	transition: background 0.3s;
}

button {
	padding: 12px 24px;
	margin-bottom: 10px;
	background: #4285f4;
	font-size: 16px;
	display: block;
	width: 100%;
}

button:hover {
	background: #357abd;
}

button:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.upload-btn,
.delete-btn {
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.upload-btn {
	flex: 1;
	padding: 10px 20px;
	background: #34a853;
	text-align: center;
	font-size: 14px;
}

.upload-btn:hover {
	background: #2d8e47;
}

.delete-btn {
	padding: 0;
	margin: 0;
	background: #ea4335;
	font-size: 16px;
	width: 40px;
	min-width: 40px;
	display: none;
}

.delete-btn.visible {
	display: flex;
}

.delete-btn:hover {
	background: #c5381e;
}

/* GPX Upload section */
.gpx-upload {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #e0e0e0;
}

.gpx-buttons {
	display: flex;
	gap: 8px;
	align-items: center;
}

#gpxFileName {
	display: block;
	margin-top: 8px;
	font-size: 12px;
	color: #666;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Speed control */
.speed-control {
	margin-top: 10px;
}

.speed-control label {
	display: block;
	margin-bottom: 5px;
	font-size: 14px;
}

.speed-control input {
	width: 100%;
}

/* Weight control */
.weight-control {
	margin-top: 10px;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
}

.weight-control input {
	width: 60px;
	padding: 4px 8px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
}

.weight-control #weightLabel {
	display: none;
}

/* Densified track toggle */
.densified-control {
	margin-top: 10px;
	font-size: 14px;
}

.densified-control label {
	display: flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	user-select: none;
}

.densified-control input[type="checkbox"] {
	width: 16px;
	height: 16px;
	cursor: pointer;
}

/* Progress indicator */
.progress {
	margin-top: 10px;
	font-weight: bold;
	color: #4285f4;
	font-size: 18px;
}

/* Countdown animation */
.countdown {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 120px;
	font-weight: bold;
	color: white;
	text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
	z-index: 2000;
	animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
	0% {
		transform: translate(-50%, -50%) scale(0.5);
		opacity: 0;
	}
	50% {
		transform: translate(-50%, -50%) scale(1.2);
		opacity: 1;
	}
	100% {
		transform: translate(-50%, -50%) scale(1);
		opacity: 1;
	}
}

/* Mobile devices - свернутая панель по умолчанию */
@media (max-width: 768px) {
	.info-box {
		max-width: calc(100vw - 60px);
		font-size: 14px;
	}
}
