/*

dzs tooltips

arrow-top,
arrow-bottom
 -- align-left
 -- align-center (js)
 -- align-top

arrow-left,
arrow-right
 -- align-top
 -- align-center (js)
 -- align-bottom

custom css3 effects

*see about custom animation

*/

@mixin apply_transition($transition-property, $transition-duration, $transition-timing) {
  transition-property: $transition-property;
  transition-duration: $transition-duration;
  transition-timing-function: $transition-timing;
}

@mixin boxsizing() {
  box-sizing: border-box;
}

@mixin center_it() {
  position: absolute;
  top:50%; left:50%;
  transform: translate(-50%,-50%);
}



$transition-property: visibility, opacity;
$transition-duration: 0.3s;
$transition-timing: ease-out;


$color_bg: rgba(20, 20, 20, 0.9);
$color_txt: #eeeeee;
$color_highlight: #da4f74;

.dzstooltip-con {
  position: relative;
  cursor: pointer;


}

.dzstooltip {
  position: absolute;

  white-space: nowrap;
  line-height: 1;

  width: auto;

  display: block;


  &:hover {
    pointer-events: auto;
  }


  pointer-events: none;

  opacity: 0;
  visibility: hidden;

  $transition-property: opacity, visibility, z-index, transform;
  $transition-duration: 0.3s;
  $transition-timing: ease-out;

  @include apply_transition($transition-property, $transition-duration, $transition-timing);


  .tooltip-close {
    $size: 23px;
    width: $size;
    height: $size;
    position: absolute;
    cursor: pointer;
    top: -($size/2.5);
    right: -($size/2.5);
    box-shadow: 1px 1px 4px 0 rgba(50, 50, 50, 0.3);
    border-radius: 50%;
    z-index: 5;

    > svg {
      width: $size;
      height: $size;

      .bg-circle {
        fill: #fff;
      }

      .x-path {
        fill: #444;
      }
    }
  }

  &.dims-set {
    white-space: normal;
    line-height: inherit;
  }


  .dzstooltip--inner {
    position: relative;
    display: block;

    &:before {

      content: "";
      display: block;
      position: absolute;

    }
  }

  &.talign-start {

    left: 0;

    .dzstooltip--inner {
      left: 0;

      &:after {

        left: 15px;
      }
    }


  }


  &.talign-center {
    left: 50%;
    transform: translate3d(-50%, 0, 0);

    .dzstooltip--inner {

      //display: flex;
      //justify-content: center;
      //align-items: center;

      .dzstooltip--inner {
      }

      &:after {

        left: 50%;

        margin-left: -4px;
      }

    }
  }


  &.talign-end {
    left: auto;
    right: 0px;

    .dzstooltip--inner {

      //display: flex;
      //justify-content: center;
      //align-items: center;

      .dzstooltip--inner {
      }

      &:after {

        right: 15px;

      }

    }
  }

  &.arrow-bottom {
    bottom: 100%;

    margin-bottom: 15px;


    .dzstooltip--inner {

      &:after {

        top: 100%;
      }
      &:before {

        top: 100%;
      }

      &:before {

        left: 0;
        width: 100%;
        height: 15px;
      }
    }
  }

  &.arrow-top {
    top: 100%;

    margin-top: 15px;

    .dzstooltip--inner {

      &:after, &:before {

        bottom: 100%;
      }

      &:before {

        left: 0;
        width: 100%;
        height: 15px;
      }
    }
  }

  &.arrow-left {


    left: 100%;

    margin-left: 15px;


    .dzstooltip--inner {

      &:after {

        left: auto;
        right: 100%;

        border-right-width: 7px;
      }
    }
  }


  &.arrow-right {


    left: auto;
    right: 100%;

    margin-right: 15px;


    .dzstooltip--inner {

      &:after {

        right: auto;
        left: 100%;

        border-left-width: 7px;
      }
    }
  }


  .dzstooltip--inner {
    &:after {

      position: absolute;;
      width: 0;
      height: 0;
      border-style: solid;
      border-color: transparent;
      border-width: 7px;
    }

  }
}

.text-align-center {

  text-align: center;
}

.dzstooltip.arrow-left, .dzstooltip.arrow-right {
  &.talign-center {
    top: 50%;
    transform: translate3d(0, -50%, 0);


    .dzstooltip--inner {

      &:after {


        top: 50%;
        margin-top: -4px;
        margin-left: 0;
      }
    }
  }

  &.talign-start {


    top: 0;

    .dzstooltip--inner {

      //display: flex;
      //justify-content: center;
      //align-items: center;

      .dzstooltip--inner {
      }

      &:after {

        top: 15px;

      }

    }
  }

  &.talign-end {


    bottom: 0;

    .dzstooltip--inner {

      //display: flex;
      //justify-content: center;
      //align-items: center;

      .dzstooltip--inner {
      }

      &:after {

        bottom: 15px;
        top: auto;;

      }

    }
  }
}


.tooltip-indicator:hover + .dzstooltip, .dzstooltip.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  z-index: 5;
}


.hover-on-tooltip-con-too {
  .dzstooltip:hover, .dzstooltip.active {


    opacity: 1;
    visibility: visible;

    pointer-events: auto;
    z-index: 5;

    > .dzstooltip--inner {
      transform: translate3d(0, 0, 0) scale(1);
    }
  }

}

@import "css/tooltip-styles";
@import "css/tooltip-colors";
@import "css/tooltip-transitions";


.dzstooltip-con:not(.for-click):hover {
  > .dzstooltip {

    opacity: 1;
    visibility: visible;
  }
}

span.dzstooltip-con {
  display: inline-block;
}

@media all and (max-width: 470px) {


  .dzstooltip:not(.ceva) {


    //top: 100%;
    //bottom: auto;
    //left: 50%;
    //transform: translate3d(-50%, 0, 0);
    max-width: 98vw;
    //.dzstooltip--inner {
    //
    //  //display: flex;
    //  //justify-content: center;
    //  //align-items: center;
    //
    //  .dzstooltip--inner {
    //  }
    //
    //  &:after {
    //
    //    left: 50%;
    //    bottom:100%;
    //
    //    margin-left: -4px;
    //  }
    //
    //}
  }
}
.tooltip-info-indicator{
  $size: 17px;
  width: $size;
  height: $size;
  display: inline-block;

  background-color: #444444;
  border-radius: 50%;
  padding: 5px;

  position: relative;

  &--i{
    position: absolute;
    @include center_it();

    font-size: 11px;
    line-height: 11px;

    color: #EEEEEE;
    vertical-align: text-bottom;
  }
}
.tooltip-indicator {
  display: inline-block;

  text-decoration: dashed;

  color: $color_highlight
}

@import "css/misc";