/* 3D tracking page (MapLibre GL). Reuses tracking.css for the shared overlay
   and vessel-popup inner styles; this file covers the layout, the 3D control
   stack and the MapLibre popup chrome. */

.t3d-container {
	position: relative;
	height: calc(100vh - 56px);
	background: var(--dark-bg-primary, #1a1a2e);
	overflow: hidden;
}

.t3d-map {
	width: 100%;
	height: 100%;
}

/* WebGL-unavailable notice */
.t3d-unsupported {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: var(--dark-bg-primary, #1a1a2e);
	color: #fff;
	z-index: 500;
	text-align: center;
	padding: 20px;
}

.t3d-unsupported i {
	font-size: 48px;
	opacity: 0.5;
}

.t3d-back-link {
	color: var(--accent-yellow, #ffc107);
	font-weight: 600;
}

/* Right-side 3D control stack */
.t3d-controls {
	position: absolute;
	top: 70px;
	right: 10px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	z-index: 400;
}

.t3d-btn {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 8px 12px;
	background: rgba(22, 33, 62, 0.85);
	backdrop-filter: blur(6px);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 8px;
	color: #cfd8e3;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
}

.t3d-btn:hover {
	background: rgba(34, 50, 90, 0.95);
	color: #fff;
}

.t3d-btn.active {
	background: rgba(246, 81, 29, 0.85);
	border-color: rgba(246, 81, 29, 1);
	color: #fff;
}

.t3d-btn i {
	width: 14px;
	text-align: center;
}

.t3d-btn-group {
	display: flex;
	gap: 4px;
}

.t3d-btn-small {
	flex: 1;
	justify-content: center;
	padding: 8px 6px;
}

.t3d-btn-small i {
	width: auto;
}

.t3d-2d-link {
	text-decoration: none;
	display: flex;
	align-items: center;
	gap: 4px;
	width: auto;
	padding: 0 10px;
	/* .overlay-refresh is a 28px circle; widened, 50% would render as an oval */
	border-radius: 14px;
	font-size: 11px;
	font-weight: 700;
}

.t3d-2d-link:hover {
	text-decoration: none;
}

/* MapLibre popup chrome, matching the Leaflet vessel popup look */
.vessel-popup-container .maplibregl-popup-content {
	background: linear-gradient(135deg, var(--dark-bg-primary, #1a1a2e) 0%, #16213e 100%);
	border-radius: 12px;
	padding: 0;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
	border: 1px solid var(--dark-border, #2a2a4a);
	min-width: 200px;
}

.vessel-popup-container .maplibregl-popup-tip {
	border-top-color: #16213e;
	border-bottom-color: #16213e;
}

.vessel-popup-container .maplibregl-popup-close-button {
	color: var(--dark-text-muted, #8a8aa8);
	font-size: 20px;
	top: 4px;
	right: 8px;
	background: none;
}

.vessel-popup-container .maplibregl-popup-close-button:hover {
	color: var(--accent-yellow, #ffc107);
	background: none;
}

/* Attribution readable on satellite imagery */
.t3d-map .maplibregl-ctrl-attrib {
	background: rgba(0, 0, 0, 0.4);
	color: #ccc;
}

.t3d-map .maplibregl-ctrl-attrib a {
	color: #ddd;
}

@media (max-width: 768px) {
	.t3d-controls {
		top: auto;
		bottom: 120px;
	}

	.t3d-btn span {
		display: none;
	}

	.t3d-btn,
	.t3d-btn-small {
		justify-content: center;
		padding: 10px;
	}
}
