body {
    padding: 0;
    margin: 0;
}

#windy #logo {
    margin-left: auto !important;
    left: 19px !important;
}

#popup-table-div {
    width: max-content;
    max-width: 100%;
}

#popup-table {
    table-layout: fixed;
}

td {
    border-bottom: 1px solid black;
    border-collapse: collapse;
    padding: 5px;
}

tbody > tr:last-child > td {
    border-bottom: none;
}

#dygraph-container {
    position: absolute;
    z-index: 2048; /* 20 */
    background: #fff;
    bottom: 0;
    left: 0;
    height: 0%;
    width: 100% !important;
    overflow: hidden;
    transition: height .2s;
}


#windy {
    position: relative;
    width: 100%;
    height: 100%;
    /* z-index: 10; */
    z-index: 1; /* Lower base z-index */
    transition: height .2s;
}

#windy #map-container>div.leaflet-pane.leaflet-map-pane>div.leaflet-pane.leaflet-marker-pane>div.leaflet-marker-icon.picker.open.leaflet-zoom-animated.leaflet-interactive.leaflet-marker-draggable {
    z-index: 1024 !important;
    /* z-index: 10 !important; */
}

#windy .leaflet-container .leaflet-marker-pane img {
    -webkit-filter: drop-shadow( 3px 3px 2px rgba(0, 0, 0, .7));
    filter: drop-shadow( 3px 3px 2px rgba(0, 0, 0, .7));
}

#windy .leaflet-marker-icon {
    -webkit-filter: drop-shadow( 3px 3px 2px rgba(0, 0, 0, .7));
    filter: drop-shadow( 3px 3px 2px rgba(0, 0, 0, .7));
}

/* Ensure proper stacking context */
#windy .leaflet-control {
    z-index: 1000 !important;
}

#windy .leaflet-top {
    z-index: 1000;
}

#windy .leaflet-bottom {
    z-index: 1000;
}

/* Fix picker visibility */
#windy .picker {
    z-index: 1001 !important;
}

/* Ensure proper overlay pane rendering */
#windy .leaflet-overlay-pane {
    z-index: 400;
}

/* Fix popup visibility */
#windy .leaflet-popup {
    z-index: 1002;
}

/* Ensure controls are clickable */
#windy .leaflet-control-container .leaflet-control {
    clear: both;
    pointer-events: auto;
}

.dygraph-legend {
    -webkit-filter: drop-shadow( 3px 3px 2px rgba(0, 0, 0, .7));
    filter: drop-shadow( 3px 3px 2px rgba(0, 0, 0, .7));
    width: max-content !important;
    transition: top .15s;
}

.dygraph-title {
    font-family: 'Roboto Mono', monospace;
    padding-right: 25px;
}

#close-dygraph {
    position: absolute;
    /* z-index: 30; */
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    padding: 0px;
    line-height: 5px;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
}


#windy #map-container {
    cursor: move;
    cursor: grab;
    cursor: -moz-grab;
    cursor: -webkit-grab;
}

#windy #map-container:active {
    cursor: grabbing;
    cursor: -moz-grabbing;
    cursor: -webkit-grabbing;
}


#datepicker-modal {
    /* z-index: 20; */
    z-index: 2048;
    position: absolute;
    padding-top: 20px;
    padding-left: 16px;
    padding-right: 16px;
    left: 50%;
    top: -200px;
    transform: translate(-50%, -50%);
    width: max-content;
    height: 5em;
    border-radius: 2px;
    background: white;
    text-align: center;
    -webkit-filter: drop-shadow( 3px 3px 2px rgba(0, 0, 0, .7));
    filter: drop-shadow( 3px 3px 2px rgba(0, 0, 0, .7));
    transition: top 0.3s;
}

#close-datepicker-modal {
    position: absolute;
    right: 0;
    width: 32px;
    height: 20px;
    top: 0;
    font-size: 13px;
    border-style: none;
}

#close-datepicker-modal:hover {
    cursor: pointer;
    background: orangered;
}

#sensor-search {
    display: none;
    /* z-index: 20;*/
    z-index: 1026;
    position: absolute;
    top: 96px;
    left: 16px;
}

.control-panel-button:hover {
    background-color: lightgreen;
}

#sensor-source {
    display: inherit;
    z-index: 20;
    position: absolute;
    top: 250px;
    left: 16px;
}

#login {
    display: none;
    /*z-index: 20; */
    z-index: 1000;
    position: absolute;
    top: 310px;
    left: 16px;
}

#sensor-search-input {
    display: inherit;
    /* z-index: 20; */
    z-index: 1026;
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -webkit-transform: translateY(-50%);
    border-style: solid;
    border-width: 1px;
    border-color: #555555;
    border-radius: 5px;
    width: 0px;
    font-size: 17px;
    transition: width 0.3s;
}

.control-panel-button {
    display: inherit;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -webkit-transform: translateY(-50%);
    /*z-index: 20;*/
    z-index: 1026;
    background: #f5f5f5;
    width: 40px;
    height: 40px;
    text-align: center;
    border-style: solid;
    border-color: #555555;
    border-radius: 50%;
}

.control-panel-button:focus {
    outline: none;
}

.control-panel-button:active {
    background: #999999;
}

.control-panel-button > i {
    font-size: 16;
}

.ui-autocomplete {
    padding-left: 20px;
    max-height: 80%;
    overflow-y: scroll;
    overflow-x: hidden;
}

#ui-id-1 {
    /*z-index: 20;*/
    z-index: 1020;
}

@media only screen and (max-width: 819px) {
    #sensor-search {        
        width: 66%;
    }

    .ui-autocomplete {
        width: 75%;
    }

    .daterangepicker {
        overflow: auto;
        max-height: 80%;
    }

    .daterangepicker .calendar-table td {
        min-width: 24px;
    }

    body > div.daterangepicker.ltr.show-ranges.openscenter.show-calendar {
        width: 300;
    }
}

@media (min-width: 820px) {
    #sensor-search {        
        width: 33%;
    }

    .ui-autocomplete {
        width: 60%;
    }

    .daterangepicker .drp-calendar.right {
        margin-left: 30px;
    }

    body > div.daterangepicker.ltr.show-ranges.openscenter.show-calendar {
        width: 800;
    }
}

#leafletmap {
    position: relative;
    /* Styles for the background div (e.g., map, image, etc.) */
    /* Adjust width, height, background color, etc. */
    width: 100%;
    height: 100%; /*100% of viewport height*/
    z-index: 15;
}

#arcgismap {
    position: relative;
    height: 100%;
    width: 100%;
    z-index: 15;
    /*font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #323232;*/
}

/* Fix zoom controls */
#windy #embed-zoom {
    top: 85px;
    z-index: 1000;
    display: block !important;
}

/* Ensure plugin menu is visible*/
#windy #plugin-menu {
    top: 0px;
    z-index: 1000;
    display: block !important;
}

/* Ensure proper layer controls visibility */
#windy #map-container .leaflet-control-container {
    display: block !important; 
    position: absolute;
    top: 100px;
    left: 1px;
    z-index: 1000;
    cursor: pointer;
}

/* Fix layer selector */
#windy #map-container .leaflet-control-layers.leaflet-control {
    display: block !important; 
    position: relative;
    top: 25px;
    left: 1px;
    z-index: 1000;
    cursor: pointer;
}

/* Ensure mobile overlay selector works */
#windy #mobile-ovr-select {
    top: 0px;
    z-index: 1000;

}

#windy #map-container .leaflet-control-layers-toggle {
    background-image: url(https://unpkg.com/leaflet@1.4.0/dist/images/layers-2x.png);
    background-size: 26px 26px;
    background-position: 50% 50%;
    background-repeat: no-repeat;
}

#windy .leaflet-overlay-pane svg {
    -webkit-user-select: none;
    user-select: none;
}

#windy .windy-pois canvas.leaflet-tile {
    image-rendering: -webkit-optimize-contrast;
}

/*map layer control container */
.leaflet-control-layers{
    display: block; 
    position: relative;
    top: 125px;
    left: 1px;
    cursor: pointer;
}

.leaflet-control {
    cursor: pointer;
}

/*layer control list of maps*/
.leaflet-control-layers-base label{
    width: 150px;
    float: left;
    /*margin-right: 20px;*/
}

.leaflet-control-layers-toggle {
    background-image: url(https://unpkg.com/leaflet@1.4.0/dist/images/layers-2x.png);
    background-size: 26px 26px;
    background-position: 50% 50%;
    background-repeat: no-repeat;
}

.leaflet-control-zoom {
    position: absolute;
    top: 195px;
    left: 7px;
}

#myprogress-bar {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40%;
    height: 10px;
    background-color: #f3f3f3;
    border-radius: 10px;
    overflow: hidden;
    /* z-index: 50; */
    z-index: 1026;
}

#myprogress {
    width: 0%;
    height: 100%;
    background-color: #4CAF50;
    transition: width 3s linear;
}