/* Allgemeine Stile */
html, body {
        height: 100%;
        margin: 0;
}

.container {
        display: flex;
        height: 100%;
}

#controls {
        width: 220px;
        padding: 5px;
        box-sizing: border-box;
        background: #cccccc;
        overflow-y: auto;
        border-right: 1px solid #ccc;
        font-family: Arial, sans-serif;
        font-size: 0.9em;
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: space-between; /* Wichtig für Platzverteilung */
}
#footerInfo {
        margin-top: auto;
        padding: 10px;
        font-size: 1.0em;
        color: #777;
        text-align: left;
}
#footerContainer {
        position: relative;
        margin-top: auto;
        padding: 10px 0;
}

#map {
        flex-grow: 1;
        height: 100%;
}

/* Bandgruppen */
.bandGroup {
        margin-bottom: 20px;
        border-bottom: 1px solid #ccc;
}
.bandHeader {
        font-weight: bold;
        cursor: pointer;
        margin-bottom: 5px;
        user-select: none;
}
.bandHeader::after {
        content: " \25BC"; /* ▼ */
        font-size: 0.8em;
        float: right;
        transition: transform 0.3s ease;
}
.bandHeader.collapsed::after {
        content: " \25B6"; /* ▶ */
}
table.bandsTable {
        border-collapse: collapse;
        width: 100%;
}
table.bandsTable th, table.bandsTable td {
        padding: 4px 4px;
        vertical-align: middle;
        text-align: left;
        border-bottom: 1px solid #ddd;
}
table.bandsTable th {
        background-color: #A8A8A8; 
}
table.bandsTable th:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}
table.bandsTable th:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Labels und Eingabeelemente */
label {
        display: flex;
        align-items: center;
        gap: 4px;
        user-select: none;
        cursor: pointer;
}
label img {
        width: 20px;
        height: 20px;
}
label:hover {
        color: #007BFF; /* Blau bei Hover */
}
input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
}
select.dropdown {
        width: 90%;
        font-size: 0.85em;
        cursor: pointer;
}
input.colorPicker {
        width: 80%;
        height: 15px;
        border: none;
        padding: 0;
        cursor: pointer;
        background: none;
}
input[type="color"]:focus {
        outline: 2px solid #006699;
}

/* Locator-Label */
.locator-label {
        font-size: 8px;
        font-family: Arial, sans-serif;
        background-color: rgba(255, 255, 255, 0.7);
        padding: 2px;
        border-radius: 4px;
        text-align: center;
        color: rgba(255, 0, 0, 0.6);
}

/* Modales Fenster */
.modal {
        display: none; /* Standardmäßig versteckt */
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 80%;
        max-width: 650px; /* Maximalbreite für große Bildschirme */
        max-height: 90vh; /* Begrenze Höhe auf 90% der Viewport-Höhe */
        overflow: hidden; /* Kein Scrollen im ganzen Modal, nur im Inhalt */
        background: white;
        border: 1px solid #ccc;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        padding: 20px;
        z-index: 1000;
        border-radius: 8px;
        overflow: hidden;
        transition: width 0.3s ease, transform 0.2s ease;
}
.modal-header {
        text-align: center;
        font-size: 1.5rem;
        margin-bottom: 20px;
}
.modal-content {
        margin-bottom: 20px;
        max-height: 60vh; /* Höhe für den scrollbaren Bereich */
        overflow-y: auto; /* Vertikales Scrollen erlauben */
}
.modal-footer {
        display: flex;
        justify-content: flex-end;
        margin-top: 10px;
}

/* Modal Overlay */
.modal-overlay {
        display: none; /* Standardmäßig versteckt */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5); /* Halbtransparenter Hintergrund */
        z-index: 999;
}
.close {
        position: absolute;
        right: 20px;
        top: 10px;
        font-size: 24px;
        cursor: pointer;
}

/*Statistik Modal*/
#analysisOutput {
    max-height: 70vh;
    overflow-y: auto;
    /* Verhindert Flackern bei Inhaltswechsel */
    min-height: 100px; 
    transition: min-height 0.2s ease-out;
}

/* Datei-Upload */
.file-upload {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.file-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.myGrid-container {
  display: grid;
  grid-template-columns: max-content auto 1fr;
  grid-column-gap: 12px;
  align-items: center;
  margin-bottom: 0.5em;
}
.info-box {
    border: 1px solid orange;
    background-color: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    border-radius: 5px;
    margin-top: 10px;
    display: flex;
    align-items: start;
    gap: 10px;
    font-size: 0.95em;
}
.info-box::before {
    content: "⚠️";
    font-size: 1.2em;
    line-height: 1.4em;
}
.error-box {
    border: 1px solid red;
    background-color: #f8d7da;
    color: #721c24;
}
.error-box::before {
    content: "❌";
    font-size: 1.2em;
    line-height: 1.4em;
}


/* Label Haupt: max-content (Breite so groß wie nötig), Zeilenumbruch per word-break */
.myGrid_label_main {
  font-weight: bold;
  white-space: normal;
  word-break: break-word;
  max-width: 130px; /* optional, max Breite */
}

/* Input: ca. 10 Zeichen breit */
#myGrid {
  width: 10ch;
  padding: 5px;
  border: 1px solid #7d7d7d;
  border-radius: 4px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
/* Fokus blau */
#myGrid:focus {
  border-color: #007BFF;
  outline: none;
  box-shadow: 0 0 3px #007BFF;
}
/* Info-Label nimmt den restlichen Platz */
.myGrid_label_info {
  font-size: 0.85em;
  color: #555;
  white-space: normal;
  word-break: break-word;
}


.hidden-file-input {
        opacity: 0;
        position: absolute;
        z-index: -1;
}
.file-name {
        font-size: 0.9rem;
        color: #555;
}

/* Marker-Liste */
.marker-container {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
}

.icon-picker-img {
        width: 40px;
        height: 40px;
        cursor: pointer;
        border: 2px solid transparent;
        transition: border 0.3s ease;
}
.icon-picker-img:hover {
        border: 2px solid #006699;
}

/* Buttons */
button {
        padding: 10px 10px;
        font-size: 1em;
        border-radius: 6px;
        cursor: pointer;
        transition: background-color 0.3s ease, transform 0.2s ease;
        border: none;
        width: auto;          /* <<< WICHTIG: nicht volle Breite */
        max-width: 100%;      /* falls der Text lang wird */
        display: inline-block; /* verhindert Stretching bei flex */
        align-self: flex-start;
        margin-left: 5px;
}
button.primary {
        background-color: #006699;
        color: white;
}
button.primary:hover {
        background-color: #0056b3;
        transform: scale(1.05);
}
button.primary:active {
        background-color: #003f7f;
        transform: scale(0.95);
}
button.secondary {
        background-color: #f8f9fa;
        color: #333;
        border: 1px solid #ccc;
}
button.secondary:hover {
        background-color: #e2e6ea;
        transform: scale(1.05);
}
button.secondary:active {
        background-color: #d6d8db;
        transform: scale(0.95);
}

/* Versteckte Elemente */
.hidden {
        display: none;
}
#lineToggleHeader {
        display: none;
}

h3 {
    font-size: 1em;
}
                        
 

                        
/* Maker PopUp*/   
:where(.leaflet-popup-content) table td.w10a {
    font-size: 8pt !important;
    font-family: Arial !important;
    padding: 2px !important;
    line-height: 10px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;

}
:where(.leaflet-popup-content) table td.w10h {
    font-size: 8pt !important;
    font-family: Arial !important;
    padding: 2px !important;
    background-color: #d0d0d0 !important;
    line-height: 12px !important;
}
.leaflet-popup-content-wrapper,
.leaflet-popup-content {
  width: auto !important;
  max-width: none !important;
}
.nowrap-text {
    white-space: nowrap;
    display: inline-block;
}

/*Buttons oben auf der Karte*/
.GMAButtonNew {
	background-color: #006699 !important;
	color: white !important;
	padding: 6px 14px;
	border: none;
	border-radius: 6px;
	margin: 6px 4px;
	font-size: 1em;
	cursor: pointer;
	transition: background-color 0.2s ease;

	z-index: 999;
}
.GMAButtonNew:hover {
    transform: scale(1.03);
    filter: brightness(1.1);
}
.GMAButtonNew:active {
    transform: scale(0.96);
    filter: brightness(0.95);
}
input[type="checkbox"].GMAButtonNew {
    transform: scale(0.8);
    vertical-align: middle;
    margin-right: 0.3em;
}


#style-switcher {
  position: absolute;
  top: 10px;
  right: 10px;
  background: white;
  padding: 6px;
  border-radius: 6px;
  z-index: 999;

  display: flex;         /* Hiermit werden die Buttons nebeneinander */
  gap: 6px;              /* Abstand zwischen den Buttons */
  align-items: center;   /* Optional: vertikale Ausrichtung */
}

#meinePos_Box {
        font-size: 16px;
        padding-top: 5px;
        padding-bottom: 20px;
}

#meinePos {
    width: 100px;
    /* height: 10px;  <-- Diese Zeile UNBEDINGT entfernen oder durch auto ersetzen */
    height: auto; 
    padding: 8px 10px; /* Oben/Unten etwas weniger, falls es zu hoch wird */
    font-size: 16px;
    line-height: 1.2; /* Hilft html2canvas bei der vertikalen Zentrierung */
    border: 2px solid #ccc;
    border-radius: 5px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    color: #333;
    background-color: #f9f9f9;
    font-family: Arial, sans-serif;
    margin-left: 5px;
    vertical-align: middle; /* Richtet das Feld besser zum Label aus */
}

#meinePos:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 8px #007bff;}

/*Spinner beim Hochladen*/
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-top: 2px solid #333;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* Sprache */
#languageSwitcher,
#unitSwitcher {
    font-family: Arial, sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    flex-wrap: nowrap;
    box-sizing: border-box;
}

#languageSelect,
#unitSelect {
    appearance: none;         /* entfernt systemabhängige Höhenunterschiede */
    -webkit-appearance: none;
    -moz-appearance: none;
    
    font-family: Arial, sans-serif;
    font-size: 14px;

    height: 32px;             /* identische Höhe */
    line-height: 32px;        /* vertikal ausgerichtet */
    padding: 0 8px;           /* gleichmäßiger Innenabstand */
    
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    box-sizing: border-box;
}



/*Trennlinie*/
.divider {
    border: none; 	/* Entfernt die Standardlinie */
    border-top: 1px solid #333; /* Erstellt eine horizontale Linie */
    margin-top: 7px; /* Abstand oben und unten */
    margin-bottom: 5px; /* Abstand oben und unten */
    width: 100%; 	/* Füllt die Breite des Containers aus */
}

/* Anker-Marker für Call-Labels unsichtbar machen (keine 12x12-Box etc.) */
.call-label-anchor{
  background: none !important;
  border: none !important;
}

/* Tooltip-Style für das Call-Label (permanent) */
.leaflet-tooltip.pin-call-label{
  background: rgba(255,255,255,0.90);
  border: 1px solid #666;
  border-radius: 4px;
  color: #000;
  padding: 1px 4px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

/* optional: kleiner "Pfeil" weg (falls du ihn nicht willst) */
.leaflet-tooltip.pin-call-label:before{
  display: none;
}

/* Container-Icon selbst unsichtbar */
.pin-call-label{
  background: transparent !important;
  border: none !important;
}

/* Das eigentliche Label */
.pin-call-label-text{
  display: inline-block;
  white-space: nowrap;

  background: rgba(255,255,255,0.95);
  border: 1px solid #666;
  border-radius: 4px;
  padding: 1px 4px;

  color: #000;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;

  box-shadow: 0 1px 2px rgba(0,0,0,0.25);

  /* Position: rechts + höher (oberes Drittel) */
  transform: translate(12px, -26px);

  pointer-events: none;
  
    position: relative;
}

.call-pin {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(255,255,255,0.95);
  border: 1px solid #444;
  border-radius: 4px;
  font: 700 12px/14px Arial, sans-serif;
  color: #000;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.call-pin--menu {
  font-size: 11px;
  padding: 2px 6px;
	display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
}



.setup-box{
  border: 1px solid #ccc;
  background: #fff;
  padding: 10px;
  border-radius: 6px;
  margin-top: 10px;
}

/* Setup Modal: 2 Spalten, links jetzt, rechts später */
#setupModal .setup-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;  /* 50/50 */
  gap: 14px;
  align-items: start;
}

/* Linke Spalte soll linksbündig bleiben */
#setupModal .setup-left{
  justify-self: start;
}

/* Auf kleinen Screens untereinander */
@media (max-width: 700px){
  #setupModal .setup-grid{
    grid-template-columns: 1fr;
  }
}
/* Setup-Modal: gleiche Optik wie Rest */
#setupModal .setup-box{
  background: #cccccc;   /* exakt wie Sidebar */
  border: 1px solid #999;
  border-radius: 8px;    /* wie Tabellenheader-Radius */
  padding: 10px;
}

#setupModal .setup-box button.primary,
#setupModal .setup-box button.secondary{
  border-radius: 6px;
  background-color: #006699;
  color: white;
  padding: 5px;
}

/* Deaktivierte Elemente im CallsInsteadPins-Modus */
#setupModal input:disabled,
#setupModal select:disabled{
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------- Custom Zoom Slider ---------- */

/* Erhöhte Spezifität durch #map */
#map .leaflet-control-zoom-in, 
#map .leaflet-control-zoom-out {
    width: 20px !important;
    height: 20px !important;
    line-height: 20px !important;
    font-size: 12px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Den äußeren Rahmen des Sliders anpassen */
#map .leaflet-bar {
    border: 2px solid rgba(0,0,0,0.2) !important;
}

#map .leaflet-bar a {
    width: 20px !important;
    height: 20px !important;
}


#map .leaflet-control {
    margin-top: 10px;
    margin-left: 5px;
}




.udx-zoomslider{
  background:#fff;
  border-radius:6px;
  overflow:hidden;
  box-shadow:0 1px 3px rgba(0,0,0,0.25);
}

.udx-zoom-top{
  display:flex;
}

.udx-zoom-top .udx-zoom-btn{
  font-size: 14px !important;
  width:22px;!important;
  height:22px;!important;
  line-height:22px;!important;
  text-align:center;
  color:#006699;
  text-decoration:none;
  font-weight:700;
  user-select:none;
  border-right:1px solid rgba(0,0,0,0.15);
  //font-size: 1.5rem;
}

.udx-zoom-top .udx-zoom-btn:last-child{
  border-right:none;
}

.udx-zoom-top .udx-zoom-btn:hover{
  background:#e2e6ea;
}

.udx-zoom-wrap{
  padding:4px 8px;
  width:140px;
}

.udx-zoom-range{
  width:100%;
  height:10px;
}

.udx-zoom-label{
  //font-size:11px;
  padding:2px 6px 6px 6px;
  color:#333;
  text-align:center;
  font-size: 0.9rem;
  padding-left: 10px;
}



#statsModal {
    display: none; /* Standardmäßig aus */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    z-index: 1001;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    
    /* HIER DIE BREITE ANPASSEN */
    width: 90%;            /* Mobil: Fast volle Breite */
    max-width: 800px;      /* Desktop: Maximal 800px */
	
	touch-action: none; 
}

/* Optional: Damit das Modal auf sehr kleinen Screens nicht kaputt geht */
@media (max-width: 768px) {
    #statsModal {
        width: 95%;
        max-height: 95vh;
    }
}

#statsModal.modal {
resize: both; /* Griff unten rechts /
overflow: auto; / Inhalt darf scrollen /
max-width: none; / Begrenzung aufheben /
max-height: none;
min-width: 480px; / sinnvolle Mindestgröße */
min-height: 360px;

/* deine Breite/Resize bleiben bestehen */
}

#statsModal.modal.is-open {
display: flex; / nur wenn geöffnet /
flex-direction: column;
/* weitere Layout-Overrides hier, aber kein display in anderen Regeln */
}

#statsScaleWrap {
width: 700px; /* Basisbreite (dein “Foto”) /
height: 500px; / Basishöhe /
transform-origin: top left;
}
#statsModal .modal-content {
overflow: hidden; / keine Scrollbalken während Skalierung /
padding: 8px 12px; / ggf. kompaktere Ränder */
}

#statsModal .modal-header{
  position: relative;
  text-align: center;     /* hast du schon, kann so bleiben [2] */
  padding-right: 0px;   /* Platz, damit der Button nicht über den Titel liegt */
  cursor: default;
  margin-bottom: 0 !important;
}

#statsModal .modal-header h3{
  margin: 0;
}

#statsModal .drag-handle{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: move;
  user-select: none;

  font-size: 0.8em;
  color: #006699;
  background: #eef6ff;
  border: 1px dashed #006699;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

#statsModal .drag-handle:hover{
  background: #e0f0ff;
}


#statsModal.modal {
    position: fixed; /* wie üblich bei Modals */
}

#statsModal .modal-footer {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 0; /* Abstand wird über right/bottom definiert */
    display: flex;
    justify-content: flex-end; /* “Schließen” rechts /
    padding: 8px 12px; / konstanter Abstand zum Rand */
}

#statsModal .modal-content {
    display: flex;
    flex-direction: column;
    align-items: center; /* Zentriert den skalierten Inhalt */
    justify-content: flex-start;
    overflow: auto; /* Erlaubt Scrollen, falls scale < 1 sein muss */
}

#statsModal #analysisOutput {
max-height: none; /* überschreibt die 70vh-Regel */
height: 100%;
overflow: hidden;
}

/* Der Hauptcontainer nutzt Flexbox */

.stats-main-container {
    display: inline-flex; /* Wichtig: Passt sich der Breite der Spalten an */
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
    box-sizing: border-box;
}

.stats-column-left, .stats-column-right {
    flex: 0 1 340px; /* Schrumpfen erlaubt, aber Basis 340px */
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Linke Spalte: Nimmt Platz ein, aber mindestens 320px */
.stats-column-left {
    flex: 1 1 320px; 
    max-width: 450px; 
    display: flex; 
    flex-direction: column; 
    gap: 10px;
}

/* Rechte Spalte: Nimmt Platz ein, aber mindestens 350px */
.stats-column-right {
    flex: 1 1 350px; 
    max-width: 500px; 
    display: flex; 
    flex-direction: column; 
    gap: 10px;
}

/* Wenn das Modal höher als breit ist (Hochformat), erzwinge Untereinander */
@media (max-aspect-ratio: 1/1) {
    .stats-main-container {
        flex-direction: column;
        align-items: center;
    }
    .stats-column-left, .stats-column-right {
        max-width: 100%;
        width: 100%;
    }
}


/*Grid Container*/
#gridListPanel {
    position: absolute;
    top: 80px; /* Unter dem Zoom-Slider */
    right: 10px;
    width: 220px;
    max-height: 500px;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1000;
    border: 1px solid #999;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-family: sans-serif;
    display: none; /* Standardmäßig aus */
    flex-direction: column;
}

#gridListHeader {
    background: #f0f0f0;
    padding: 5px 10px;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    border-bottom: 1px solid #ccc;
    display: flex;
    justify-content: space-between;
}

#gridListContent {
    overflow-y: auto;
    padding: 5px;
    font-size: 11px;
}

.grid-item {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    border-bottom: 1px dotted #ccc;
}

#gridListContent table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
#gridListContent td {
    padding: 2px 4px;
    border-bottom: 1px solid #eee;
}
.grid-main { font-weight: bold; background: #f9f9f9; }
.grid-sub { padding-left: 15px !important; color: #555; font-style: italic; }
.text-right { text-align: right; }
.text-center { text-align: center; }


.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
  border-color: black;
  border-width: thin;
  border-style: solid;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #2196F3;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.toggle-slider:hover {
  box-shadow: 0 0 1px #2196F3;
}