// Sprite Function
.stitches-sprite(@x: 0, @y: 0, @width: 0, @height: 0) {
  background-position: @x @y;
  width: @width;
  height: @height;
}
// Clearfix
.clearfix {
  *zoom: 1;
  &:before,
  &:after {
    display: table;
    content: '';
    line-height: 0;
  }
  &:after {
    clear: both;
  }
}
// Drop shadows
.box-shadow(@shadow) {
  -webkit-box-shadow: @shadow !important;
  -moz-box-shadow: @shadow !important;
  box-shadow: @shadow !important;
}
@tdc_font_color: #000;

// Font family
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600,700');
@font1:'Open Sans', sans-serif;

// global font
#tdc-sidebar {
  font-family: @font1;
}
input, select, textarea {
  font-size: 12px;
}


// wp-admin css

.tdc-panel-button {
  display: inline-block;
  position: relative;
  margin-left: 8px;
}

.tdc-panel-button,
.edit_tdc_composer,
#wp-admin-bar-tdc_edit {

  /* hide under landscape tablet dimension */
  @media (max-width: 767px) {
    display: none;
  }
}

.tdc-panel-icon {
  position: absolute;
  left: 0;
  top:0;
  box-sizing: border-box;
  width: 37px;
  height: 36px;
  border-radius: 4px 0 0 4px;
  background: url('../images/sidebar/logo-symbol.png');
  background-repeat: no-repeat;
  background-color: #4db2ec;
  background-position: center;
  //border-right: 1px solid #38aaec;
}

.tdc-panel-link {
  box-sizing: border-box;
  background-color: #4db2ec;
  width: 128px;
  height: 36px;
  cursor: pointer;
  margin-left: 37px;
  border-radius: 0 4px 4px 0;
  transition: all 0.4s ease;
  text-align: center;

  border-left: 1px solid #72b9e2;

  &:hover {
    background-color: #449edd;
  }

  a {
    text-decoration: none;
    text-transform: uppercase;
    color: #fff;
    font-size: 11px;
    line-height: 35px;
    display: block;
    width: 100%;
    height: 100%;
  }
}



/*
  Open editor loader
*/
.tdc-open-editor-loader {
  .tdc-panel-icon {
    background-position: 10px 9px !important;
    background: #4db2ec url("../images/loader-small-blue.gif") no-repeat;

  }
}



/*


    CSS Design tab from TD Composer - this work in wp-admin (widget area and also in td-composer sidebar)


*/
/*
  responsive buttons
*/
.tdc-responsive-buttons {
  width: 270px;
  height: 28px;
  border: 1px solid #ddd;
  margin-bottom: 15px;

  .selected {
    background-color: #e8e8e8;
  }

  .tdc-responsive-all {
    width: 67px;
    height: 28px;
    position: relative;
    display: inline-block;
    cursor: pointer;

    .tdc-all-icon {
      background: url('../images/sidebar/spritesheet.png');
      background-repeat: no-repeat;
      position: absolute;
      top: 5px;
      left: 0;
      right: 0;
      margin: 0 auto;
      .stitches-sprite(-5px, -65px, 20px, 20px);
    }

    &:active {
      background-color: #4eb2ec;

      .tdc-all-icon {
        background: url('../images/sidebar/spritesheet.png');
        .stitches-sprite(-35px, -65px, 20px, 20px);
      }
    }
  }

  .tdc-responsive-tablet-landscape {
    width: 67px;
    height: 28px;
    position: relative;
    display: inline-block;
    border-left: 1px solid #ddd;
    cursor: pointer;

    .tdc-tablet-landscape-icon {
      background: url('../images/sidebar/spritesheet.png');
      background-repeat: no-repeat;
      position: absolute;
      top: 4px;
      left: -1px;
      right: 0;
      margin: 0 auto;
      .stitches-sprite(-137px, -65px, 20px, 20px);
    }

    &:active {
      background-color: #4eb2ec;

      .tdc-tablet-landscape-icon {
        .stitches-sprite(-5px, -95px, 20px, 20px);
      }
    }
  }

  .tdc-responsive-tablet-portrait {
    width: 67px;
    height: 28px;
    position: relative;
    display: inline-block;
    border-left: 1px solid #ddd;
    cursor: pointer;

    .tdc-tablet-portrait-icon {
      background: url('../images/sidebar/spritesheet.png');
      background-repeat: no-repeat;
      position: absolute;
      top: 4px;
      left: -1px;
      right: 0;
      margin: 0 auto;
      .stitches-sprite(-35px, -95px, 20px, 20px);
    }

    &:active {
      background-color: #4eb2ec;

      .tdc-tablet-portrait-icon {
        .stitches-sprite(-125px, -95px, 20px, 20px);
      }
    }
  }

  .tdc-responsive-phone {
    width: 66px;
    height: 28px;
    position: relative;
    display: inline-block;
    border-left: 1px solid #ddd;
    cursor: pointer;

    .tdc-phone-icon {
      background: url('../images/sidebar/spritesheet.png');
      background-repeat: no-repeat;
      position: absolute;
      top: 4px;
      left: -2px;
      right: 0;
      margin: 0 auto;
      .stitches-sprite(-65px, -89px, 20px, 20px);
    }

    &:active {
      background-color: #4eb2ec;

      .tdc-phone-icon {
        .stitches-sprite(-95px, -89px, 20px, 20px);
      }
    }
  }
}

/*
  Properties
*/
.tdc-property-wrap {
  position: relative;
}

.tdc-property-title {
  font-size: 12px;
  color: @tdc_font_color;
  margin-bottom: 4px;

  span[title] {
    cursor: pointer;
    position: relative;
  }
}

/*
  css box editor
*/
.tdc-property-tdc_css {

  .tdc-css-box-input {
    width: 32px;
    height: 21px;
    font-size: 11px;
    text-align: center;
    z-index: 1;
  }

  .tdc-box-margin {
    border: 1px solid #ddd;
    position: relative;
    width: 270px;
    height: 220px;
    margin-bottom: 18px;

    .tdc-margin-label {
      position: absolute;
      top: 0;
      left: 4px;
      font-size: 10px;
      color: #888
    }
  }

  .tdc-box-border {
    border: 1px dashed #ddd;
    background-color: #f7f7f7;
    position: relative;
    width: 152px;
    height: 136px;
    left: 58px;
    top: 41px;

    .tdc-border-label {
      position: absolute;
      bottom: -18px;
      right: -2px;
      font-size: 10px;
      color: #888
    }
  }

  .tdc-box-padding {
    border: 1px dashed #ddd;
    background-color: #fff;
    position: relative;
    width: 130px;
    height: 114px;
    left: 10px;
    top: 10px;

    .tdc-padding-label {
      position: absolute;
      top: 0;
      left: 4px;
      font-size: 10px;
      color: #888
    }
  }

  /*
    top boxes
  */
  .tdc-css-box-input-margin-top {
    position: absolute;
    top: 7px;
    left: 0;
    right: 0;
    margin: 0 auto;
  }

  .tdc-css-box-input-border-top-width {
    position: absolute;
    top: -6px;
    left: 0;
    right: 0;
    margin: auto;
  }

  .tdc-css-box-input-padding-top {
    position: absolute;
    top: 12px;
    left: 0;
    right: 0;
    margin: auto;
  }

  /*
    right boxes
  */
  .tdc-css-box-input-margin-right {
    position: absolute;
    margin-top: -11px;
    top: 50%;
    right: 7px;
  }

  .tdc-css-box-input-border-right-width {
    position: absolute;
    margin-top: -11px;
    top: 50%;
    right: -12px;
  }

  .tdc-css-box-input-padding-right {
    position: absolute;
    margin-top: -11px;
    top: 50%;
    right: 17px;
  }

  /*
    bottom boxes
  */
  .tdc-css-box-input-margin-bottom {
    position: absolute;
    bottom: 7px;
    left: 0;
    right: 0;
    margin: 0 auto;
  }

  .tdc-css-box-input-border-bottom-width {
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    margin: 0 auto;
  }

  .tdc-css-box-input-padding-bottom {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    margin: 0 auto;
  }

  /*
    left boxes
  */
  .tdc-css-box-input-margin-left {
    position: absolute;
    margin-top: -11px;
    top: 50%;
    left: 7px;
  }

  .tdc-css-box-input-border-left-width {
    position: absolute;
    margin-top: -11px;
    top: 50%;
    left: -12px;
  }

  .tdc-css-box-input-padding-left {
    position: absolute;
    margin-top: -11px;
    top: 50%;
    left: 17px;
  }
}

/*
  color picker
*/
.tdc-property-colorpicker {
  position: relative;
  margin-bottom: 10px;

  .tdc-property-title {
    margin-bottom: 1px;
    margin-top: -1px;
    line-height: 27px;
  }

  .tdc-property {
    .clearfix();
  }

  .tdc-property .wp-picker-container {
    float: left;

    .wp-color-result {
      .box-shadow(none);
      height: 25px;
      width: 25px;
      padding: 0;
      margin: 0;
      border: 1px solid #ddd;
      position: absolute;
      top: 1px;
      right: 0;

      &:after {
        display: none;
      }
    }

    .wp-picker-input-wrap {
      margin-top: 8px;
      margin-bottom: 2px;
    }

    .button {
      font-size: 11px;
      color: #000 !important;
      border: 1px solid #ddd !important;
      background-color: #fff !important;
      padding: 0 10px !important;
      height: 27px !important;
    }

    input.wp-color-picker[type="text"] {
      height: 27px !important;
      width: 218px !important;
    }

    .iris-picker {
      border-bottom: none;
      margin: 6px 0 0 0;
      width: 271px !important;

      .iris-square {
        width: 76%;
        margin-right: 31px;
        position: relative;
        top: 10px;
        left: 10px;
      }

      .iris-strip {
        top: 10px;
      }

      .iris-palette-container {
        left: 20px;
        bottom: -15px;
      }
    }

    .cs-alpha-wrap {
      position: static;
      width: 231px;
      padding: 30px 20px 20px;
      margin-bottom: 0;

      .cs-alpha-text {
        top: auto;
        right: 20px;
        bottom: 20px;
      }
    }
  }
}

.tdc-tabs-wrapper { // general tab container
  //input and select general settings
  input,
  select {
    .box-shadow(none);
    font-size: 12px;
    margin: 0;
  }
  input[type=radio],
  input[type=checkbox] {
    border-color: #ddd;
  }
}

/*
  vertical spacing & textfield & dropdown
*/

//textfield
.tdc-property-textfield {
  margin-bottom: 14px;

  input[type=text] {
    width: 100%;
    padding: 4px 8px;
  }
}

.tdc-tab-content-wrap { // specific for TD composer
  .tdc-textfield-extrabig {
    margin-bottom: 10px;
    line-height: 27px;
    height: 27px;
    width: 100%;
    display: table;

    .tdc-property-title {
      margin-bottom: 0;
      padding-right: 185px;
      line-height: 15px;
      display: table-cell;
      vertical-align: middle;
    }

    .tdc-property {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      margin: auto 0;
      display: table;

      input[type=text] {
        width: 180px;
        font-size: 12px;
        padding: 4px 6px;
      }
    }
  }

  .tdc-textfield-big {
    margin-bottom: 10px;
    line-height: 27px;
    height: 27px;
    width: 100%;
    display: table;

    .tdc-property-title {
      margin-bottom: 0;
      padding-right: 135px;
      line-height: 15px;
      display: table-cell;
      vertical-align: middle;
    }

    .tdc-property {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      margin: auto 0;
      display: table;

      input[type=text] {
        width: 130px;
        font-size: 12px;
        padding: 4px 6px;
      }
    }
  }

  .tdc-textfield-small {
    margin-bottom: 10px;
    line-height: 27px;
    height: 27px;
    width: 100%;
    display: table;

    .tdc-property-title {
      margin-bottom: 0;
      padding-right: 60px;
      line-height: 15px;
      display: table-cell;
      vertical-align: middle;
    }

    .tdc-property {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      margin: auto 0;
      display: table;

      input[type=text] {
        width: 50px;
        font-size: 12px;
        padding: 4px 6px;
        text-align: right;
      }
    }
  }

  //dropdown
  .tdc-property-dropdown {
    margin-bottom: 14px;

    select {
      width: 100%;
      height: 27px;
      padding: 0 2px;
    }
  }

  .tdc-dropdown-extrabig {
    margin-bottom: 10px;
    line-height: 27px;
    height: 27px;
    width: 100%;
    display: table;

    .tdc-property-title {
      margin-bottom: 0;
      padding-right: 185px;
      line-height: 15px;
      display: table-cell;
      vertical-align: middle;
    }

    select {
      width: 180px;
      height: 27px;
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      margin: auto 0;
      display: table;
    }
  }

  .tdc-dropdown-big {
    margin-bottom: 10px;
    line-height: 27px;
    height: 27px;
    width: 100%;
    display: table;

    .tdc-property-title {
      margin-bottom: 0;
      padding-right: 135px;
      line-height: 15px;
      display: table-cell;
      vertical-align: middle;
    }

    select {
      width: 130px;
      height: 27px;
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      margin: auto 0;
      display: table;
    }
  }

  .tdc-dropdown-small {
    margin-bottom: 10px;
    line-height: 27px;
    height: 27px;
    width: 100%;
    display: table;

    .tdc-property-title {
      margin-bottom: 0;
      padding-right: 60px;
      line-height: 15px;
      display: table-cell;
      vertical-align: middle;
    }

    select {
      width: 50px;
      height: 27px;
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      margin: auto 0;
      display: table;
    }
  }

  //social counter youtube
  .tdc-property-youtube {

    .tdc-property-title {
      position: absolute;
      top: 5px;
    }

    .tdc-property {
      position: relative;

      input {
        float: right;
      }

      .tdc-description {
        clear: right;
        line-height: 17px;
        display: inline-block;
        text-align: right;
        margin: 10px 0 0 0;
      }
    }

  }
}

#td-tab-css,
#td-tab-design-options {
  input[type=text] {
    z-index: 1;
  }

  .tdc-border-style,
  .tdc-bg-style {
    margin-bottom: 10px;
  }
}

// particular cases
.tdc-property-installed_post_types,
.tdc-property-custom_url,
.tdc-property-w_location,
.tdc-property-e_custom_rates,
.tdc-property-content,
.tdc-property-offset,
.tdc-property-include,
.tdc-property-playlist_yt,
.tdc-property-playlist_v,
.tdc-property-td_grid_style {
  margin-bottom: 10px !important;
}

.tdc-border-radius,
.tdc-border-style,
.tdc-property-sort,
.tdc-bg-style,
.tdc-property-limit,
.tdc-property-style {
  position: relative;
}

// checkbox
.tdc-property-checkbox {
  margin-bottom: 10px;
  height: 27px;
  width: 100%;
  display: table;

  .tdc-property-title {
    margin-bottom: 0;
    padding-right: 26px;
    line-height: 15px;
    display: table-cell;
    vertical-align: middle;
  }

  .tdc-property {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    margin: auto 0;
    display: table;
    line-height: 1;

    input {
      margin: 0;
    }
  }
}

// bg image
.tdc-property-attach_image {
  margin-bottom: 10px;
  line-height: 27px;

  .tdc-property-title {
    margin-bottom: 0;
  }

  .tdc-image-wrap,
  .tdc-css-image-wrap {
    width: 27px;
    height: 27px;
    cursor: pointer;
    background-size: cover;
    background-position: center center;
  }

  .tdc-property {
    position: absolute;
    top: 0;
    right: 0;
  }

  .tdc-image-remove,
  .tdc-css-image-remove {
    position: absolute;
    top: 0;
    right: 27px;
    font-size: 12px;
    text-decoration: none;
    margin-right: 10px;
  }

  .tdc-css-image-clear {
    position: absolute;
    top: 0;
    right: 77px;
    font-size: 12px;
    text-decoration: none;
    margin-right: 10px;
  }

  .tdc-hidden-button {
    display: none;
  }
}

// separator
.tdc-sidebar-horizontal-separator {
  border-bottom: 1px dashed #eeeeee;
  margin: 20px auto;
}


//column text - edit content button
.tdc-open-wpeditor {
  font-size: 12px;
  text-decoration: none;
  display: inline-block;
}

.tdc-css-inherited {
  &:before {
    content: '';
    position: absolute;
    top: 0;
    left: -14px;
    background-color: #4db2ec;
    opacity: 0.8;
    width: 6px;
    height: 28px;
    display: block;
  }
}
.tdc-css-box-input.tdc-css-inherited {
  background-color: #edf8fd;
}

.tdc-css-inactive {
  pointer-events: none;
  background-color: #fafad2 !important;
}

.tdc-inherit {
  width: 14px;
  height: 14px;
  position: absolute;
  right: -23px;
  top: 2px;
  cursor: pointer;
  background: url(../images/sidebar/spritesheet.png);
  background-repeat: no-repeat;
  background-position: -129px -127px;
  display: none;
}

.tdc-clear-css-properties {
  cursor: pointer;
  color: #0073aa;
  font-size: 12px;
  display: block;
  text-align: center;
  margin-top: -10px;

  &:hover {
    color: #4db2ec;
  }
}

// textarea
.tdc-textarea {
  width: 100%;
  height: 300px;
  display: none;
  font-size: 13px;
  line-height: 16px;
  padding: 6px;
  .box-shadow(none);
}

// social counter facebook
.tdc-inspector-wrap {
  .tdc-property-facebook,
  .tdc-property-facebook_access_token {
    margin-bottom: 45px;

    .tdc-property-title a {
      position: absolute;
      top: 100%;
      right: 0;
      margin-top: 9px;
      text-align: right;
      display: block;
    }
  }

  .td_access_token_info {
    background-color: #fff;
    padding: 0 25px;
    display: block;
    position: absolute;
    top: 6px;
    right: 3px;
    z-index: 1;
  }
}

.tdc-description {
  font-size: 11px;
  margin: 5px 5px 0 5px;
  color: #808080;
}


// image radio
.tdc-visual-selector {
  .tdc-property-title {
    margin-bottom: 0;
    line-height: 15px;
    display: table-cell;
    vertical-align: middle;
  }

  .tdc-property {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    margin: auto 0;
    display: table;
  }

  .tdc-property-input-radio {
    display: none;
  }

  label {
    cursor: pointer;
    display: inline-block;
    margin-left: 16px;

    div {
      background: url('../images/sidebar/spritesheet.png');
      background-repeat: no-repeat;
      width: 33px;
      height: 25px;
      opacity: 0.24;

      &:hover {
        opacity: 0.6;
        transition: opacity 0.2s ease;
      }
    }

    .col_11 {
      background-position: -6px -188px;
    }
    .col_12_12 {
      background-position: -178px -188px;
    }
    .col_13_23 {
      background-position: -92px -188px;
    }
    .col_23_13 {
      background-position: -49px -188px;
    }
    .col_13_13_13 {
      background-position: -135px -188px;
    }
  }

  .tdc-property-input-radio:checked + label {
    div {
      opacity: 1;
      transition: none;
    }

    .col_11 {
      background-position: -6px -223px;
    }
    .col_12_12 {
      background-position: -178px -223px;
    }
    .col_13_23 {
      background-position: -92px -223px;
    }
    .col_23_13 {
      background-position: -49px -223px;
    }
    .col_13_13_13 {
      background-position: -135px -223px;
    }
  }
}

// row searator
.tdc-separator-row {
  margin: 22px auto 20px;
}

// composer modals
.tdcComposerLoaded {

  // wrap
  #TB_window {
    background: url('../images/bg-modal.jpg');
    background-size: cover;
    background-position: center;
    .box-shadow(0 0 20px rgba(0, 0, 0, 0.2));
    font-family: @font1;
    overflow: hidden;
    padding: 0;

    &:before {
      content: '';
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0;
      z-index: -1;
      background: rgba(0, 69, 130, 0.8);
      background: -moz-linear-gradient(45deg, rgba(0, 69, 130, 0.8) 0%, rgba(38, 134, 146, 0.8) 100%);
      background: -webkit-gradient(left bottom, right top, color-stop(0%, rgba(0, 69, 130, 0.8)), color-stop(100%, rgba(38, 134, 146, 0.8)));
      background: -webkit-linear-gradient(45deg, rgba(0, 69, 130, 0.8) 0%, rgba(38, 134, 146, 0.8) 100%);
      background: -o-linear-gradient(45deg, rgba(0, 69, 130, 0.8) 0%, rgba(38, 134, 146, 0.8) 100%);
      background: -ms-linear-gradient(45deg, rgba(0, 69, 130, 0.8) 0%, rgba(38, 134, 146, 0.8) 100%);
      background: linear-gradient(45deg, rgba(0, 69, 130, 0.8) 0%, rgba(38, 134, 146, 0.8) 100%);
    }
  }

  // title
  #TB_title {
    border: none !important;
    background: none;
    height: auto;

    #TB_ajaxWindowTitle {
      line-height: 59px;
      padding-left: 18px;
      text-align: center;
      font-size: 14px;
      text-transform: uppercase;
      color: #fff;
      margin-top: 2px;
    }
  }

  // content
  #TB_ajaxContent {
    padding: 36px 15px 40px !important;
    height: auto !important;
    color: #fff;
    text-align: center;

    div {
      font-size: 14px;
      padding: 0 36px;
      line-height: 23px;
    }
  }

  // buttons
  .td-confirm-buttons {
    text-align: center;

    button {
      margin-right: 18px;
      width: auto;
      min-width: 120px;
      height: 50px;
      background-color: #fff;
      padding: 5px 12px 6px;
      margin-top: 34px;
      margin-bottom: 0;
      text-transform: uppercase;
      text-shadow: none;
      font-size: 13px;
      font-weight: 600;
      color: #000;
      .box-shadow(1px 1px 4px 0 rgba(0,0,0,0.2));
      border: 0;
      border-radius: 0;
      outline: none !important;

      &:hover {
        color: #ffffff;
        background-color: #ec4d4d;
      }

      &:last-child {
        margin-right: 0;
      }
    }
  }

  #TB_closeWindowButton {
    margin: 17px !important;

    &:hover {
      background-color: rgba(0, 0, 0, 0.16);
    }
  }

  // close
  .tb-close-icon {
    background: url('../images/sidebar/spritesheet.png');
    background-repeat: no-repeat;
    background-position: 0px -121px;
    width: 29px;
    height: 29px;
    margin: 0 !important;
    outline: none !important;
    .box-shadow(none);

    &:before {
      display: none;
    }
  }
}