@use 'vars-svm' as vars;

@import '~ol/ol.css';
// @import "~ol-ext/dist/ol-ext.css";
// @import '@angular/material/theming';
@import 'svm-theme-styles.scss';

// this mixin is imported by enclosing apps to set theme style
@mixin slide-viewer-module-theme($theme) {
  @include svm-theme-styles($theme);
}

/*
 * SECTION: global style 'interfaces'
 * these global styles are provided for apps using the slide-viewer module
 * theses style can be overwritten by enclosing apps
 * changing these class names has to be treated as *breaking change*!
 */

// slide & overview background
.svm-slide-background {
  background-color: white;
}

// provide over writable defaults for scale line styling
.svm-scale-line {
  // if we want to position the scale line somewhere else
  // align-self: flex-end; // right
  margin-right: 4px;
  margin-bottom: 4px;
  // background-color: rgb(49, 115, 255);
  z-index: vars.$scale-line-z-index;
}

// provide over writable defaults for zoom slider styling
.svm-zoom-slider {
  margin-right: 4px;
  margin-bottom: 4px;

  z-index: vars.$zoom-slider-z-index;
}

// empty rule sets - these can be overwritten by apps using the module
.svm-overview {
}

.svm-toolbar {
  margin: 0 4px;
}

// container allowing flex or absolute positioning
.svm-toolbar-container {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  left: 0px;
  top: 0px;
  // render over overview map
  z-index: vars.$toolbar-z-index;
}

// container allowing flex or absolute positioning
.svm-overview-container {
  position: relative;
  display: flex;
  justify-content: flex-end;
  width: 100%;
  height: 100%;
  left: 0px;
  right: 0px;
  top: 0px;
}

// container for zoom slider and scale line
.svm-zoom-scale-container {
  position: absolute;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  top: 0px;
  left: 0px;
  right: 0px;
  height: 100%;
  width: 100%;
  justify-content: flex-end;
  align-items: flex-end;
}

/*
 * END SECTION: global style 'interfaces'
 */

// Open Layers Styles

/* Popup */
.ol-popup {
  position: absolute;
  background-color: white;
  -webkit-filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2));
  filter: drop-shadow(0 1px 4px rgba(105, 90, 90, 0.2));
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #cccccc;
  bottom: 12px;
  left: -50px;
  min-width: 280px;
}

.ol-popup:after,
.ol-popup:before {
  top: 100%;
  border: solid transparent;
  content: ' ';
  height: 0;
  width: 0;
  position: absolute;
  pointer-events: none;
}

.ol-popup:after {
  border-top-color: white;
  border-width: 10px;
  left: 48px;
  margin-left: -10px;
}

.ol-popup:before {
  border-top-color: #cccccc;
  border-width: 11px;
  left: 48px;
  margin-left: -11px;
}

.ol-popup-closer {
  text-decoration: none;
  position: absolute;
  top: 2px;
  right: 8px;
}

.ol-popup-closer:after {
  content: '✖';
}

/* Overview Map */
/* see https://openlayers.org/en/latest/examples/overviewmap-custom.html */
.ol-custom-overviewmap,
.ol-custom-overviewmap.ol-uncollapsible {
  bottom: auto;
  left: auto;
  right: 0;
  top: 0;
  // border: 1px solid red;
}

.ol-overviewmap .ol-overviewmap-map {
  width: 350px;
  height: 300px;
}

// scale line
svm-scale-line {
  display: flex;
  position: relative;

  // reset openlayers positioning styles
  .ol-scale-line {
    position: unset;
    left: unset;
    bottom: unset;
    padding: 2px;
  }
}

svm-dnd-container {
  display: flex;

  .ol-custom-overviewmap,
  .ol-custom-overviewmap.ol-uncollapsible {
    top: 0px;
    right: 0px;
    padding: 0px;
  }

  .ol-overviewmap .ol-overviewmap-map {
    width: 246px;
    height: 246px;
  }

  .ol-overviewmap:not(.ol-collapsed) {
    background: rgba(255, 255, 255, 0.2);
  }
}

// measure tool
.ol-tooltip {
  position: relative;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  color: white;
  padding: 4px 8px;
  opacity: 0.7;
  white-space: nowrap;
  font-size: 12px;
}

.ol-tooltip-measure {
  opacity: 1;
  font-weight: bold;
}

.ol-tooltip-static {
  background-color: #ffcc33;
  font-weight: bold;
  color: black;
  border: 1px solid white;
}

.ol-tooltip-measure:before,
.ol-tooltip-static:before {
  border-top: 6px solid rgba(0, 0, 0, 0.5);
  border-right: 6px solid transparent;
  border-left: 6px solid transparent;
  content: '';
  position: absolute;
  bottom: -6px;
  margin-left: -7px;
  left: 50%;
}

.ol-tooltip-static:before {
  background-color: #ffcc33;
}

/** These styles where used by zoom-slide.component
  */
.ol-zoom.ol-control button {
  position: inherit;
  display: inline-block;
}

.ol-zoom {
  position: inherit;
  background-color: rgba(0, 0, 0, 0.3);
}

.ol-zoom:hover,
.ol-zoom:focus {
  background-color: rgba(0, 0, 0, 0.3);
}

.ol-zoom .ol-zoom-out {
  // width of zoom slider
  margin-left: 200px;
}

.ol-zoomslider {
  top: 8px;
  left: 43px;
  width: 187px;
  height: 26px;
}

.ol-zoomslider button {
  height: 30px;
  width: 12px;
  bottom: 3px;
}

.ol-touch .ol-zoom .ol-zoom-out {
  margin-left: 212px;
}

.ol-touch .ol-zoomslider {
  left: 8px;
}

.ol-zoom .ol-zoom-out {
  width: 30px;
  height: 30px;
}

.ol-zoom .ol-zoom-in {
  width: 30px;
  height: 30px;
}

.ol-zoom-in.ol-has-tooltip:hover [role='tooltip'],
.ol-zoom-in.ol-has-tooltip:focus [role='tooltip'] {
  top: 3px;
}

.ol-zoom-out.ol-has-tooltip:hover [role='tooltip'],
.ol-zoom-out.ol-has-tooltip:focus [role='tooltip'] {
  top: 232px;
}

.ol-overlaycontainer-stopevent {
  z-index: vars.$overlay-z-index !important; // needs important to overwrite the style property
}

.ol-overlaycontainer {
  z-index: vars.$overlay-z-index !important; // needs important to overwrite the style property
}
