/* ============================================
   PLOTS VIEW - Dedicated CSS
   Extracted from plots-view.php for maintainability
   ============================================ */

/* ============================================
   RISK METRICS CONTAINER
   ============================================ */
.plots-risk-metrics-container {
	display: flex;
	gap: 8px;
	flex-grow: 1;
}

.plots-risk-metric-card {
	background: #ffffff;
	border-radius: 8px;
	padding: 6px 8px;
	display: flex;
	align-items: center;
	gap: 8px;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	border: 1px solid #e9ecef;
	flex: 1;
	max-width: 200px;
}

.plots-risk-metric-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.plots-risk-metric-icon {
	width: 38px;
	height: 38px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.plots-risk-metric-icon i {
	font-size: 1.2em;
}

.plots-risk-metric-content {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	min-width: 0;
}

.plots-risk-metric-label {
	font-size: 0.68em;
	color: #6c757d;
	margin-bottom: 2px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.plots-risk-metric-value {
	font-size: 1.05em;
	font-weight: 700;
	color: #2c3e50;
	line-height: 1.2;
	white-space: nowrap;
}

.plots-risk-metric-unit {
	font-size: 0.62em;
	color: #868e96;
	margin-top: 1px;
}

/* Breakdown card variant (D1/D2/D3, R0/R1/R2) */
.plots-risk-metric-card-breakdown {
	background: #ffffff;
	border-radius: 8px;
	padding: 6px 8px;
	display: flex;
	align-items: center;
	gap: 8px;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	border: 1px solid #e9ecef;
	flex: 1;
	max-width: 240px;
}

.plots-risk-metric-card-breakdown:hover {
	transform: translateY(-2px);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.plots-risk-metric-card-breakdown .plots-risk-metric-icon {
}

.plots-risk-metric-unit-inline {
	font-size: 0.58em;
	color: #868e96;
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
}

.plots-risk-metric-breakdown {
	display: flex;
	flex-direction: column;
	gap: 1px;
	margin-top: 2px;
}

.plots-risk-metric-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 6px;
}

.plots-risk-metric-row-label {
	font-size: 0.7em;
	font-weight: 600;
	color: #6c757d;
	min-width: 20px;
}

.plots-risk-metric-row-value {
	font-size: 0.88em;
	font-weight: 700;
	color: #2c3e50;
	white-space: nowrap;
}

.plots-risk-value-warning {
	color: #ff8c00;
}

.plots-risk-value-danger {
	color: #dc3545;
}

/* ============================================
   MAP LAYER SELECTOR STYLING
   ============================================ */
/* Modern Map Layer Selector Styling */
#overlays {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	background: #ffffff;
    padding: 10px;
}

#overlays::-webkit-scrollbar {
	width: 8px;
}

#overlays::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 4px;
}

#overlays::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 4px;
}

#overlays::-webkit-scrollbar-thumb:hover {
	background: #a1a1a1;
}

.layer-item {
	background: white;
	border-left: 4px solid transparent;
	margin: 2px 4px;
	border-radius: 4px;
	transition: all 0.2s ease;
	cursor: pointer;
	display: flex;
	align-items: center;
	padding: 2px 4px;
	min-height: 28px;
}

.layer-item:hover {
	background: #f5f5f5;
	box-shadow: 0 2px 4px rgba(0,0,0,0.08);
	transform: translateX(2px);
}

.layer-item.checked {
	background: #f0f0f0;
	border-left-color: currentColor;
}

.layer-item.parent-layer {
	font-weight: 500;
	background: white;
}

.layer-item.parent-layer.checked {
	background: #f0f0f0;
}

.layer-item.child-layer {
	margin-left: 20px;
	margin-right: 4px;
	background: white;
	border-left-width: 3px;
	padding-left: 12px;
}

.layer-item.child-layer:hover {
	background: #f5f5f5;
}

.layer-item.child-layer.checked {
	background: #f0f0f0;
}

.layer-checkbox {
	width: 18px;
	height: 18px;
	margin-right: 10px;
	cursor: pointer;
	accent-color: #4CAF50;
	flex-shrink: 0;
}

/* Custom checkbox styling for checked state: green background with white tick */
.layer-checkbox:checked {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	width: 18px;
	height: 18px;
	border: 2px solid #ffffff;
	border-radius: 3px;
	background-color: #4CAF50;
	position: relative;
	cursor: pointer;
}

.layer-checkbox:checked::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 2px;
	width: 4px;
	height: 8px;
	border: solid white;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.layer-label {
	flex: 1;
	font-size: 12px;
	cursor: pointer;
	user-select: none;
	line-height: 1.4;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	font-weight: 500;
}

.layer-item.child-layer .layer-label {
	font-size: 11px;
	font-weight: 400;
}

.layer-actions {
	display: flex;
	gap: 6px;
	align-items: center;
	flex-shrink: 0;
	margin-left: 6px;
}

.layer-toggle-icon {
	cursor: pointer;
	color: #666;
	transition: all 0.2s ease;
	font-size: 12px;
	padding: 4px;
	border-radius: 4px;
}

.layer-toggle-icon:hover {
	background: rgba(0,0,0,0.05);
	color: #333;
}

.layer-download-icon {
	cursor: pointer;
	color: #999;
	transition: all 0.2s ease;
	font-size: 18px;
}

.layer-item.child-layer .layer-download-icon {
	font-size: 16px;
}

.layer-download-icon:hover {
	color: #666;
	transform: scale(1.15);
}

/* Wrapper for tooltip - doesn't interfere with FontAwesome icon */
.download-icon-wrapper {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.download-icon-wrapper:hover {
	background: rgba(66, 133, 244, 0.1);
}

/* Custom tooltip for download icon - appears to the left */
.download-icon-wrapper[data-tooltip]::before {
	content: attr(data-tooltip);
	position: absolute;
	top: 50%;
	right: 100%;
	transform: translateY(-50%) translateX(-8px);
	background-color: #333;
	color: #fff;
	padding: 6px 10px;
	border-radius: 4px;
	font-size: 11px;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	z-index: 10000;
	font-family: Arial, sans-serif;
	font-weight: normal;
	line-height: 1.2;
}

.download-icon-wrapper[data-tooltip]::after {
	content: '';
	position: absolute;
	top: 50%;
	right: 100%;
	transform: translateY(-50%) translateX(-2px);
	border: 4px solid transparent;
	border-left-color: #333;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	z-index: 10000;
}

.download-icon-wrapper[data-tooltip]:hover::before,
.download-icon-wrapper[data-tooltip]:hover::after {
	opacity: 1;
	visibility: visible;
}

.download-icon-wrapper[data-tooltip]:hover::before {
	transform: translateY(-50%) translateX(-4px);
}

.download-icon-wrapper[data-tooltip]:hover::after {
	transform: translateY(-50%) translateX(2px);
}

.layer-download-icon[data-tooltip]:hover::before {
	transform: translateY(-50%) translateX(-4px);
}

.layer-download-icon[data-tooltip]:hover::after {
	transform: translateY(-50%) translateX(2px);
}

/* Color coding for different layer types */
.layer-item[data-color="red"] { border-left-color: #e53935; }
.layer-item[data-color="blue"] { border-left-color: #4285F4; }
.layer-item[data-color="green"] { border-left-color: #43a047; }
.layer-item[data-color="purple"] { border-left-color: #8e24aa; }
.layer-item[data-color="orange"] { border-left-color: #fb8c00; }
.layer-item[data-color="grey"] { border-left-color: #757575; }

.layer-label[data-color="red"] { color: #e53935; }
.layer-label[data-color="blue"] { color: #4285F4; }
.layer-label[data-color="green"] { color: #43a047; }
.layer-label[data-color="purple"] { color: #8e24aa; }
.layer-label[data-color="orange"] { color: #fb8c00; }
.layer-label[data-color="grey"] { color: #757575; }

/* Indeterminate checkbox styling */
.layer-checkbox:indeterminate {
	accent-color: #ff9800;
}

/* Disabled checkbox styling during loading */
.layer-checkbox:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.layer-item:has(.layer-checkbox:disabled) {
	opacity: 0.85;
}

/* ============================================
   SWEET ALERT STYLING
   ============================================ */
.swal-container-class {
	z-index: 9999;
}

/* ============================================
   CAPTURE MODE AND MISC STYLES
   ============================================ */
.capture-mode .gm-control-active,
.capture-mode .gm-fullscreen-control,
.capture-mode .gm-svpc,
.capture-mode .gmnoprint,
.capture-mode [class^="custom-map-control"],
.capture-mode #coordInfo,
.capture-mode #coordListDiv,
.capture-mode #distanceDiv,
.capture-mode div[style*="position: relative; width: 120px; height: 120px;"],
/* Navigation controls */
.capture-mode div[style*="background: rgb(33, 150, 243)"],
/* Measure button */
.capture-mode div[style*="background-color: rgb(33, 150, 243)"],
/* Capture button */
.capture-mode div[style*="padding: 10px"] {
	display: none !important;
}

/* Out-of-date warning styling */
#outOfDateWarning {
	/* No animation - static display */
}

/* Compact table styling for overlays and maps */
#overlays table tr, #maps table tr {
	line-height: 1.2;
}
#overlays table td, #maps table td {
	vertical-align: middle;
}

/* ============================================
   COMPASS ROSE NAVIGATION CONTROL
   ============================================ */
.compass-rose-wrapper {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Toggle button (collapsed state) */
.compass-toggle-button {
	width: 42px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s ease;
	background-color: #4285F4;
	color: white;
	border: none;
}

.compass-toggle-button:hover {
	background-color: #3367D6;
	transform: scale(1.05);
}

.compass-toggle-button:active {
	transform: scale(0.95);
}

/* Compass rose container (expanded state) */
.compass-rose {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
	z-index: 10000;
	pointer-events: none;
	background: none;
}

.compass-rose.expanded {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
	pointer-events: auto;
}

/* Compass circle container */
.compass-circle {
	position: relative;
	width: 120px;
	height: 120px;
	border-radius: 50%;
	background: none;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Direction segment buttons */
.compass-segment {
	position: absolute;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: bold;
	cursor: pointer;
	background-color: #4285F4;
	color: white;
	border: 2px solid white;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	transition: all 0.2s ease;
	padding: 0;
	z-index: 2;
}

/* Position segments around the circle using IDs */
#navNorth {
	top: -6px;
	left: 50%;
	transform: translateX(-50%);
}

#navNorthEast {
	top: 8px;
	right: 8px;
}

#navEast {
	top: 50%;
	right: -6px;
	transform: translateY(-50%);
}

#navSouthEast {
	bottom: 8px;
	right: 8px;
}

#navSouth {
	bottom: -6px;
	left: 50%;
	transform: translateX(-50%);
}

#navSouthWest {
	bottom: 8px;
	left: 8px;
}

#navWest {
	top: 50%;
	left: -6px;
	transform: translateY(-50%);
}

#navNorthWest {
	top: 8px;
	left: 8px;
}

.compass-segment:hover {
	background-color: #3367D6;
	transform: scale(1.15);
	z-index: 3;
}

/* Override transforms for cardinal directions on hover */
#navNorth:hover {
	transform: translateX(-50%) scale(1.15);
}

#navEast:hover {
	transform: translateY(-50%) scale(1.15);
}

#navSouth:hover {
	transform: translateX(-50%) scale(1.15);
}

#navWest:hover {
	transform: translateY(-50%) scale(1.15);
}

.compass-segment:active {
	background-color: #0d47a1;
}

/* Center button */
.compass-center {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	cursor: pointer;
	background-color: #ff9800;
	color: white;
	border: 3px solid white;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
	transition: all 0.2s ease;
	padding: 0;
	z-index: 4;
}

.compass-center:hover {
	background-color: #f57c00;
	transform: translate(-50%, -50%) scale(1.1);
}

.compass-center:active {
	background-color: #e65100;
	transform: translate(-50%, -50%) scale(0.95);
}

/* Hide compass rose during capture mode */
.capture-mode .compass-rose-wrapper,
.capture-mode #compassRoseContainer {
	display: none !important;
}

/* ==================================================================================
   PROGRESS OVERLAY - Matrix Calculation Progress Indicator
   ================================================================================== */

#progressOverlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.1);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10000;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.progress-container {
	background: white;
	border-radius: 16px;
	padding: 40px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	max-width: 960px;
	width: 90%;
	animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateY(-20px) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.progress-header {
	text-align: center;
	margin-bottom: 30px;
}

.progress-header h2 {
	margin: 0 0 10px 0;
	color: #4285F4;
	font-size: 24px;
	font-weight: 600;
}

.progress-status {
	color: #666;
	font-size: 14px;
	margin: 0;
}

/* Overall Progress */
.progress-overall {
	margin-bottom: 35px;
}

.progress-overall-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 12px;
}

.progress-overall-label {
	font-weight: 600;
	color: #333;
	font-size: 16px;
}

.progress-overall-percent {
	font-size: 28px;
	font-weight: 700;
	color: #4285F4;
}

.progress-overall-eta {
	font-size: 13px;
	color: #666;
	margin-top: 8px;
	text-align: center;
}

/* Ensure Overall Progress bar container is full width */
.progress-overall .progress-bar-container {
	width: 100%;
	display: block;
}

/* Elapsed Time Progress */
.progress-elapsed {
	margin-bottom: 25px;
}

.progress-elapsed-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 12px;
}

.progress-elapsed-label {
	font-weight: 500;
	color: #555;
	font-size: 14px;
}

.progress-elapsed-time {
	font-size: 20px;
	font-weight: 700;
	color: #ff9800;
}

.progress-elapsed .progress-bar-container {
	width: 100%;
	display: block;
	height: 16px;
}

.progress-bar.elapsed {
	background: linear-gradient(90deg, #ff9800 0%, #f57c00 100%);
}

.progress-elapsed-footer {
	display: flex;
	align-items: baseline;
	gap: 4px;
	margin-top: 8px;
	font-size: 12px;
}

.progress-elapsed-counter {
	font-weight: 700;
	color: #ff9800;
	font-size: 14px;
}

.progress-elapsed-max {
	color: #999;
}

.progress-bar-container {
	background: #e0e0e0;
	border-radius: 4px;
	height: 20px;
	overflow: hidden;
	position: relative;
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #4285F4 0%, #3367D6 100%);
	border-radius: 4px;
	transition: width 0.3s ease;
	position: relative;
	overflow: hidden;
}

.progress-bar::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(255, 255, 255, 0.3) 50%,
		transparent 100%
	);
	animation: shimmer 2s infinite;
}

@keyframes shimmer {
	0% {
		transform: translateX(-100%);
	}
	100% {
		transform: translateX(100%);
	}
}

/* Phase Progress */
.progress-phases {
	margin-bottom: 25px;
}

.progress-phase {
	margin-bottom: 20px;
}

.progress-phase:last-child {
	margin-bottom: 0;
}

.progress-phase-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 8px;
}

.progress-phase-label {
	font-weight: 500;
	color: #555;
	font-size: 14px;
}

.progress-phase-percent {
	font-weight: 600;
	font-size: 14px;
}

.progress-phase-details {
	font-size: 12px;
	color: #888;
	margin-top: 4px;
}

.progress-phase-bar-container {
	background: #f0f0f0;
	border-radius: 4px;
	height: 12px;
	overflow: hidden;
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-phase-bar {
	height: 100%;
	border-radius: 4px;
	transition: width 0.3s ease;
	position: relative;
}

.progress-phase-bar.matrix {
	background: linear-gradient(90deg, #e74c3c 0%, #f39c12 100%);
}

.progress-phase-bar.database {
	background: linear-gradient(90deg, #3498db 0%, #2ecc71 100%);
}

.progress-phase-bar.geojson {
	background: linear-gradient(90deg, #9b59b6 0%, #e74c3c 100%);
}

/* Completion Message */
.progress-complete {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 10px 14px;
	background: #e8f5e9;
	border-radius: 8px;
	margin-top: 12px;
}

.progress-complete i {
	font-size: 22px;
	color: #4caf50;
}

.progress-complete span {
	color: #2e7d32;
	font-size: 14px;
	font-weight: 600;
}

/* Two-Column Layout */
.progress-columns {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px;
	margin-bottom: 20px;
}

.progress-column-left {
	min-width: 0;
}

.progress-column-right {
	min-width: 0;
	display: flex;
	flex-direction: column;
}

/* Iteration Progress Bar */
.progress-iteration {
	margin-bottom: 12px;
}

.progress-phase-bar.iteration {
	background: linear-gradient(90deg, #4285F4 0%, #34a853 100%);
}

/* Cumulative Statistics Panel */
.progress-stats-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 16px;
	padding-bottom: 10px;
	border-bottom: 2px solid #e0e0e0;
}

.progress-stats-header i {
	color: #4285F4;
	font-size: 16px;
}

.progress-stats-header span {
	font-weight: 600;
	color: #333;
	font-size: 15px;
}

.progress-stats-grid {
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1;
}

.progress-stat-row {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.progress-stat-label {
	font-size: 11px;
	color: #777;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.progress-stat-values {
	display: flex;
	gap: 4px;
}

.progress-stat-value {
	flex: 1;
	font-size: 15px;
	font-weight: 700;
	font-family: 'Courier New', Courier, monospace;
	padding: 4px 8px;
	border-radius: 4px;
	text-align: right;
	background-color: #f5f5f5;
	color: #333;
	transition: background-color 0.4s ease, color 0.4s ease;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.progress-stat-value-frozen {
	opacity: 0.85;
}

/* Responsive: stack columns on narrow screens */
@media (max-width: 768px) {
	.progress-columns {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.progress-container {
		max-width: 650px;
	}
}
