/*
Purpose:
- Standardstil für die Webseite 'hoehendaten.de/karte.html'.

Releases:
- v1.0.0 - 2025-10-18: initial release

Copyright:
- © 2025 | Klaus Tockloth

License:
- MIT License

Description:
- NN
*/

/* --- Grundlegende Seitenstile --- */

html,
body {
	height: 100dvh;
	height: -webkit-fill-available;
	height: 100vh;
	flex-direction: column;
	margin: 0;
	padding: 0;
	color: #333;
	background-color: #f4f4f4;
	display: flex;
	font-size: 1rem;
	line-height: 1.3;
	font-family: sans-serif;
}

hr {
	border: 0;
	border-top: 3px solid #ccc;
	margin-top: 1.5em;
}

h2 {
	color: #555;
	margin-top: 0;
	margin-bottom: 0.5em;
}

h3,
h4 {
	color: #555;
	margin-top: 0.5em;
	margin-bottom: 0.5em;
}

p {
	margin: 0;
}

table {
	border-collapse: collapse;
	margin-top: 10px;
}

table,
th,
td {
	border: 1px solid #ddd;
}

th,
td {
	padding: 6px;
	text-align: left;
}

th {
	background-color: #f2f2f2;
}

ul,
ol {
	margin-left: 0;
	padding-left: 1em;
	list-style-position: outside;
}

ul ul,
ul ol,
ol ul,
ol ol {
	margin-left: 0;
	padding-left: 1em;
}

/* --- Leaflet-Kartenstile --- */

.map-container {
	flex: 1;
	display: flex;
}

#map {
	flex: 1;
	border: 0px solid gray;
	height: auto;
	z-index: 0
}

.leaflet-control-scale {
	z-index: 1000;
	position: absolute !important;
	bottom: 5px;
	left: 5px;
}

.leaflet-container .leaflet-control-attribution {
	background: rgba(255, 255, 255, 0.5);
	margin: 5px;
	padding: 1px;
	color: #333;
	bottom: 5px;
	right: 5px;
}

/* --- Navigationsmenü (Desktop) --- */

nav {
	background-color: #f9f9f9;
	position: relative;
	z-index: 1001;
}

nav ul {
	list-style: none;
	padding: 0;
	margin: 0;
	background: #f9f9f9;
	border-bottom: 1px solid #ccc;
	overflow: visible;
}

nav ul li {
	flex: 0 0 auto;
	display: inline-block;
	position: relative;
}

nav ul li .dropbtn,
nav ul li a {
	display: block;
	padding: 5px 10px;
	text-decoration: none;
	color: #333;
	cursor: pointer;
}

nav ul li .dropbtn:hover:not(.active) {
	background-color: #ddd;
}

.submenu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 1002;
	background-color: #f9f9f9;
	box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
	flex-direction: column;
	padding-left: 0;
	padding-top: 2px;
	padding-bottom: 2px;
	margin: 0;
}

li:hover>.submenu,
nav ul li.open>.submenu {
	display: flex;
}

.submenu button {
	background: none;
	border: none;
	width: 100%;
	padding: 5px 10px;
	text-align: left;
	font-size: 1em;
	color: black;
	cursor: pointer;
	transition: background-color 0.2s ease;
	border-bottom: 1px solid #ddd;
	white-space: nowrap;
	display: block;
	text-decoration: none;
}

.submenu li:last-child button {
	border-bottom: none;
}

.submenu button:hover,
.submenu button:focus {
	background-color: #f1f1f1;
	outline: none;
}

.submenu button+button {
	border-top: 1px solid #eee;
}

a.active,
.my-custom-class.active,
.nav-green-btn {
	background-color: rgb(192, 255, 132);
	color: #007acc;
	font-weight: bold;
}

ul.darstellung.submenu {
	display: block;
	flex-direction: column;
	width: 100%;
	padding: 0;
}

ul.darstellung.submenu li {
	display: block;
	width: 100%;
}

ul.aktionen.submenu li {
	display: block;
	width: 100%;
	box-sizing: border-box;
}

ul.aktionen.submenu li button {
	width: 100%;
	text-align: left;
	padding: 8px 15px;
}

/* --- Hamburger-Menü (Mobile) --- */

nav.mobile-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 5px 18px;
}

#hamburger-toggle {
	font-size: 1.4em;
	cursor: pointer;
	user-select: none;
	margin: 0px;
}

#hamburger-panel {
	position: fixed;
	top: 50px;
	left: 0;
	z-index: 1000;
	background: #fff;
	border-bottom: 1px solid #ccc;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#hamburger-content {
	max-height: 90vh;
	overflow-y: auto;
	overflow-x: hidden;
	display: flex;
	flex-direction: column;
	padding: 10px;
	gap: 5px;
}

.hamburger-menu-main-button {
	background: none;
	border: none;
	padding: 3px;
	font: inherit;
	color: inherit;
	cursor: pointer;
	text-align: left;
	width: 100%;
	font-weight: normal;
	font-size: 1rem;
}

.hamburgerSubmenu {
	flex-direction: column;
	gap: 8px;
	margin-top: 0px;
	margin-left: 1em;
}

.hamburgerSubmenuBtn {
	background: none;
	border: none;
	padding: 3px;
	font: inherit;
	color: inherit;
	cursor: pointer;
	text-align: left;
	width: 100%;
	font-size: 1rem;
}

.hamburgerSubmenuBtn+.hamburgerSubmenuBtn {
	border-top: 1px solid #ccc;
}

.hamburger-menu-main-button:hover,
.hamburgerSubmenuBtn:hover {
	background-color: #f0f0f0;
}

.nav-green-btn {
	background: none !important;
	color: #4CAF50 !important;
	font-weight: bold;
	border: none !important;
}

/* --- UI-Komponenten (Status, Info-Button, Spinner, Dialog) --- */

#status-info {
	color: #007acc;
	font-size: 14px;
}

#info-button {
	display: none;
}

#info-button.nav-green-btn {
	background: #4caf50;
	background-color: #007acc;
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 6px 12px;
	margin: 5px;
	cursor: pointer;
	font-size: 14px;
}

.loading-spinner {
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 10000;
	transform: translate(-50%, -50%);
	background: rgba(255, 255, 255, 0.95);
	padding: 20px 30px;
	border-radius: 10px;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
	display: flex;
	flex-direction: column;
	align-items: center;
	font-family: sans-serif;
}

.loading-spinner.hidden {
	display: none;
}

.loading-spinner .spinner {
	width: 40px;
	height: 40px;
	margin-bottom: 10px;
	border: 4px solid #ccc;
	border-top: 4px solid #333;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

.loading-spinner .loading-text {
	margin-top: 10px;
	font-size: 1em;
	color: #333;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.custom-dialog-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 9998;
}

.custom-dialog-box {
	position: fixed;
	top: 20%;
	left: 50%;
	transform: translateX(-50%);
	background: white;
	padding: 20px;
	width: 300px;
	border-radius: 8px;
	z-index: 9999;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.custom-dialog-close {
	position: absolute;
	top: 8px;
	right: 12px;
	background: none;
	border: none;
	font-size: 20px;
	cursor: pointer;
}

.custom-dialog-actions {
	margin-top: 20px;
	display: flex;
	justify-content: space-between;
}

.custom-dialog-actions button {
	padding: 8px 12px;
	cursor: pointer;
	border-radius: 4px;
	border: none;
}

.custom-dialog-confirm {
	background-color: #e74c3c;
	color: white;
}

.custom-dialog-cancel {
	background-color: #bdc3c7;
}

/* --- Seitenpanel --- */

.side-panel {
	height: 95%;
	width: 0;
	position: fixed;
	z-index: 1000;
	right: 0;
	background-color: #fefefe;
	overflow-x: hidden;
	overflow-y: hidden;
	transition: width 0.3s ease-out;
	box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	border: 1px solid #ccc;
}

.side-panel.open {
	width: 25%;
}

.side-panel-header {
	background-color: rgb(240, 240, 240);
	color: #333;
	padding: 5px 5px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-shrink: 0;
	font-size: 18px;
	font-weight: bold;
}

.side-panel-content {
	padding: 5px 5px;
	flex-grow: 1;
	overflow-y: auto;
	line-height: 1.1;
}

.sidepanel-options-padding {
	padding: 5px 5px;
}

.side-panel .side-panel-close {
	display: none;
}

.side-panel.open .side-panel-close {
	display: block;
}

.side-panel-close {
	background: none;
	border: none;
	font-size: 18px;
	cursor: pointer;
	padding: 2px 6px;
	color: #333;
}

.side-panel-close:hover {
	color: #c00;
}

@media (max-width: 992px) {
	.side-panel.open {
		width: 35%;
	}
}

@media (max-width: 600px) {
	.side-panel.open {
		width: 75%;
	}
}

/* --- Seitenpanel-Inhalte (Farbtabelle, Datenbereiche, Buttons) --- */

.color-table {
	max-width: 400px;
}

.color-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.color-row label {
	width: 40px;
	text-align: right;
	font-weight: bold;
	user-select: none;
}

.color-row input[type="color"] {
	width: 40px;
	height: 28px;
	padding: 0;
	border: none;
	cursor: pointer;
}

.color-row input[type="range"] {
	flex: 1;
	cursor: pointer;
}

.color-row span {
	width: 35px;
	text-align: center;
	font-variant-numeric: tabular-nums;
	user-select: none;
}

.server_data,
.client {
	color: #333;
	padding: 10px 12px;
	background: #fff;
	border-radius: 5px;
	margin-bottom: 16px;
}

.server_data label,
.client label {
	display: block;
	margin-top: 10px;
	margin-bottom: 6px;
	color: #444;
}

.client input[type="range"],
.server_data input[type="range"],
.server_data select,
.client select {
	width: 100%;
	cursor: pointer;
	margin-bottom: 3px;
	border-radius: 3px;
	border: 1px solid #ccc;
	box-sizing: border-box;
	padding: 0 6px;
	transition: border-color 0.3s ease;
}

.server_data input[type="range"]:focus,
.client input[type="range"]:focus,
.server_data select:focus,
.client select:focus {
	outline: none;
	border-color: #007acc;
	box-shadow: 0 0 5px #007acc66;
}

.panel-buttons {
	display: flex;
	justify-content: space-between;
	padding: 0 12px 10px;
	flex-wrap: wrap;
}

.panel-buttons button {
	background-color: #007acc;
	color: white;
	border: none;
	padding: 8px 12px;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
	transition: background-color 0.25s ease;
	margin: 4px;
	user-select: none;
	flex: 1 1 48%;
}

.panel-buttons button:hover {
	background-color: #005f99;
}

/* --- Eintragsliste (Details/Summary) --- */

.entry-list details {
    padding-inline-start: 0;
	padding-top: 2px;
    padding-bottom: 2px;
    padding-right: 2px;
	margin-top: 2px;
	margin-bottom: 2px;
	transition: all 0.3s ease;
	/* font-size: 0.8em; */
}

.entry-list details[open] {
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.entry-list summary {
	cursor: pointer;
	list-style: none;
	outline: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 4px;
	font-size: 0.9rem;

}

.entry-list summary:hover {
	background-color: #f3f3f3;
	border-radius: 4px;
}

.entry-list summary::marker,
.entry-list summary::-webkit-details-marker {
	display: none;
}

.entry-list summary::before {
      content: '▷';
}

.entry-list details[open] summary::before {
      content: '▽';
}

.entry-list button:not(.customdata-apply-config-btn) {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 12px;
	padding: 0 4px;
	transition: color 0.2s ease;
}

.entry-list button:hover:not(.customdata-apply-config-btn) {
	color: #0077cc;
}

/* --- Hervorhebungs- und Farb-Stile --- */

.highlighted-tile summary {
	background-color: rgba(255, 0, 0, 0.2);
	border-radius: 6px;
	padding: 2px 4px;
}

.color-even {
	background-color: rgb(240, 240, 240);
}

.color-odd {
	background-color: rgb(240, 240, 240);
}

.highlighted-tile {
	border: 2px solid #007bff;
	box-shadow: 0 0 8px rgba(0, 123, 255, 0.5);
}

.highlighted-tile.color-even {
	background-color: #e0f2ff;
}

.highlighted-tile.color-odd {
	background-color: #cceeff;
}

/* --- Anpassung für den Farbwahl-Button in der Farbtabelle --- */

.color-row .color-cell:nth-child(2),
.color-row .color-cell:first-child:last-child {
    flex-grow: 1; 
}

.color-row .cp_wide {
    width: 100%;
}

.color-row .cp_input {
    width: 100%;
}
