@import "../bower_components/components-font-awesome/less/font-awesome.less";
@import "colors.less";
@import "animations.less";
@import "wordlift-functions.less";
@import "wordlift-carousel.less";
@import "wordlift-card.less";
@import "wordlift-label.less";
@import "wordlift-dashboard-widget.less";
/** Importing new brand identity. */
@import "wordlift-widget-be.less";

.wl-button {
  background-color: @wl-brand-color !important;
  text-transform: none;
  display: inline-block;
  text-decoration: none;
  color: @wl-btn-txt-color !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  position: relative;

  &.wl-button-disabled {
    cursor: default !important;
    background-color: fade(@wl-brand-color, 30%) !important;

    &:active {
      pointer-events: none;
    }
  }

  .wl-tooltip {
    visibility: hidden;
    background-color: black;
    color: #fff;
    text-align: center;
    border-radius: 2px;
    padding: 5px 10px;
    opacity: 1;
    left: 0;
    top: 110%;

    /* Position the tooltip */
    position: absolute;
    z-index: 1;
  }

  &:hover .wl-tooltip {
    visibility: visible;
  }
}

/*.button.wl-button {
    border: 1px solid #c70056;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    text-decoration: none;
    display: inline-block;
    color: #fff;
    background-color: #FF006E;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#FF006E), to(#ef007c));
    background-image: -webkit-linear-gradient(top, #FF006E, #ef007c);
    background-image: -moz-linear-gradient(top, #FF006E, #ef007c);
    background-image: -ms-linear-gradient(top, #FF006E, #ef007c);
    background-image: -o-linear-gradient(top, #FF006E, #ef007c);
    background-image: linear-gradient(to bottom, #FF006E, #ef007c);
    filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#FF006E, endColorstr=#ef007c);
    box-shadow: none;
    text-shadow: none;
    font-weight: normal;
}

.button.wl-button:hover {
    color: #fff;
    border: 1px solid #990042;
    background-color: #cc0058;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#cc0058), to(#bc0062));
    background-image: -webkit-linear-gradient(top, #cc0058, #bc0062);
    background-image: -moz-linear-gradient(top, #cc0058, #bc0062);
    background-image: -ms-linear-gradient(top, #cc0058, #bc0062);
    background-image: -o-linear-gradient(top, #cc0058, #bc0062);
    background-image: linear-gradient(to bottom, #cc0058, #bc0062);
    filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#cc0058, endColorstr=#bc0062);
    box-shadow: none;
}*/

.wl-suggestion {
  border-left: @wl-brand-color 4px solid;
}

.mce-wl-button button {
  background: data-uri("../images/svg/wl-logo-icon.svg") 6px 3px no-repeat !important;
  padding-left: 28px !important;
  height: 20px;
}

.wl-entity-input-boxes,
.wl-entity-props {
  display: none;
}

// TinyMCE toolbar

.mceIcon.mce_wordlift,
.mce-widget.mce-btn.mce-wordlift button {
  background-position: center center;
  background-repeat: no-repeat;

  &:before {
    content: @fa-var-pencil;
  }

  &:hover {
    color: rgb(0, 0, 0) !important;
  }
  color: @wl-brand-color !important;
  font-size: 14px !important;
  font-family: FontAwesome !important;
  font-style: normal;
  font-weight: normal;
  line-height: 18px !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

// Set a tile color background, foreground and icons.
.tile(@color, @icon) {
  border-color: @color;
  color: #444;

  .type {
    text-align: center;

    &:before {
      content: @icon;
      color: @color;
    }
  }

  .more {
    &:before {
      content: @icon;
    }
  }

  &.selected {
    background-color: @color;
    color: contrast(@color);
  }

  .thumbnail {
    background-color: @color;
    color: contrast(@color);
  }
}

.entity {
  background: white;
  padding: 0;
  margin: 0.2em 0;
  font-size: 0.9em;
  position: relative;

  .entity-header {
    position: relative;

    .wl-progress-background {
      position: absolute;
      top: 5px;
      right: 20px;
      width: 50px;
      height: 6px;
      background-color: #e2e2e2;
      padding: 0;

      .wl-progress-current {
        height: 6px;
        background-color: @wl-brand-color;
      }
    }
  }

  .wl-internal {
    color: @wl-brand-color;
    font-size: 1.1em;
    line-height: 1.5em;
  }

  .label,
  i {
    cursor: pointer;
  }

  .details {
    margin: 0;
    padding: 0;
    color: #999;

    p {
      margin: 5px 0;
      font-size: inherit;
      cursor: pointer;
      max-height: 200px;
      overflow-y: auto;
    }

    img {
      width: 100%;
      height: auto;
    }
  }

  .type {
    font-family: FontAwesome;
    font-style: normal;
    font-weight: normal;
    line-height: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
    padding: 4px;
  }

  &.wl-creative-work {
    .tile(@wl-creative-work-color, @fa-var-lightbulb-o);
  }

  &.wl-event {
    .tile(@wl-event-color, @fa-var-calendar);
  }

  &.wl-organization {
    .tile(@wl-organization-color, @fa-var-building-o);
  }

  &.wl-local-business {
    .tile(@wl-organization-color, @fa-var-building-o);
  }

  &.wl-person {
    .tile(@wl-person-color, @fa-var-user);
  }

  &.wl-place {
    .tile(@wl-place-color, @fa-var-map-marker);
  }

  &.wl-thing {
    .tile(@wl-thing-color, @fa-var-file-o);
  }
}

#wordlift-edit-post-wrapper {
  .clear {
    clear: both;
    height: 1px;
  }

  input,
  select,
  textarea {
    width: 100%;
    font-size: inherit;
  }

  .wl-widget-headline {
    .wl-spinner {
      position: absolute;
      right: 30px;
      top: 10px;
      background: url("/wp-admin/images/spinner.gif") no-repeat;
      background-size: 16px 16px;
      opacity: 0.7;
      filter: alpha(opacity=70);
      width: 16px;
      height: 16px;
    }

    .wl-more {
      .fa-icon(@fa-var-caret-square-o-down);
      color: #aaa;
      position: absolute;
      right: 10px;
      top: 11px;
    }

    .wl-less {
      .fa-icon(@fa-var-caret-square-o-up);
      color: #aaa;
      position: absolute;
      right: 10px;
      top: 11px;
    }
  }

  .wl-widget-sub-headline {
    font-size: 1.04em;
    line-height: 1.04em;
    font-weight: 700;
    padding: 5px 0;
    text-transform: uppercase;
    border-bottom: #eee 1px solid;
    margin: 0 0 4px;
    position: relative;

    small {
      position: absolute;
      right: 0;
      top: 5px;
      padding: 0 4px;
      color: #888;
      font-size: 0.7em;
      text-transform: uppercase;
      border-left: #ccc 2px solid;
    }
  }

  .wl-carousel-item {
    padding: 0;
  }

  #wl-add-entity-button-wrapper {
    padding: 4px 0 0;
    text-align: right;
  }

  .wl-annotation-label {
    border-bottom: #ccc 1px solid;
    margin: 0;
    padding: 4px;
    position: relative;

    .wl-annotation-label-icon {
      .fa-icon(@fa-var-pencil);
      font-family: FontAwesome;
      font-style: normal;
      font-weight: normal;
      line-height: 14px;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      font-size: 14px;
      padding: 4px 0;
    }

    .wl-annotation-label-remove-icon {
      .fa-icon(@fa-var-times);
      position: absolute;
      right: 0;
      bottom: 0;
      margin: 0 0 6px;
    }

    small {
      font-weight: normal;
    }
  }

  .classification-box {
    position: relative;

    .box-widgets {
      color: #555;
      border: #ccc 1px solid;
      padding: 0;
      margin: 0 0 10px;

      img {
        cursor: pointer;
        width: 45%;
        height: auto;
        margin: 3px;
      }
    }

    .box-tiles {
      margin-top: 3px;
      border-top: #eee 1px solid;
    }

    .box-header {
      font-size: 0.8em;
      text-transform: capitalize;

      h5 {
        .button {
          display: -webkit-flex;
          display: -moz-flex;
          display: -ms-flex;
          display: -o-flex;
          display: flex;
          justify-content: center;
          align-items: center;
          padding: 2px !important;
          color: @wl-btn-txt-color;
          background-color: desaturate(@wl-brand-color, 100%);
          text-transform: none;
          cursor: not-allowed;
          line-height: 20px;
          height: 22px;
          width: 22px;
          text-align: center;
          font-weight: 700;
          font-size: 11px;
          margin-top: -1px;
          float: right;
          border-radius: 50%;

          &.selected {
            cursor: pointer;
            color: #fff;
            background-color: @wl-brand-color;
          }
        }
      }

      .label {
        position: relative;
        text-transform: capitalize;
        font-weight: bold;
        padding: 5px 0;
        margin: 0;
        line-height: 1.3em;
        font-size: 1.3em;
      }

      .wl-widget-label {
        position: relative;
        text-transform: capitalize;
        font-weight: normal;
        font-size: inherit;
        padding: 0 2px 0 6px;
        background-color: #f7f7f7;
        border-bottom: #ccc 1px solid;
        color: #555;

        .wl-deselect-widget {
          position: absolute;
          top: 3px;
          right: 3px;
          .fa-icon(@fa-var-times);
          font-size: inherit;
          color: #aaa;

          &:hover {
            color: @wp-cta-remove-color;
          }
        }
      }

      .wl-suggestion-tools {
        margin-left: 4px;
        padding: 4px 0 2px 2px;
        border-left: #ccc 1px solid;

        .wl-widget-icon {
          // font-family: FontAwesome;

          &.wl-ImageSuggestor {
            color: @wp-cta-color;
            .fa-icon(@fa-var-picture-o);
          }
          &.wl-ArticleSuggestor {
            color: @wp-cta-color;
            .fa-icon(@fa-var-list);
          }
        }
      }
    }
  }

  .wl-entity-form {
    margin: 0;
    padding: 0;

    div {
      margin-top: 2px;
    }

    .wl-required {
      &:after {
        content: " *";
      }
    }

    .wl-fields-wrapper {
      padding: 10px;
    }

    .wl-suggested-sameas-wrapper {
      margin-top: 5px;
      padding: 3px 10px;
      background-color: #f7f7f7;

      h5 {
        text-transform: uppercase;
        margin: 0;
        padding: 0.2em 0;
      }

      .wl-sameas {
        font-size: 0.75em;
        margin: 2px 0;
        cursor: pointer;
        line-height: 12px;
        border-left: #ccc 12px solid;
        padding-left: 5px;
        text-transform: none;

        &.active {
          border-left: @wp-cta-color 12px solid;
        }
      }
    }

    .wl-buttons-wrapper {
      margin-top: 6px;
      padding: 4px 0;
      border-top: 2px solid #ddd;
      text-align: right;

      .button {
        line-height: 20px;
        height: 22px;
        font-size: 11px;
        margin-left: 2px;

        .wl-link {
          .fa-icon(@fa-var-external-link);
          font-size: 10px;
          padding: 0 0 0 4px;
        }
      }
    }

    label {
      display: block;
      margin: 0 0 3px;
    }

    .wl-entity-id {
      background-color: #e2e2e2;
      color: #999;
      padding: 2px 6px;
      font-size: 0.8em;
    }
  }

  .wl-cta-location {
    cursor: pointer;
    color: #999;
    border-bottom: @wl-place-color 1px dotted;
    padding: 2px;
  }

  .wl-edit {
    .fa-icon(@fa-var-pencil);
    color: #aaa;

    &.active {
      color: @wp-cta-color;
    }
  }

  .wl-disabled {
    color: #888 !important;
    cursor: not-allowed;
  }

  .wl-toggle-on {
    color: #444;
    .fa-icon(@fa-var-check-circle-o);
  }

  .wl-toggle-off {
    color: #888;
    .fa-icon(@fa-var-circle-o);
  }

  .wl-more {
    .fa-icon(@fa-var-caret-down);
    color: #aaa;
    position: absolute;
    right: 0;
    top: 0;
  }

  .wl-less {
    .fa-icon(@fa-var-caret-up);
    color: #aaa;
    position: absolute;
    right: 0;
    top: 0;
  }
}

div.wp-menu-image:before #adminmenu .toplevel_page_wordlift-admin-entities,
#adminmenu #menu-posts-entity .menu-icon-entity {
  div.wp-menu-image {
    &:before {
      color: @wl-brand-color;
    }
  }

  &.current div.wp-menu-image,
  &.wp-menu-open div.wp-menu-image {
    &:before {
      color: #fff;
    }
  }
}

#wordlift-disambiguation-popover {
  display: none;
  position: fixed;
  top: 50px;
  right: 20px;

  .postbox {
    border-color: #bbb;
    box-shadow: 0 0 10em #666;
    height: 100%;
    margin-bottom: 0;

    &:before {
      content: " ";
      position: absolute;
      width: 0;
      height: 0;
      left: -50px;
      top: 50px;
      border: 25px solid;
      border-color: transparent #bbb transparent transparent;
    }

    &:after {
      content: " ";
      position: absolute;
      width: 0;
      height: 0;
      left: -49px;
      top: 50px;
      border: 25px solid;
      border-color: transparent #fff transparent transparent;
    }
  }

  .handlediv:before {
    content: "\f158";
    right: 12px;
    font: 400 20px/1 dashicons;
    speak: none;
    display: inline-block;
    padding: 8px 10px;
    top: 0;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-decoration: none !important;
  }

  .arrow-left {
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid blue;
  }
}

//body#tinymce {
//  font-family: "Open Sans", sans-serif;
//  font-size: 0.9em;
//  line-height: 1.4em;
//
//  .annotation_(@type, @icon, @hover-color) {
//    border-color: @type;
//  }
//
//  .rounded-corners (@radius: 5px) {
//    -webkit-border-radius: @radius;
//    -moz-border-radius: @radius;
//    -ms-border-radius: @radius;
//    -o-border-radius: @radius;
//    border-radius: @radius;
//  }
//
//  .highlight(@color) {
//    border: 0 !important;
//    color: contrast(@color);
//    background-color: @color;
//    vertical-align: center;
//  }
//
//  .disambiguate(@color) {
//    border-color: @color !important;
//  }
//
//  .textannotation {
//    //border-bottom: #999 2px solid;
//    //padding: 2px 0;
//    //cursor: pointer;
//    //cursor: hand;
//
//    &.unlinked {
//      //border: #999 1px dashed;
//      //padding: 2px;
//
//      &.selected {
//        //font-weight: bold;
//        //border: #999 1px dashed !important;
//        //background-color: #fff !important;
//        //color: inherit !important;
//      }
//    }
//
//    &.selected {
//      .highlight(@wl-default-color);
//
//      &.wl-creative-work {
//        .highlight(@wl-creative-work-color)
//      }
//
//      &.wl-event {
//        .highlight(@wl-event-color)
//      }
//
//      &.wl-organization {
//        .highlight(@wl-organization-color)
//      }
//
//      &.wl-local-business {
//        .highlight(@wl-organization-color)
//      }
//
//      &.wl-person {
//        .highlight(@wl-person-color)
//      }
//
//      &.wl-place {
//        .highlight(@wl-place-color)
//      }
//
//      &.wl-thing {
//        .highlight(@wl-thing-color)
//      }
//    }
//
//    &.wl-creative-work {
//      .disambiguate(@wl-creative-work-color)
//    }
//
//    &.wl-event {
//      .disambiguate(@wl-event-color)
//    }
//
//    &.wl-organization {
//      .disambiguate(@wl-organization-color)
//    }
//
//    &.wl-local-business {
//      .disambiguate(@wl-organization-color)
//    }
//
//    &.wl-person {
//      .disambiguate(@wl-person-color)
//    }
//
//    &.wl-place {
//      .disambiguate(@wl-place-color)
//    }
//
//    &.wl-thing {
//      .disambiguate(@wl-thing-color)
//    }
//  }
//
//  &[contenteditable=false] {
//    background-color: rgb(241, 241, 241);
//  }
//}

/* metaboxes */
.wl-metabox {
  border-left: 2px solid @wl-brand-color;

  .hndle span::before {
    content: "WordLift - ";
  }
}

.wl-input-notice {
  color: darkred;
  font-size: 10px;
}

// btn restyling
.wl-add-entity-button {
  display: -webkit-flex;
  display: -moz-flex;
  display: -ms-flex;
  display: -o-flex;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px !important;
  color: @wl-btn-txt-color;
  background-color: desaturate(@wl-brand-color, 100%);
  text-transform: none;
  cursor: not-allowed;
  line-height: 20px;
  height: 22px;
  width: 22px;
  text-align: center;
  font-weight: 700;
  font-size: 11px;
  margin-top: -1px;
  float: right;
  border-radius: 50%;
}

// svg new logo styles

svg.wl-logo-svg {
  transform: translateY(2px);
  margin-right: 10px;

  &.wl-logo-16 {
    width: 16px;
    height: 16px;
  }

  .wl-logo-circle {
    fill: @wl-brand-color;
  }

  .wl-logo-letter {
    fill: #ffffff;
  }
}

// We now show the entity types tabs, since we allow multiple selections.
//
// @see https://github.com/insideout10/wordlift-plugin/issues/835
// @since 3.2.0
//
//#wl_entity_type-tabs {
//  .hide-if-no-js {
//    display: none;
//  }
//}
