:root {
	--border-radius: 8px;
}

body {
	font-family: 'geomanist', Arial, sans-serif;
	font-size: 18px;
	padding: 0;
	margin: 0;
	background: #3D3D3D;
}

header {
	text-align: center;
}

h1,
h2 {
	margin: 20px 0;
	font-size: 1.5em;
}

#finalLocation,
form {
	display: flex;
	flex-direction: column;
	gap: 20px;

	@media screen and (min-width: 1056px) {
		flex-direction: row;
		align-items: center;
	}
}

a {
	color: #ED3624;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

input,
button {
	padding: 10px;
	border-radius: var(--border-radius);
	border: 1px solid #ccc;
	font-size: 18px;
}

input:not([type='checkbox']) {
	min-width: 80px;
}

input:not(:valid) {
	border-color: #ED3624;
}

button {
	padding: 10px 25px;
	background-color: #ED3624;
	color: white;
	cursor: pointer;
}

button:hover {
	background-color: #D92E20;
}

hr {
	width: 100%;
	border: 0.75px solid #ED3624;
}

.stop-btn {
	background-color: #ED3624;
}
.stop-btn:hover {
	background-color: #D92E20;
}

.logo {
	width: 200px;
	height: auto;
}

.container-login {
	display: flex;
	flex-direction: column;
	margin: 50px 15px;
	padding: 20px;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: var(--border-radius);

	@media screen and (min-width: 480px) {
		margin: 50px auto;
		max-width: 400px;
	}

	form {
		display: flex;
		flex-direction: column;
	}
}

/* ADMIN DASHBOARD STYLING */
.dashboard-container {
	display: flex;
	flex-direction: column;
	padding: 20px 40px;
	margin: 20px;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: var(--border-radius);
}
.winner {
	margin-top: 20px;
	background: #f0f0f0;
	padding: 15px;
	border-radius: var(--border-radius);
}

.date-block {
	display: flex;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.date {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px;

	span {
		background-color: #ED3624;
		color: #fff;
		padding: 10px;
		border-radius: var(--border-radius);
		margin-right: 10px;
	}
	margin-bottom: 10px;
}

.error-message {
	text-align: center;
	display: none;
	color: #ED3624;
}

/* ========================================
   Map Styles
   ======================================== */
.map-container {
	margin: 20px 0;
	background: white;
	border-radius: var(--border-radius);
	padding: 20px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.map-container h2 {
	margin-top: 0;
	color: #ED3624;
}

#admin-map {
	width: 100%;
	height: 600px;
	border-radius: var(--border-radius);
	border: 2px solid #e0e0e0;
	background-color: #f0f0f0;
}

/* ========================================
   MapLibre Popup Overrides
   ======================================== */
.maplibregl-popup-content {
	background-color: #ED3624 !important;
	padding: 0 !important;
	border-radius: 8px !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

/* Popup arrow/tip colors for all anchor positions */
.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
	border-bottom-color: #ED3624 !important;
}

.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
	border-top-color: #ED3624 !important;
}

.maplibregl-popup-anchor-left .maplibregl-popup-tip {
	border-right-color: #ED3624 !important;
}

.maplibregl-popup-anchor-right .maplibregl-popup-tip {
	border-left-color: #ED3624 !important;
}

.maplibregl-popup-close-button {
	color: #fff !important;
	font-size: 24px !important;
	padding: 8px !important;
	transition: opacity 0.2s ease;
}

.maplibregl-popup-close-button:hover {
	opacity: 0.7;
	background-color: transparent !important;
}

/* ========================================
   Pin Popup Styles (Individual Pins)
   ======================================== */
.pin-popup {
	font-family: 'geomanist', Arial, sans-serif;
	width: auto;
	padding: 15px;
	color: #fff;
}

.pin-popup__name {
	margin: 0 0 10px 0;
	font-size: 1.2em;
	font-weight: bold;
	color: #fff;
	border-bottom: 2px solid rgba(255, 255, 255, 0.5);
	padding-bottom: 8px;
}

.pin-popup__info {
	font-size: 0.9em;
	line-height: 1.6;
}

.pin-popup__info p {
	margin: 8px 0;
	color: #fff;
	word-wrap: break-word;
}

.pin-popup__info strong {
	color: rgba(255, 255, 255, 0.9);
	font-weight: 600;
}

/* ========================================
   Cluster Popup Styles (Multiple Pins)
   ======================================== */
.cluster-popup {
	font-family: 'geomanist', Arial, sans-serif;
	width: auto;
	min-width: 300px;
	max-width: 400px;
	padding: 15px;
	color: #fff;
	max-height: 400px;
	overflow-y: auto;
}

/* Custom scrollbar for cluster popup */
.cluster-popup::-webkit-scrollbar {
	width: 8px;
}

.cluster-popup::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.1);
	border-radius: 4px;
}

.cluster-popup::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.3);
	border-radius: 4px;
}

.cluster-popup::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.5);
}

.cluster-popup__title {
	margin: 0 0 15px 0;
	font-size: 1.3em;
	font-weight: bold;
	color: #fff;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
	border-bottom: 2px solid #dc3c96;
	padding-bottom: 10px;
}

.cluster-popup__list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cluster-pin-item {
	padding: 12px;
	background-color: rgba(255, 255, 255, 0.1);
	border-radius: 6px;
	border-left: 3px solid #dc3c96;
	transition: background-color 0.2s ease, transform 0.1s ease;
}

.cluster-pin-item:hover {
	background-color: rgba(255, 255, 255, 0.15);
	transform: translateX(2px);
}

.cluster-pin-name {
	font-weight: bold;
	font-size: 1.05em;
	margin-bottom: 6px;
	color: #fff;
}

.cluster-pin-detail {
	font-size: 0.85em;
	margin: 4px 0;
	color: #f0f0f0;
	line-height: 1.5;
}

.cluster-pin-detail strong {
	color: rgba(255, 255, 255, 0.9);
	font-weight: 600;
}

/* Pins Table */
.pins-table-container {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #ddd;
}

.pins-table-container h3 {
	margin-bottom: 10px;
}

.table-wrapper {
	overflow-x: auto;
	border: 1px solid #ddd;
}

.pins-table {
	width: 100%;
	border-collapse: collapse;
	background-color: white;
}

.pins-table th,
.pins-table td {
	padding: 8px;
	border-bottom: 1px solid #ddd;
}

.pins-table th {
	text-align: left;
	background-color: #f0f0f0;
}

.pins-table td {
	border-bottom-color: #eee;
}

.pins-table tbody tr:hover {
	background-color: #f9f9f9;
}

.table-loading,
.table-empty,
.table-error {
	text-align: center;
	padding: 20px !important;
	font-style: italic;
	color: #666;
}

.table-error,
.can-free-time-no {
	color: #d32f2f;
}

.can-free-time-yes {
	color: #2e7d32;
}

.pagination-controls {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 10px;
	gap: 10px;
}

.pagination-info {
	flex: 1;
	text-align: center;
}
.history-modal-wrapper {
	width: 100dvw;
	height: 100dvh;

	position: fixed;
	top: 0;
	left: 0;
	z-index: 10;

	display: none;
	justify-content: center;
	align-items: center;

	background-color: #ed3524c4;
	backdrop-filter: blur(2px);
}

.history-modal {
	width: 600px;
	max-width: 90vw;
	max-height: 90vh;

	display: flex;
	flex-direction: column;
	gap: 24px;

	background: #fff;
	padding: 32px 24px;
	box-shadow: 0 8px 32px #ed35243a;

	overflow-y: auto;
}

.history-modal::-webkit-scrollbar {
	width: 8px;
}

.history-modal {
	scrollbar-width: thin;
	scrollbar-color: #ED3624 transparent;
}

.history-modal::-webkit-scrollbar-thumb {
	background: #ED3624;
	border-radius: 0 16px 16px 0;
}

.history-modal .header {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	border-bottom: 1px solid #e0e0e0;
	padding-bottom: 12px;
	margin-bottom: 12px;
}

.history-modal .header .top-header-row h2 {
	margin: 0;
	font-size: 2em;
	color: #ED3624;
	font-weight: 700;
}

.history-modal .header .top-header-row {
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
}

.history-modal .header-row {
	display: flex;
	gap: 24px;
	font-size: 1em;
	color: #333;
}

.history-modal table {
	width: 100%;

	border-collapse: collapse;

	background: #f9f9f9;

	border-radius: 8px;

	overflow: hidden;

	box-shadow: 0 2px 8px #ed35241b;
}

.history-modal th,
.history-modal td {
	padding: 12px 8px;

	border-bottom: 1px solid #e0e0e0;

	text-align: left;

	font-size: 1em;
}

.history-modal th {
	background: #eaf0fa;

	color: #ED3624;

	font-weight: 600;
}

.history-modal tbody tr:hover {
	background: #eaf0fa;
}

.history-modal .close-btn {
	padding: 0;
	background-color: transparent;
	color: #ED3624;
	text-decoration: underline;
	border: none;
}
