/* CSS Custom Properties for Dynamic Viewport */
:root {
    --vh: 1vh;
    --sat: env(safe-area-inset-top);
    --sab: env(safe-area-inset-bottom);
    --sal: env(safe-area-inset-left);
    --sar: env(safe-area-inset-right);
}

.leaflet-control-zoom {
  position: absolute;
  right: 0.5em;
  bottom: 2em;
  z-index: 1100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border-radius: 0.5em;
  transition: right 0.3s, bottom 0.3s;
}
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
  font-size: 1.5em;
  width: 2.5em;
  height: 2.5em;
  line-height: 2.5em;
  text-align: center;
  background: #fff;
  color: #222;
  border: none;
  margin: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: background 0.2s, color 0.2s;
}

.leaflet-control-zoom-in:hover,
.leaflet-control-zoom-out:hover {
  background: #222;
  color: #6a6a6a;
}

/* ===== RESPONSIVE DESIGN - MOBILE FIRST ===== */

/* 1. Kleine Smartphones (bis 480px) - Basis-Styles gelten */
@media (max-width: 480px) {
  .leaflet-control-zoom {
    bottom: 4em;
    right: 0.1em;
  }
}

/* 2. Standard Smartphones (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) and (orientation: portrait) {
  .leaflet-control-zoom {
    bottom: 4.0em;
    right: 0.1em;
  }
}

/* 3. Tablets (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .leaflet-control-zoom {
    bottom: max(1px, var(--sab, 0px) + 1px) !important;
    right: max(1px, var(--sar, 0px) + 1px) !important;
    z-index: 1200 !important;
}
}

/*####################################################*/
/*##################### LANDSCAPE ####################*/
/*####################################################*/

/* 1. Kleine Smartphones (Landscape) */
@media (orientation: landscape) {
  .leaflet-control-zoom {
    bottom: 0px !important;
    right: 0px !important;
  }
}

/* ===== XIAOMI 12 T AND SIMILAR DEVICES FIXES ===== */

/* Specific fixes for Xiaomi 12 T and similar devices */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
    .leaflet-control-zoom {
        bottom: max(1px, var(--sab, 0px) + 1px) !important;
        right: max(1px, var(--sar, 0px) + 1px) !important;
        z-index: 1200 !important;
    }
}

/* Additional fixes for very small landscape screens */
@media (max-width: 700px) and (max-height: 400px) and (orientation: landscape) {
    .leaflet-control-zoom {
        bottom: max(5px, var(--sab, 0px) + 2px) !important;
        right: max(2px, var(--sar, 0px) + 1px) !important;
        z-index: 1200 !important;
    }
    
    /* Make zoom buttons smaller for very small screens */
    .leaflet-control-zoom-in,
    .leaflet-control-zoom-out {
        width: 2em !important;
        height: 2em !important;
        line-height: 2em !important;
        font-size: 1.2em !important;
    }
}
