@import "variables";
.loading-button {
  display: inline-block;

  &.expand {
    width: 100%;
    display: block;

    span.loading,
    span.failed,
    span.inactive,
    button, .button, .idle {
      width: 100%;
    }
  }

  span.loading,
  span.failed,
  span.inactive {
    display: none;
  }

  &.loading {
    button, .button, .idle {
      display: none;
    }

    .eject{display: none !important;}

    span.loading {
      display: inherit;
    }
  }

  &.failed {
    button, .button, .idle {
      display: none;
    }

    span.failed {
      display: inherit;
      font-style: normal;
    }
  }

  &.inactive {
    button, .button, .idle {
      display: none;
    }

    span.inactive {
      display: inherit !important;
      cursor: not-allowed;

      &.expand {
        width: 100%;
      }
    }
  }
}

.tooltip {
  background: black;
  color: white;
  padding: 10px;
  position: absolute;
  font-size: rem-calc(12);
  box-shadow: 1px 1px 3px #222;
  @include radius($global-radius);

  .pip {
    @include css-triangle(5px, black, bottom);
    position: absolute;
    top: -10px;
    right: 5px;
  }
}
// CONTROL MOVEMENT WIDGET
#xy-controls,
#z-controls{

  h5{
    color: $steel;
    font-family: 'nexa_boldregular';
  }

  .control-btn-wrapper {
    width: 56px;
    height: 56px;
    margin: 0;
    background: none;
    padding: 0;
    position: absolute;
    display: block;
    margin: 0 auto;

    &:active {
      .btn {
        background-color: darken($oil,10%);
        box-shadow: none;
        transform: translate(0,12px);
      }
    }

    .btn {
      background: $oil;
      box-shadow: 0 12px darken($oil, 40%);
      padding: 9px 0 0 0;
      width: 100%;
      height: 100%;
      border-radius: 8px;
      font-size: 33px;
      color: white;
      pointer-events: none;

      &:hover{
        background-color: lighten($oil,5%);
      }
    }
  }
}

#xy-controls {
	.control_bg_xy {
		position: relative;
    perspective: 500px;
    perspective-origin: 50% 60%;
    width: 100%;
    height: 200px;
    width: 200px;

    & > *{
      transform: rotateX(40deg);
    }

    .control-btn-wrapper {
      .btn {
        border-radius: 5px;
      }

      &.btn_y_plus {
        top: -11px;
        left: 70px;

        .btn {
          i:before{
            transform: rotate(-90deg);
          }
        }
      }

      &.btn_home_xy {
        top: 70px;
        left: 73px;
        height: 36px;
        width: 50px;

        .btn {
          font-size: 18px;
        }
      }

      &.btn_x_plus {
        top: 53px;
        right: -11px;
      }

      &.btn_x_minus {
        top: 53px;
        left: -10px;
        i:before{
          transform: rotate(-180deg);
        }
      }

      &.btn_y_minus {
        bottom: -11px;
        left: 70px;

        i:before{
          transform: rotate(90deg);
        }
      }
    }
  }

  .bed-mesh{
    width: 200px;
    height: 178px;

    border: 2px solid #e0e0e0;
    z-index: -1;
    top: 0;
    background: rgba(66, 66, 66, 0.04) url(/img/mesh-backg.svg) right no-repeat;
    background-size: 300px;
  }
}

#z-controls {
  margin-bottom: 20px;
  text-align: center;

  .control-btn-wrapper {
    position: relative;
    margin-bottom: 0;
    height: 45px;

    .btn {
      padding: 3px 0 0 0;
    }

    &.btn_home_z {
      margin: 18px auto;
      height: 33px;
      width: 50px;

      .btn {
        font-size: 18px;
      }
    }

    &.btn_z_plus i:before, &.btn_babystep_z_plus i:before{
      transform: rotate(-90deg);
    }

    &.btn_z_minus i:before, &.btn_babystep_z_minus i:before{
      transform: rotate(90deg);
    }

    &.btn_babystep_z_plus{margin-top: 10px;}

    &.btn_babystep_z_plus, &.btn_babystep_z_minus{
      height: 32px;
      width: 72px;

      .btn{
        font-size: 19px;
        padding-top: 5px;
      }
    }

    &.btn_babystep_z_minus{margin-top: 18px;}
  }
}
select.babystep-amount {
  width: 80px;
}

#distance-control {
  margin-bottom: 20px;
  padding: 0;

	ul {
		display: inline-block;
		padding: 0;
		li button {
			margin-bottom: 1px;
			font-size: rem-calc(18);
		}
	}
}

// GCODE TERMINAL
#gcode-widget {
  @keyframes example {
    from {background-size: 100% 5px; opacity: 0.7;}
    to {background-size: 100% 6px; opacity: 1;}
  }
  .arcade-screen{
    background: linear-gradient(180deg,transparent 50%,rgba(89, 217, 132, 0.08) 51%);
    background-size: 100% 5px;
  }

  input[name='gcode'] {
    border: 2px solid grey;
    border-radius: 5px 0 0 5px;
    letter-spacing: 2px;
    text-transform: initial;
    height: 45px;
  }

  .output-container {
    background-color: $jet;
    height: 500px;
    overflow: scroll;
    margin: 20px 0 10px 0;
    padding:0 0 10px 0;
    user-select: text;
    border-radius: 20px;
    border: 10px solid darken($jet, 15%);
    background-blend-mode: hard-light;
    position: relative;

    .alert-box{
      background: transparent;
      padding-left: 15px;
      color: $warning-color;
      font-size: 15px;
      line-height: 130%;
      border: 0;
    }

    div {
        padding-left: 10px;
        margin-bottom: 2px;
        text-indent: -5px;
        line-height: 140%;
    }

    .sent {
      color: saturate($violet2, 25%);
      border-left: 8px solid saturate($violet2, 25%);

      i {
        color: saturate($violet2, 25%);
        user-select: none;
      }

      &.failed {
        color: $alert-color;
        i {
          color: $alert-color;
        }

        border-left: 8px solid $alert-color;
        background: lighten($alert-color, 35%);
        border-bottom: 1px solid $alert-color;
      }
    }

    .received {
      color: saturate(#4dd1b1, 25%);
      border-left: 8px solid saturate(#4dd1b1, 25%);

      i {color: saturate(#4dd1b1, 25%);}
    }
  }
}
