body {
	margin: 0;
}

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    transition: background-color 9999s ease-in-out 0s;
    -webkit-text-fill-color: #111 !important;
}

body.dark input:-webkit-autofill,
body.dark input:-webkit-autofill:hover, 
body.dark input:-webkit-autofill:focus, 
body.dark input:-webkit-autofill:active {
    transition: background-color 9999s ease-in-out 0s;
    -webkit-text-fill-color: #ddd !important;
}

/* ── Country name in main table ── */
.country {
	cursor: pointer;
	font-weight: bold;
	font-size: 94%;
	text-decoration: underline;
}
.country:hover {
	display: inline-block;
	transform: scale(1, 1.2);
}

/* ── Observatory name in detail table ── */
.obs-name {
	cursor: pointer;
	font-weight: bold;
	font-size: 94%;
	text-decoration: underline;
}
.obs-name:hover {
	display: inline-block;
	transform: scale(1, 1.2);
}
.flagField {
	font-weight: bold;
	font-size: 19px;
	max-width: 70px !important;
    min-width: 70px !important;
	text-align: center !important;
}
.flagField img {
	margin-bottom: -3px;
	float: right;
}

#backToWorldList:hover {
	text-decoration: underline;
}
#country_detail_navigation {
	display: flex;
    align-items: center;
	margin: 2px 15px 0px 0px;
}
#country_group_container {
	height: 40px;
	margin-right:15px;
}
.country_group {
	font-weight: bold;
	font-family: Arial;
	display:inline-block;
	margin-top:11px;
}

/* ── Header ── */
#header {
	height: 100px;
	width: 100%;
	position: absolute;
	top: 0;
	left: 0;
	z-index: 10;
	border-bottom: 1px solid #d1d1d1;
	background-image: url('/img/header_small_2.jpg');
	color: #FFFFFF;
}

#header div:nth-child(2) {
	font: bold normal 16px arial;
	margin: 40px 6px 0px 0px;
	display: block;
	float: right;
	cursor: pointer;
}
#darkLightTheme {
    position: absolute;
    right: 9px;
    top: 1px;
    cursor: pointer;
    font-size: x-large;
    color: #e5e5e5;
	filter: grayscale(1) drop-shadow(0 2px 3px rgba(0, 0, 0, 1.0));
	user-select: none;
}


/* Help jump animation */
@keyframes helpJump {
	0% { transform: translateY(0); }
 15% { transform: translateY(-12px); }
 30% { transform: translateY(0); }
 45% { transform: translateY(-6px); }
 60% { transform: translateY(0); }
 100% { transform: translateY(0); }
}
.menuItems {
	display: block;
	float: right;
	margin: 40px 6px 0px 0px;
	font: bold normal 16px arial;
	cursor: pointer;
	z-index: 11;
	filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 1.0));
	user-select: none;
}
#help {
	animation: helpJump 2s ease-in-out infinite;
}

/* ── Filter bar (replaces country group radio buttons) ── */
#filter_container {
    height: 39px;
    /*width: 100%;*/
    position: absolute;
    top: 100px;
    /*left: 0;*/
    background-color: #FFFFFF;
    display: flex;
    padding-left: 11px;
    box-sizing: border-box;
    font-family: Arial;
    font-weight: bold;
    justify-content: flex-start;
    align-items: center;
}

#filter_container label {
	cursor: pointer;
}
#filter_container input[type=checkbox] {
	cursor: pointer;
	margin-right: 6px;
}

/* ── Main country table ── */
#country_table_container {
	position: absolute;
    overflow-y: auto;
    z-index: 1;
	scrollbar-width: thin;
}
#country_table_container caption {
	display: none;
}
.sortable thead th {
    text-transform: none !important;
}

/* ── Detail panel ── */
#country_table_container_detail {
	display: none;
	height: calc(100% - 168px);
    position: absolute;
    top: 140px;
	overflow-y: auto;
	z-index: 2;
	background-color: white;
	scrollbar-width: thin;	
}
#country_table_container_detail_content {
	font-family: Arial;
	display: flex;
	flex-direction: column;
    align-items: center;	
}

/* ── Footer ── */
#footer {
	position: absolute;
    bottom: 0;
    z-index: 10;
    font-family: Arial;
    width: 100%;
    border-top: 1px solid #c6c6c6;
    display: flex;
    justify-content: center;
    padding: 5px 0px 5px 0px;
}
#footer a {
	color: inherit;
}

/* ── Table chrome ── */
thead {
	position: sticky;
	top: 0px;
	background: #ebf9ff;
	z-index: 2;
}
table td {
	margin: 0;
	padding: .5em .7em;
	border-bottom: 1px solid #c6c6c6;
	text-overflow: ellipsis;
}
.tableHeaderCell {
	color: #333333;
}
.sortable thead th {
	margin-right: 0px !important;
	text-align: right;
	cursor: pointer;
}
.sortable thead th:not(.no-sort)::after {
	margin-left: 0px !important;
}
.sortable th {
	padding: 5px 10px 5px 10px ;
}

tbody tr:nth-child(odd) {
	background-color: #f7fdff;
}
tbody tr:nth-child(even) {
	background-color: #fff;
}

.filterItem {
	padding: 10px 20px 10px 20px;
}

/* ── Dark mode ── */
body.dark #filter_container {
	background-color: rgb(51, 51, 51);
	color: #d1d1d1;
}
body.dark #country_table_container_detail {
	background-color: #333;
	color: #d1d1d1;
}
body.dark tbody tr:nth-child(odd) {
	background-color: rgb(73, 73, 73);
}
body.dark tbody tr:nth-child(even) {
	background-color: rgb(49, 49, 49);
}
body.dark thead {
	background: #ebf9ff;
	filter: invert(0.8) saturate(0);
}
body.dark #country_table_container {
	scrollbar-color: #575656 #252525;   
}
body.dark #country_table_container_detail {
	scrollbar-color: #575656 #252525;   
}
body.dark #header {
	border-bottom: 1px solid #6b6b6b;
}
body.dark #footer {
	border-top: 1px solid #6b6b6b;
}
body.dark #map_picker_modal .map-footer {
	background-color: unset;
}

body.dark .noUi-tooltip {
	background: #3a3a3a !important;
    border: 1px solid #555 !important;
    color: #ddd !important;
}
body.dark .noUi-handle {
    box-shadow: inset 0 0 1px #5b5b5b, inset 0 1px 7px #333333, 0 3px 6px -3px #020202 !important;
    background: #3a3a3a !important;
    border: 1px solid #555 !important;
    color: #ddd !important;
}
body.dark .noUi-active .noUi-handle {
    box-shadow: inset 0 0 1px #5b5b5b, inset 0 1px 7px #333333, 0 3px 6px -3px #020202 !important;
    background: #3a3a3a !important;
    border: 1px solid #555 !important;
    color: #ddd !important;
}
body.dark  .noUi-connects {
	background-color: #515151;
}

body.dark #filter_type {
    background: #3a3a3a;
    border: 1px solid #555;
    color: #ddd;
	margin-left:10px;
}

#filter_type {
    margin-left:10px;
}

body.dark #filter_MPC_only {
	accent-color: #b5b5b5 !important;
	opacity: 0.6 !important;
}

/* ── Add/Modify form modal ── */
body.dark #addobs_modal textarea, body.dark #addobs_modal input, body.dark #addobs_modal select {
	scrollbar-width: thin;
	scrollbar-color: #575656 #252525; 
}

.map-footer button {
	padding: 5px 12px;
    border-radius: 4px;
    border: none;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}
#map_picker_modal .map-footer {
	background-color: #f0f0f0;
}
#map_picker_cancel {
    background: #6c757d;
}
#map_picker_confirm {
    background: #1976d2;
}

/* Filters modal (match Help/About modal style) */
#filter_modal {
	font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
}

#filter_modal>div {
	background: #fff;
	color: #111;
	padding: 18px;
	border-radius: 8px;
	width: 640px;
	max-width: 95%;
	box-sizing: border-box;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

#filter_modal .modal-title {
	font-size: 18px;
	font-weight: 700;
	margin-bottom: 10px;
}

#filter_modal p {
	font-size: 14px;
	margin: 6px 0;
}

#filter_modal ul {
	margin: 6px 0 -11px 18px;
}

body.dark #filter_modal>div {
	background: #2b2b2b;
	color: #ddd;
}

body.dark #filter_modal a {
	color: #81b3ff;
}

#filter_modal .controls {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	margin-top: 8px;
}

#filter_modal button {
	padding: 8px 12px;
	border-radius: 4px;
	border: none;
	background: #1976d2;
	color: #fff;
	cursor: pointer;
	font-weight: 600;
}

#filter_modal button#filter_close,
#filter_modal button#close_filters_btn {
	background: #6c757d;
}

#filter_modal button#filter_close,
#filter_modal button#reset_filters_btn {
	background: #6c757d;
}


.noUi-connect {
    background: #499cd7 !important;
}

.noUi-target {
    border: 1px solid #74a2c3 !important;
}

input:-internal-autofill-selected {
    background-color: unset !important
}
.filter_preset {
	font-size: 85%;
	cursor: pointer;
	user-select: none;
}
.filter_preset:hover {
	text-decoration: underline;
}

/* Obs count help icon and popup */
.help_icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 19px;
    text-align: center;
    border-radius: 50%;
    background: #1976d2;
    color: #fff;
    font-weight: bold;
    margin-left: 6px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 13px;
    user-select: none;
}

.help_popup {
	position: absolute;
	z-index: 20000;
	display: none;
	max-width: 360px;
	box-sizing: border-box;
	padding: 12px;
	border-radius: 8px;
	background: #fff;
	color: #111;
	box-shadow: 0 8px 30px rgba(0,0,0,0.35);
	font-family: Arial, Helvetica, sans-serif;
	font-size: 13px;
}

body.dark .help_popup {
	background: #2b2b2b;
	color: #ddd;
	box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}

.help_popup .title {
	font-weight: 700;
	margin-bottom: 8px;
}

.help_popup ul { margin: 6px 0 0 16px; }
