body {
    background: #fdfaf7; /* Ein sehr helles, warmes Off-White */
    color: #2b1d0e; /* Dunkles Braun für Textkontrast */
    font-family: "Segoe UI", system-ui, sans-serif;
    margin: 0;
    padding: 0;
}

#map {
    height: 350px;
    width: 100%;
    position: relative; /* Wichtig für die absolute Positionierung der Overlays */
}

#mapWrapper {
  position: relative;
  width: 100%;
  height: 400px; /* oder deine gewünschte Höhe */
}

#fixedOverlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none; /* klickt durch die Karte auf Marker etc. */
  z-index: 999;
}


/* FIX: Bereich für die Steuerung nach oben holen */
#controls {
    padding: 10px;
    background: #efebe9;
    border-top: 1px solid #d7ccc8;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    position: relative; 
    z-index: 1005;      /* Höher als Overlays */
}

/* FIX: Verhindert, dass Overlays in andere Sektionen ragen */
#accordion-section-4 .content {
    position: relative;
    overflow: hidden; 
}

#controls > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#overlayArrows {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    display: none; /* bei Bedarf einblenden */
    cursor: grab;
    touch-action: none;
    pointer-events: auto;
    z-index: 1000; /* über dem Bild, falls nötig */
}

#overlayArrows:active {
    cursor: grabbing;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="number"] {
    width: 60px;
    background: #fff;
    border: 1px solid #d7ccc8;
    color: #3e2723;
}

#overlayImg {
    position: absolute;
    /* Zentrierung exakt mittig zur Map */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transform-origin: center;
    z-index: 999;
    width: 200px;
    cursor: grab;
    touch-action: none;
    pointer-events: auto;
}

#overlayImg:active {
    cursor: grabbing;
}

#centerCoords {
    display: flex;
    flex-direction: column; 
    align-items: center;    
    justify-content: flex-start; 
    text-align: center;     
    
    /* Positionierung über dem Overlay in der Mitte der Map */
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1010;          
    background: rgba(255, 250, 240, 0.85);
    padding: 5px 15px;
    border-radius: 20px;
    margin: 5px auto;
    width: fit-content;     
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); 
    pointer-events: none;   
}

#centerCoords table {
    margin: 0;
    color: #3e2723;
}

/* Responsive Styles */
@media (max-width: 600px) {
  body { font-size: 14px; }
}

@media (min-width: 601px) and (max-width: 1024px) {
  body { font-size: 16px; }
}

@media (min-width: 1025px) {
  body { font-size: 18px; }
}

@media (max-width: 1024px) {
  .control-table {
    display: block;
  }
  .control-table tr, .control-table td {
    display: block;
    width: 100%;
    margin-bottom: 10px;
  }
  input[type="range"], input[type="number"] {
    width: 100%;
  }
}

.control-table td .cell-content {
  display: flex;
  align-items: center;
  gap: 5px;
}

.control-table {
  border-collapse: collapse;
  width: 100%;
}

.control-table td {
  padding: 5px 10px;
  vertical-align: middle;
}

/* Header & Menü */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #3e2723;
    color: #fdf5e6;
    position: relative;
    z-index: 10000; 
}

#appMenuPanel {
    position: fixed;
    top: 64px;
    right: 12px;
    display: none;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(135deg, #5d4037, #3e2723);
    color: #fdf5e6;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
    z-index: 100000;
}

.app-menu-item {
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    color: #fdf5e6;
    transition: background 0.2s ease;
}

.app-menu-item:hover {
    background-color: #795548;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flag-dropdown {
    position: relative;
    display: inline-block;
}

.flag-dropdown button {
    background: linear-gradient(135deg, #5d4037, #3e2723);
    color: white;
    border: 1px solid #8d6e63;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
}

/* FIX: Überdeckt andere Elemente und verschiebt nichts */
.flag-menu {
    display: none;
    position: absolute;
    top: 110%; /* Leicht unter dem Button */
    right: 0;   /* Rechtsbündig zum Button */
    background: #fffaf0;
    border: 1px solid #d2b48c;
    border-radius: 4px;
    flex-direction: column;
    min-width: 140px;
    z-index: 100001; /* Höher als das App-Menü */
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.flag-menu .app-menu-item {
    color: #3e2723;
    border-bottom: 1px solid #efebe9;
}

.flag-menu .app-menu-item:hover {
    background-color: #efebe9;
}

.app-menu {
    cursor: pointer;
    font-size: 20px;
    padding: 6px 10px;
    border-radius: 4px;
}

/* Buttons & Controls */
/* Kompakte Buttons & Controls */
.button {
    display: inline-flex;
    align-items: center;
    gap: 8px;                   /* Etwas weniger Abstand zum Pfeil */
    padding: 6px 18px;          /* Deutlich reduziertes Padding für einen flacheren Look */
    
    font-size: 13px;            /* Kleinere, edlere Schriftgröße */
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 500;
    letter-spacing: 0.08em;     /* Mehr Spacing lässt kleine Schrift edler wirken */
    text-transform: uppercase;
    
    color: #a68d76;
    background-color: transparent!important; 
    background: transparent !important; 
    border: 1px solid #c2b2a3;  /* Etwas dünnerer und hellerer Rahmen für mehr Leichtigkeit */
    border-radius: 50px;
    
    cursor: pointer;
    transition: all 0.3s ease;
}

.button:hover {
    color: white;
    background-color: #a68d76 !important; 
    background: #a68d76 !important; 
    transform: scale(0.98);    /* Kleiner "Klick"-Effekt statt Verschiebung */
}

.button-arrow::after {
    /* Font Awesome 4 Setup */
    font-family: 'FontAwesome';
    content: "\f061";           /* Unicode für fa-arrow-right */
    
    /* Styling für mehr "Dicke" und Präsenz */
    font-size: 14px;            /* Etwas größer als deine 13px Schrift */
    font-weight: normal;        /* FA4 nutzt meist normal oder 400 */
    display: inline-block;
    
    /* Feinjustierung der Position */
    vertical-align: middle;
    margin-top: -1px;           /* Gleicht optische Achse bei Großbuchstaben aus */
    
    transition: transform 0.3s ease;
}

/* Hover-Effekt */
.button-arrow:hover::after {
    transform: translateX(5px);
}

/* Optional: Das Pfeil-Icon (falls du ein HTML-Element dafür nutzt) */
.button .arrow {
    font-size: 1.2em;
    line-height: 0;
}

details {
    position: relative;
    z-index: 1005;
    background: #fffaf0;
    padding: 5px;
    border: 1px solid #d2b48c;
    border-radius: 4px;
}

#declinationMode {
    /* Layout & Spacing */
    display: inline-flex;
    align-items: center;
    padding: 6px 40px 6px 20px; /* Rechts mehr Platz gelassen */
    min-width: 160px;           /* Verhindert Abschneiden von "KOMPASS" */
    
    /* Typografie */
    font-size: 13px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 500;
    letter-spacing: 0.1em;      /* Leicht erhöht für edlen Look */
    text-transform: uppercase;
    
    /* Farben & Rahmen */
    color: #a68d76;
    background-color: transparent;
    border: 1px solid #c2b2a3;
    border-radius: 50px;
    
    /* Interaktion */
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    
    /* Custom Arrow (Inline SVG - 100% DSGVO sicher) */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a68d76' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center; /* Pfeil etwas weiter nach links gerückt */
    background-size: 12px;
}

#declinationMode:hover {
    color: white;
    background-color: #a68d76;
    border-color: #a68d76;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    transform: scale(0.98);
}

/* WICHTIG: Korrektur für die Dropdown-Liste */
#declinationMode option {
    background-color: #ffffff;
    color: #3e2723;
    /* In der Liste kein Uppercase, da manche Browser das nicht unterstützen */
    text-transform: none; 
    letter-spacing: normal;
    padding: 10px;
}

#manualDeclination {
    background: #ffffff;
    border: 1px solid #d7ccc8;
    border-radius: 6px;
    padding: 6px 8px;
    font-family: inherit;
    color: #3e2723;
    outline: none;
}


.upload-container {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f9f9f9;
    cursor: pointer;
    position: relative;
}

.upload-container.dragover {
    background: #e1f5fe;
    border-color: #03a9f4;
}

#imagePreview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.preview-hidden {
    display: none;
}

.button-container {
    display: flex;          /* Flexbox aktivieren */
    justify-content: center; /* horizontal zentrieren */
    gap: 10px;              /* Abstand zwischen den Buttons */
    margin-top: 20px;       /* optional: Abstand nach oben */
}

.action-container {
    display: flex;          /* Flexbox aktivieren */
    justify-content: center; /* horizontal zentrieren */
    gap: 10px;              /* Abstand zwischen den Buttons */
    margin-top: 20px;       /* optional: Abstand nach oben */
}

.processingImage {
    max-width: 100%;
    max-height: 600px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.center-container {
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

/* Container für das gesamte Menü */
  .control-panel {
    display: flex;
    flex-direction: column;
    align-items: center; /* Zentriert den Inhalt horizontal */
    gap: 15px;           /* Abstand zwischen Input und Button-Zeile */
    width: 100%;
  }

  Styling für das Inputfeld
  #filenameInput {
    width: 300px;        
    padding: 8px;
    box-sizing: border-box;
  }

  /* Container für die Buttons nebeneinander */
  .button-row {
    display: flex;
    flex-direction: row;
    gap: 10px;           /* Abstand zwischen den Buttons */
    justify-content: center;
  }

  .center-container table {
    margin-left: auto;
    margin-right: auto;
    border-spacing: 10px; /* Optional: sorgt für etwas Platz zwischen den Zellen */
    text-align: left;    /* Optional: Damit der Text IN der Tabelle linksbündig bleibt */
}

.button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1); /* Optional: macht den Button grau */
}