
body {
	margin: 0;
	font-family: Arial, Helvetica, sans-serif;
}
h2 {
	 font-family: Arial, Helvetica, sans-serif;
}
h5 {
	margin: 25px 0px 6px 0px;
	font-size: 15px;
}

/* Remove the default ugly ring for mouse users */
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
    outline: none;
}

/* Style a beautiful, custom focus state for keyboard users */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3b83f600; /* A nice modern blue */
    outline-offset: 2px;
}

a {
	color: #333;
    text-decoration: none;
}
a:hover {
	text-decoration: underline;
}

body.dark a {
	color: #D1D1D1;
}

body.dark input:-internal-autofill-selected {
    background: #3a3a3a;
    border: 1px solid #555;
    color: #ddd;
}

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: calc(100% - 20px);
    border-top: 1px solid #c6c6c6;
    display: flex;
    justify-content: center;
    padding: 5px 10px 5px 10px;
    cursor: default;
}
#footer a {
	color: inherit;
}

/* ── Table chrome ── */
thead {
	position: sticky;
	top: -1px;
	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);
	color:#020202
}
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;
}

body.dark #search_modal > div {
    background: #2b2b2b;
    color: #ddd;
}
#search_results > table > tbody > tr > td:nth-child(1) {
	font-weight: bold;
    font-size: 94%;
    text-decoration: underline;
}
#search_results > table > tbody > tr > td:nth-child(1):hover {
	transform: scale(1, 1.2);
}
#search_results {
	scrollbar-width: thin;
}
body.dark #search_results {
	scrollbar-color: #575656 #252525; 
}

#top100_buttons {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	padding-top: 12px;
	height: 100%;
	box-sizing: border-box;
}

/* controls area fixed height; results fill remaining space */
#top100_controls {
	flex: 0 0 120px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0px 10px 0px 10px;
}

#top100_controls .btnrow {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

#top100_results {
	flex: 1 1 auto;
	overflow: auto;
	scrollbar-width: thin;
}

.top100-table thead th {
	position: sticky;
	top: 0;
	background: #fff;
	z-index: 3;
}

body.dark .top100-table thead th {
	background: #2b2b2b;
	color: #ddd;
}

.top100-table thead th,
.top100-table tbody td {
	padding: 8px;
	border-bottom: 1px solid #eee;
}

.top100-table {
	width: 100%;
	border-collapse: collapse;
}
#search_buttons {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	padding-top: 12px;
	height: 100%;
	box-sizing: border-box;
}

#search_controls {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px;
	min-width: 550px;
}

#search_results {
	flex: 1 1 auto;
	overflow: auto;
	scrollbar-width: thin;
	width: 100%;
	box-sizing: border-box;
}
.top100-table thead th{
	position:sticky;
	top:0;
	background:#fff;
	z-index:3;
}

#top100_results .obs-name-cell, #top100_results .obs-country-cell{
	font-weight: bold;
	font-size: 94%;
	text-decoration: underline;
}
#top100_results > table > tbody > tr > td:nth-child(1) {
	padding: 4px 8px 4px 8px !important;
    font-size: 19px;
    font-weight: bold;
}


#top100_results .obs-name-cell:hover, #top100_results .obs-country-cell:hover {
	transform: scale(1, 1.2);
}

#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 {
	background: #3a3a3a;
	border: 1px solid #555;
	color: #ddd;
	scrollbar-width: thin;
	scrollbar-color: #575656 #252525; 
}

body.dark #addobs_modal > div {
	scrollbar-color: #575656 #252525; 
}

body.dark #addobs_modal button#addobs_close {
    background: #6c757d;
}

.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;
}
.modal-content {
	overflow-y: auto;
	max-height: 75vh;
	scrollbar-width: thin;
}
body.dark .modal-content {
	scrollbar-color: #575656 #252525; 
}

#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;
}


.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; }

/* Pending entries modal overlay */
#pending_overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.45);
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
}
#pending_overlay button {
	padding: 8px 12px;
	border-radius: 4px;
	border: none;
	cursor: pointer;
	font-weight: 600;
}
#pending_modal {
	background: #fff;
	color: #111;
	border-radius: 8px;
	width: 92%;
	max-width: 1100px;
	max-height: calc(100% - 80px);
	overflow-y: auto;
	box-shadow: 0 12px 40px rgba(0,0,0,0.5);
	position: relative;
	padding: 18px;
	box-sizing: border-box;
}

#pending_container, #pending_detail_container {
	display: block;
	box-sizing: border-box;
	padding: 8px 0;
}

#pending_list table {
	width: 100%;
	border-collapse: collapse;
	font-family: Arial, Helvetica, sans-serif;
}
#pending_list th, #pending_list td {
	text-align: left;
	padding: 8px;
	border-bottom: 1px solid #e6e6e6;
}
.pending_row:hover { background: #f4fbff; }

#pending_detail { font-family: Arial, Helvetica, sans-serif; }
#pending_detail table { width: 100%; border-collapse: collapse; }
#pending_detail td { padding: 8px; border-bottom: 1px solid #eee; vertical-align: top; }

#pending_modal .modal-close {
	position: absolute;
    right: 10px;
    top: 0px;
    border: none;
    font-size: 35px;
    cursor: pointer;
}

#pending_close { 
	color: #a9a9a9;
}

body.dark #pending_modal { background: #2b2b2b; color: #ddd; }
body.dark .pending_row:hover { background: rgba(255,255,255,0.03); }

/* Inline diff highlights */
.highlight {
	background:#97c5ff !important;
}

body.dark .highlight {
	background:#793a3a !important;
}

.diff-added {
	background: #79ff68;
	padding: 0 2px;
	border-radius: 2px;
}
body.dark .diff-added {
	background: #12a700;
}
.diff-removed {
	background: #ff4a5c;
	padding: 0 2px;
	border-radius: 2px;
	text-decoration: line-through;
}
body.dark .diff-removed {
	background: #a70011;
}


body.dark #top100_results {
	scrollbar-color: #575656 #252525; 
}

/* Mobile sliding menu panel */
#mobileMenuPanel {
	position: fixed;
	right: -320px;
	top: 0;
	height: 100%;
	width: 300px;
	z-index: 20000;
	background: #fff;
	box-shadow: -6px 0 18px rgba(0, 0, 0, 0.25);
	transition: right 0.25s ease-in-out;
	overflow: auto;
}

#mobileMenuPanel.dark {
	background: #222;
	color: #ddd;
}

#mobileMenuPanel .menuEntry {
	padding: 12px 16px;
	border-bottom: 1px solid #eee;
	cursor: pointer;
	font-weight: 600;
}

#mobileMenuPanel .menuEntry.dark {
	border-bottom-color: rgba(255, 255, 255, 0.06);
}

#mobileMenuClose {
	text-align: right;
	padding: 8px 12px;
	cursor: pointer;
	font-size: 18px;
}

#mainMenuBtn {
	display: none;
	cursor: pointer;
	padding: 8px 12px;
	border-radius: 4px;
	background: transparent;
	font-weight: 600;
}

body.dark #mobileMenuPanel {
	background: #222;
	color: #ddd;
}

body.dark #search_input {
	background: #3a3a3a;
    border: 1px solid #555 !important;
    color: #ddd;	
}