image-editor {
  h2 {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    i.back {
      font-size: 30px;
      float: left;
      margin-right: 11px;
      &:hover {
        color: $accent;
      }
    }
  }
  .tabs {
    animation: fade-in 1 1500ms;
  }

  strong {
    text-align: center;
  }
  .zoom-info {
    position: absolute;
    bottom: 0;
    font-size: 14px;
    font-style: italic;
  }
  section.lightbox .tabs label {
    margin-bottom: 0;
  }
  section.lightbox .tabs label + input[type="text"] {
    margin-top: 0;
  }
  .output {
    background-size: 20px 20px;
    background-image: linear-gradient(45deg, #f5f5f5 25%, transparent 25%),
      linear-gradient(-45deg, #f5f5f5 25%, transparent 25%),
      linear-gradient(45deg, transparent 75%, #f5f5f5 75%),
      linear-gradient(-45deg, transparent 75%, #f5f5f5 75%);
    margin-bottom: 40px;
    min-height: 200px;
    display: flex;
    flex-flow: wrap;
    align-items: center;
    justify-content: center;
    canvas {
      max-width: 100%;
      max-height: 600px;
      display: block;
      transition: opacity 250ms ease;
    }
  }

  .tools-background {
    position: absolute;
    right: 0;
    border-radius: 3px;
    background: #ddd;
    width: 116px;
  }

  .tools {
    position: absolute;
    right: 0;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 3px;
    input[type="text"] {
      background: #fff;
      padding: 3px;
      border: none;
      height: 25px;
    }
    .row > div {
      padding: 1px;
    }
    button {
      width: 100%;
      margin-left: 0;
      margin-top: 8px;
      padding-left: 6px;
      padding-right: 6px;
      box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
      &:disabled {
        background: #888;
        box-shadow: none;
        color: #aaa;
        cursor: default;
      }
      i.close::before {
        font-size: 14px;
      }
    }
  }

  .overlay {
    position: absolute;
    padding: 0 !important;
    &.crop {
      .handle {
        box-shadow: 0px 0 0 1000px rgba(0, 0, 0, 0.3);
      }
    }
    .corner {
      background: #ddd;
      height: 25px;
      width: 25px;
      transition: 250ms ease;
      position: absolute;
      z-index: 1;

      &.nw {
        border-bottom-right-radius: 16px;
        top: -2px;
        left: -2px;
        cursor: nw-resize;
      }
      &.ne {
        border-bottom-left-radius: 16px;
        top: -2px;
        right: -2px;
        cursor: ne-resize;
      }
      &.sw {
        border-top-right-radius: 16px;
        bottom: -2px;
        left: -2px;
        cursor: sw-resize;
      }
      &.se {
        border-top-left-radius: 16px;
        bottom: -2px;
        right: -2px;
        cursor: se-resize;
      }
    }
    .handle {
      border: 2px dashed #ddd;
      top: 0;
      left: 0;
      box-sizing: border-box;
      position: absolute;
      height: 100%;
      width: 100%;
      opacity: 0;
      transition: border-color 250ms ease, top 200ms ease, left 200ms ease,
        width 200ms ease, height 200ms ease;
      &.show {
        opacity: 1;
      }
    }
  }
}

legend.user-image {
  position: absolute;
  pointer-events: none;
  padding: 0;
  .text {
    position: absolute;
    bottom: 0;
    left: 0;
    animation: slideIn 1 250ms;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    transform-origin: bottom;
    transition: transform 250ms ease;
    padding: 7px;
    width: 100%;
    box-sizing: border-box;
    &.hidden {
      transform: scaleY(0);
    }
  }
}

image-editor {
  .image-loading {
    display: block;
    position: absolute;
    top: calc(50% - 20px);
    left: calc(50% - 20px);
    font-size: 40px;
    z-index: 5;
    color: $primary;
  }
  .save-loading {
    vertical-align: middle;
    line-height: 40px;
    font-size: 20px;
    z-index: 5;
    color: $primary;
    margin-right: 15px;
  }
  .overlay {
    .handle {
      border: 2px dashed $primary;
      &.top {
        border-top-color: $accent;
      }
      &.left {
        border-left-color: $accent;
      }
      &.right {
        border-right-color: $accent;
      }
      &.bottom {
        border-bottom-color: $accent;
      }
      &.top-left {
        border-top-color: $accent;
        border-left-color: $accent;
        .corner.nw {
          background-color: $accent;
        }
      }
      &.top-right {
        border-right-color: $accent;
        border-top-color: $accent;
        .corner.ne {
          background-color: $accent;
        }
      }
      &.bottom-left {
        border-bottom-color: $accent;
        border-left-color: $accent;
        .corner.sw {
          background-color: $accent;
        }
      }
      &.bottom-right {
        border-bottom-color: $accent;
        border-right-color: $accent;
        .corner.se {
          background-color: $accent;
        }
      }
    }
    .corner {
      background: $primary;
      &:hover {
        background: $accent;
      }
    }
  }
}

@media screen and (max-width: $tablette) {
  body image-editor {
    .image-properties {
      margin-top: -50px;
    }
    .image-actions-zone {
      margin-top: 80px;
    }
    .tools-background {
      display: none !important;
    }
    .output {
      width: 100% !important;
    }
    .tools {
      width: 100%;
      float: left;
      top: -90px;
      background: #ddd;
      button {
        width: auto;
        padding-left: 15px;
        padding-right: 15px;
        margin-right: 10px;
        float: right;
      }
    }
  }
}
