/* ==========================================================================
   Main Map Container
   ========================================================================== */
   #map {
    height: 600px;
    width: auto;
    max-width: 1200px;
    margin: 0 auto;
    border: 2px solid #666;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

/* ==========================================================================
   Button Styles - Global
   ========================================================================== */
.map-button,
.help-button,
.style-control-container a,
.leaflet-pm-toolbar .leaflet-pm-action {
    background-color: #ffffff;
    border: 1px solid #666;
    padding: 8px 16px;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    color: #666;
}

/* Button Hover States */
.map-button:hover,
.help-button:hover,
.style-control-container a:hover,
.leaflet-pm-toolbar .leaflet-pm-action:hover {
    background-color: #b00707 !important;
    border-color: #b00707 !important;
    color: #ffffff !important;
}

/* Disabled and Hidden States */
.map-button:disabled {
    background-color: #ebebeb;
    border-color: #666;
    color: #999999;
    cursor: not-allowed;
    opacity: 1;
    pointer-events: none;
}

.map-button.hidden {
    display: none !important;
}

/* ==========================================================================
   Button Container
   ========================================================================== */
#button-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    gap: 10px;
}

/* ==========================================================================
   Help Button
   ========================================================================== */
.help-button {
    width: 31px;
    height: 31px;
    line-height: 31px;
    padding: 0;
    position: absolute;
    left: 10px;
    top: 122px;  /* Position unter dem Geosearch-Button */
    margin: 0;
    z-index: 1000;
    font-weight: bold;
}

/* ==========================================================================
   Style Control Container
   ========================================================================== */
.style-control-container a {
    width: 31px;
    height: 31px;
    line-height: 31px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.style-control-container a:hover .fa-palette {
    color: #ffffff;
}

.style-control-container .fa-palette {
    color: #666;
    transition: color 0.3s ease;
}

/* ==========================================================================
   Geoman Toolbar Styles
   ========================================================================== */
/* Base Button Styles */
.leaflet-pm-toolbar .button-container .leaflet-buttons-control-button {
    background-color: #ffffff;
    border: 1px solid #666;
    padding: 0;
    text-align: center;
    text-decoration: none;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    color: #666;
    width: 31px;
    height: 31px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover Effects */
.leaflet-pm-toolbar .button-container .leaflet-buttons-control-button:hover,
.leaflet-pm-toolbar .button-container .leaflet-buttons-control-button:focus {
    background-color: #b00707 !important;
    border-color: #b00707 !important;
    color: #ffffff !important;
}

/* Icon Styles */
.leaflet-pm-toolbar .leaflet-pm-action {
    width: 31px;
    height: 31px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Geoman specific icon size adjustments */
.leaflet-pm-toolbar .leaflet-pm-icon-marker,
.leaflet-pm-toolbar .leaflet-pm-icon-polygon,
.leaflet-pm-toolbar .leaflet-pm-icon-polyline,
.leaflet-pm-toolbar .leaflet-pm-icon-circle,
.leaflet-pm-toolbar .leaflet-pm-icon-circle-marker,
.leaflet-pm-toolbar .leaflet-pm-icon-rectangle,
.leaflet-pm-toolbar .leaflet-pm-icon-delete,
.leaflet-pm-toolbar .leaflet-pm-icon-edit,
.leaflet-pm-toolbar .leaflet-pm-icon-drag,
.leaflet-pm-toolbar .leaflet-pm-icon-cut,
.leaflet-pm-toolbar .leaflet-pm-icon-text {
    transform: scale(0.7);  /* Sie können diesen Wert anpassen (0.5 bis 1.0) */
    display: inline-block;
}

/* Ensure smooth transitions */
.leaflet-pm-toolbar .leaflet-pm-icon {
    transition: transform 0.3s ease;
}

/* Icon Hover States */
.leaflet-pm-toolbar .button-container .leaflet-buttons-control-button:hover .leaflet-pm-icon-marker,
.leaflet-pm-toolbar .button-container .leaflet-buttons-control-button:hover .leaflet-pm-icon-polygon,
.leaflet-pm-toolbar .button-container .leaflet-buttons-control-button:hover .leaflet-pm-icon-polyline,
.leaflet-pm-toolbar .button-container .leaflet-buttons-control-button:hover .leaflet-pm-icon-circle,
.leaflet-pm-toolbar .button-container .leaflet-buttons-control-button:hover .leaflet-pm-icon-circle-marker,
.leaflet-pm-toolbar .button-container .leaflet-buttons-control-button:hover .leaflet-pm-icon-rectangle,
.leaflet-pm-toolbar .button-container .leaflet-buttons-control-button:hover .leaflet-pm-icon-delete,
.leaflet-pm-toolbar .button-container .leaflet-buttons-control-button:hover .leaflet-pm-icon-edit,
.leaflet-pm-toolbar .button-container .leaflet-buttons-control-button:hover .leaflet-pm-icon-drag,
.leaflet-pm-toolbar .button-container .leaflet-buttons-control-button:hover .leaflet-pm-icon-cut,
.leaflet-pm-toolbar .button-container .leaflet-buttons-control-button:hover .leaflet-pm-icon-snapping,
.leaflet-pm-toolbar .button-container .leaflet-buttons-control-button:hover .leaflet-pm-icon-text {
    filter: brightness(0) invert(1) !important;
}

/* Active States */
.leaflet-pm-toolbar .active .leaflet-pm-icon {
    color: #b00707;
}

.leaflet-pm-toolbar .active:hover .leaflet-pm-icon {
    color: #ffffff !important;
}

/* ==========================================================================
   Information Panel
   ========================================================================== */
.info-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    padding: 10px;
    border: 1px solid #666;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 200px;
    transition: opacity 0.3s ease;
}

.info-panel.hidden {
    opacity: 0;
    pointer-events: none;
}

.info-content {
    font-size: 12px;
    line-height: 1.4;
}

/* ==========================================================================
   Parcel Labels
   ========================================================================== */
.parcel-label {
    background: transparent;
    border: none;
    color: #ffffff;
    font-weight: bold;
    font-size: 10px;
    text-align: center;
    text-shadow: 
        -1px -1px 0 #000000,
        1px -1px 0 #000000,
        -1px 1px 0 #000000,
        1px 1px 0 #000000;
    pointer-events: none;
    transition: all 0.3s ease;
}

.parcel-label div {
    line-height: 1;
}

.parcel-label u {
    text-decoration-color: #ffffff;
    text-shadow: 
        -1px -1px 0 #000000,
        1px -1px 0 #000000,
        -1px 1px 0 #000000,
        1px 1px 0 #000000;
}

.parcel-label-hover {
    font-size: 14px;
    font-weight: bold;
    z-index: 1000;
}

/* ==========================================================================
   Custom Logo
   ========================================================================== */
.custom-logo-marker {
    display: static !important;
    align-items: center;
    justify-content: center;
}

.custom-logo-marker img {
    width: 131px !important; 
    height: 131px !important;
    transform: none !important;
}

/* ==========================================================================
   Instruction Panel
   ========================================================================== */
.instruction-panel {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1000;
    font-size: 14px;
    transition: opacity 0.3s ease;
    border: 2px solid #666;
    min-width: 200px;
    max-width: 600px;
}

.instruction-content {
    position: relative;
    padding: 15px;
}

.instruction-panel p {
    margin: 0 0 10px 0;
}

.instruction-panel ul {
    margin: 0;
    padding-left: 20px;
}

.instruction-panel li {
    margin-bottom: 5px;
}

.drawing-instruction {
    top: 10px;
    right: 60px;
    left: auto;
    transform: none;
}

.instruction-panel.hidden {
    opacity: 0;
    pointer-events: none;
}

.drawing-instruction::after {
    content: '';
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 15px solid white;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */
.row {
    display: flex;
    margin-bottom: 1rem;
}

.col-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding-right: 15px;
}

.col-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
}

.form-label {
    margin-bottom: 0.5rem;
    display: inline-block;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #666;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

.form-control:focus {
    color: #666;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 80%;
    color: #dc3545;
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* ==========================================================================
   Help Popup
   ========================================================================== */
.help-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2000;
    max-width: 400px;
    width: 90%;
}

.help-popup.hidden {
    display: none;
}

/* Close Buttons */
.close-button,
.help-popup-close {
    position: absolute;
    right: -10px;
    top: -10px;
    width: 31px;
    height: 31px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 18px;
    background: none;
    border: none;
    box-shadow: none;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.help-popup-close:hover {
    color: #b00707;
    background: none;
    border: none;
}

/* ==========================================================================
   Layer Control
   ========================================================================== */
.leaflet-control-layers-base label {
    display: flex !important;
    align-items: center;
    margin-bottom: 5px;
    padding: 5px;
    transition: all 0.2s;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
}

.leaflet-control-layers-base label.active-layer {
    border-color: #b00707;
    background-color: rgba(176, 7, 7, 0.05);
}

.leaflet-control-layers-base label:hover:not(.active-layer) {
    background-color: #f4f4f4;
}

.leaflet-control-layers {
    min-width: 0px;
    padding: 0;
}

.leaflet-control-layers-base input[type="radio"] {
    display: none !important;
}

.leaflet-control-layers-base span {
    margin-left: 0;
}

.leaflet-control-layers-base label .leaflet-container {
    pointer-events: none;
}

.leaflet-control-layers-list {
    margin: 0;
    padding: 5px;
}

/* ==========================================================================
   Miscellaneous
   ========================================================================== */
.message-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-circle {
    font-size: 20px;
    color: #b00707;
    font-style: normal;
}

.message-container p {
    margin: 0;
}

.style-select {
    padding: 4px;
    border: 1px solid #666;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
}

.leaflet-tooltip {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* ==========================================================================
   Zoom Control Styles
   ========================================================================== */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: none !important;
    margin: 10px !important;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    background-color: #ffffff !important;
    border: 1px solid #666 !important;
    color: #666 !important;
    width: 31px !important;
    height: 31px !important;
    line-height: 31px !important;
    font-size: 18px !important;
    text-align: center !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    transition: all 0.3s ease !important;
    margin-bottom: 5px !important;
}

.leaflet-control-zoom-in:hover,
.leaflet-control-zoom-out:hover {
    background-color: #b00707 !important;
    border-color: #b00707 !important;
    color: #ffffff !important;
}

/* Disabled state */
.leaflet-disabled {
    background-color: #ebebeb !important;
    border-color: #666 !important;
    color: #999999 !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
    pointer-events: none !important;
}

/* ==========================================================================
   Geosearch Control Styles
   ========================================================================== */
.leaflet-control-geosearch {
    position: absolute !important;
    left: 10px !important;
    top: 85px !important;
    margin: 0 !important;
}

/* Reset default styles */
.leaflet-control-geosearch.leaflet-bar {
    border: none !important;
    box-shadow: none !important;
}

/* Main button styling */
.leaflet-control-geosearch a.leaflet-bar-part {
    position: relative !important;
    background-color: #ffffff !important;
    border: 1px solid #666 !important;
    width: 33px !important;
    height: 33px !important;
    line-height: 31px !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    transition: all 0.3s ease !important;
    margin-bottom: 0px !important;
    display: block !important;
}

/* Magnifying glass parts */
.leaflet-control-geosearch a.leaflet-bar-part:before {
    top: 17px !important;
    left: 15px !important;
    width: 6px !important;
    border-top: 2px solid #666 !important;
    transform: rotateZ(45deg) !important;
    transition: all 0.3s ease !important;
}

.leaflet-control-geosearch a.leaflet-bar-part:after {
    top: 10px !important;
    left: 10px !important;
    height: 8px !important;
    width: 8px !important;
    border: 2px solid #666 !important;
    transition: all 0.3s ease !important;
}

/* Hover states */
.leaflet-control-geosearch a.leaflet-bar-part:hover {
    background-color: #b00707 !important;
    border-color: #b00707 !important;
}

.leaflet-control-geosearch a.leaflet-bar-part:hover:before {
    border-top-color: #ffffff !important;
}

.leaflet-control-geosearch a.leaflet-bar-part:hover:after {
    border-color: #ffffff !important;
}

/* Search form and results */
.leaflet-control-geosearch form {
    position: absolute !important;
    left: 35px !important;  /* 31px Button + 5px spacing */
    top: 0 !important;
    height: 32px !important;
    line-height: 32px !important;
}



/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .leaflet-control-container {
        display: none !important;
    }
    
    .map-button,
    .help-button,
    .instruction-panel,
    .info-panel {
        display: none !important;
    }
    
    #map {
        height: 100%;
        width: 100%;
        margin: 0;
        padding: 0;
    }
}

/* Ensure proper stacking */
.leaflet-top {
    z-index: 1000;
}

/* Adjust container for better alignment */
.leaflet-control-container .leaflet-top.leaflet-left {
    top: 0;
    left: 0;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.hidden {
    display: none !important;
}

.transparent {
    opacity: 0 !important;
}

.no-pointer-events {
    pointer-events: none !important;
}

.clickable {
    cursor: pointer;
}
