//
// Field: Text
//
.csf-field-text{

  input{
    width: 340px;
    max-width: 100%;
  }
}

//
// Field: Textarea
//
.csf-field-textarea{

  textarea{
    width: 100%;
    max-width: 100%;
    min-height: 125px;
  }

  .csf-shortcode-button{
    margin-bottom: 10px;
  }
}

//
// Field: Wysiwyg
//
.csf-field-wysiwyg{

  textarea{
    width: 100%;
    max-width: 100%;
    min-height: 125px;
  }

  .wp-editor-container{
    clear: none;
  }
}

//
// Field: Number
//
.csf-field-number{

  input{
    width: 70px;
  }

  em{
    margin-left: 5px;
    color: #bbb;
  }
}

//
// Field: Select
//
.csf-field-select{

  select{
    max-width: 100%;
  }
}

//
// Field: Typography
//
.csf-field-typography{

  select,
  .chosen-container{
    margin-right: 5px;
  }

  .csf-typo-weight{
    min-width: 90px;
  }
}

//
// Field: Checkbox and Radio
//
.csf-field-checkbox,
.csf-field-radio{

  ul{
    margin: 0;
    padding: 0;
    list-style-type: none;
    overflow-y: auto;
    max-height: 305px;
  }

  .horizontal li{
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 15px;
  }

  input[type="radio"]:checked:before{
    line-height: 10px;
  }
}

//
// Field: Switcher
//
.csf-field-switcher{

  label{
    display: block;
    float: left;
    cursor: pointer;
    position: relative;
    width: 62px;
    height: 26px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    @include border-radius(20px);

    span{
      position: absolute;
      top: 4px;
      left: 4px;
      width: 18px;
      height: 18px;
      background-color: #fff;
      @include border-radius(16px);
      @include transition(left 0.15s ease-out);
    }

    input{
      position: absolute;
      top: 0;
      left: 0;
      opacity: 0;

      &:checked ~ em{
        background: #4fb845;
      }

      &:checked ~ em:before{
        opacity: 0;
      }

      &:checked ~ em:after{
        opacity: 1;
      }

      &:checked ~ span{
        left: 40px;
      }
    }

    em{
      position: relative;
      display: block;
      height: inherit;
      font-size: 11px;
      line-height: 26px;
      font-weight: 500;
      font-style: normal;
      text-transform: uppercase;
      color: #fff;
      background-color: #ed6f6f;
      @include transition(background 0.15s ease-out);
    }

    em:before, em:after{
      position: absolute;
      @include transition(opacity 0.15s ease-out);
    }

    em:before{
      content: attr(data-off);
      right: 14px;
    }

    em:after{
      content: attr(data-on);
      left: 14px;
      opacity: 0;
    }
  }

  .csf-text-desc{
    float: left;
    margin-left: 5px;
    margin-top: 0;
    padding-top: 4px;
  }
}

//
// Field: Image Select
//
.csf-field-image_select{

  label{
    display: inline-block;
    margin: 5px;

    img{
      max-width: 100%;
      vertical-align: bottom;
      background-color: #fff;
      border: 2px solid #eee;
      @include opacity(0.75);
      @include transition(all 0.15s ease-out);
    }
  }

  input{
    display: none;

    &:checked ~ img{
      border-color: #333;
      @include opacity(1);
    }
  }
}

//
// Field: Upload
//
.csf-field-upload{

  input{
    width: 100%;
  }

  .csf-button{
    margin-left: 10px;
  }
}

//
// Field: Background
//
.csf-field-background{

  .csf-field-color_picker{
    position: relative;
    top: 10px;
  }

  .csf-pseudo-field{
    border: 0 !important;
  }

  .csf-button{
    margin-left: 10px;
  }
}

//
// Field: Color Picker
//
.csf-field-color_picker{

  .csf-alpha-wrap{
    display: none;
    position: relative;
    top: -1px;
    width: 235px;
    padding: 9px 10px;
    border: 1px solid #dfdfdf;
    border-top: none;
    background-color: #fff;
  }

  .csf-alpha-slider{
    position: absolute;
    width: 190px;
    margin-left: 2px;
    height: 18px;

    .ui-slider-handle{
      position: absolute;
      top: -3px;
      bottom: -3px;
      z-index: 5;
      border-color: #aaa;
      border-style: solid;
      border-width: 4px 3px;
      width: 10px;
      height: 16px;
      margin: 0 -5px;
      background: none;
      cursor: ew-resize;
      @include opacity(0.9);
      @include border-radius(4px);
      @include box-shadow(0 1px 2px rgba(black, 0.2));

      &:before{
        content: " ";
        position: absolute;
        left: -2px;
        right: -2px;
        top: -3px;
        bottom: -3px;
        border: 2px solid #fff;
        @include border-radius(3px);
      }
    }
  }

  .csf-alpha-slider-offset{
    height: 18px;
    width: 200px;
    background: url(../images/checkerboard.png) repeat-y center left scroll #fff;
    @include box-shadow(0 0 5px rgba(black, 0.4) inset);
    @include border-radius(2px);
  }

  .csf-alpha-text{
    position: absolute;
    top: 12px;
    right: 10px;
    width: 30px;
    font-size: 12px;
    line-height: 12px;
    text-align: center;
    color: #999;
  }
}

//
// Field: Backup
//
.csf-field-backup{
  textarea{
    width: 100%;
    min-height: 200px;
    margin-bottom: 5px;
  }

  small{
    display: inline-block;
    margin: 5px;
  }

  hr{
    margin: 20px 0;
    border: none;
    border-bottom: 1px solid #e5e5e5;
  }
}


//
// Field: Fieldset
//
.csf-field-fieldset{
  .csf-inner{
    border: 1px solid #eee;
    background-color: #fff;
  }

  .csf-field{
    padding: 20px;
  }
}

//
// Field: Group
//
.csf-field-group{

  .csf-field{
    padding: 20px;
  }

  .csf-cloneable-wrapper{
    position: relative;
  }

  .csf-cloneable-item{
    display: none;
    position: relative;
    margin-bottom: 5px;

    h4{
      font-size: 1em;
    }
  }

  .ui-accordion .csf-cloneable-item{
    display: block;
  }

  .csf-cloneable-content{
    border: 1px solid #e5e5e5;
    background: #fff;
  }

  .csf-cloneable-title{
    display: block;
    cursor: pointer;
    position: relative;
    margin: 0;
    padding: 15px 65px 15px 10px;
    min-height: 0;
    font-size: 100%;
    border: 1px solid #e5e5e5;
    background: #fafafa;
    @include transition(border-color 0.15s);

    &:active,
    &:hover,
    &:focus{
      border: 1px solid #bbb;
      background: #fafafa;
      outline: none;
    }
  }

  .csf-cloneable-helper{
    position: absolute;
    top: 12px;
    right: 10px;
    z-index: 1;
    font-size: 14px;
    line-height: 1em;

    .csf-cloneable-clone,
    .csf-cloneable-remove{
      display: inline-block;
      cursor: pointer;
      color: #555;
      padding: 5px;

      &:hover{
        @include opacity(0.5);
      }
    }

    .csf-cloneable-pending{
      color: #fcb000;
      padding: 5px;
      display: none;
    }
  }

  .csf-cloned{
    .csf-cloneable-pending{
      display: inline-block;
    }
  }

  .csf-cloneable-content{
    padding: 0;
    border-top: 0;
  }

  .csf-cloneable-data{
    display: none;
    margin-bottom: 5px;
    padding: 10px 20px;
    color: #a94442;
    border: 1px solid #ebccd1;
    background-color: #f2dede;
  }

  .widget-placeholder{
    margin-bottom: 10px;
    border: 1px dashed #f1c40f;
    background-color: #fffae4;
  }

  .csf-cloneable-header-icon{
    font-size: 14px;
    width: 17px;
    text-align: center;
    color: #aaa;
  }
}

//
// Field: Repeater
//
.csf-field-repeater{

  .csf-field{
    padding: 10px;
  }

  .csf-cloneable-hidden{
    display: none;
  }

  .csf-cloneable-wrapper{

    .csf-cloneable-item{
      display: table;
      width: 100%;
      margin-bottom: 5px;
      border: 1px solid #eee;

      h4{
        font-size: 1em;
      }
    }
  }

  .csf-cloneable-content{
    width: 100%;
    display: table-cell;
    vertical-align: middle;
    background-color: #fff;
  }

  .csf-cloneable-helper{
    width: 100%;
    display: table-cell;
    vertical-align: middle;
    text-align: center;
    font-size: 14px;
    line-height: 1em;
    border-left: 1px solid #eee;
    background-color: #f7f7f7;

    i{
      display: inline-block;
      cursor: pointer;
      color: #555;
      padding: 5px;

      &:hover{
        @include opacity(0.5);
      }
    }
  }

  .csf-cloneable-helper-inner{
    width: 75px;
  }

  .csf-cloneable-data{
    display: none;
    margin-bottom: 5px;
    padding: 10px 20px;
    color: #a94442;
    border: 1px solid #ebccd1;
    background-color: #f2dede;
  }

  .widget-placeholder{
    height: 50px;
    margin-bottom: 3px;
    border: 1px dashed #f1c40f;
    background-color: #fffae4;
  }

  .ui-sortable-helper{
    height: 50px !important;
    overflow: hidden !important;
    border-color: #ccc !important;
    background-color: #eee !important;
    @include opacity(0.5);

    .csf-cloneable-helper,
    .csf-cloneable-content{
      display: none;
    }
  }
}

//
// Field: Help
//
.csf-help{
  cursor: help;
  position: absolute;
  top: 0;
  right: 0;
  padding: 5px;
  font-size: 14px;
  color: #aaa;
}

//
// Field: Heading
//
.csf-field-heading{
  font-size: 1.5em;
  font-weight: bold;
  color: #23282d;
  background-color: #f5f5f5 !important;
}

//
// Field: Subheading
//
.csf-field-subheading{
  font-size: 14px;
  font-weight: bold;
  padding-top: 17px;
  padding-bottom: 17px;
  color: #23282d;
  background-color: #f7f7f7 !important;
}

//
// Field: Notice
//
.csf-field-notice{
  padding: 0 !important;
  border: 0 !important;

  + .csf-field{
    border-top: 0;
  }

  .csf-notice{
    font-size: 12px;
    padding: 17px 30px;
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
  }

  .csf-success{
    color: #3c763d;
    border-color: #d6e9c6;
    background-color: #dff0d8;
  }

  .csf-info{
    color: #31708f;
    border-color: #bce8f1;
    background-color: #d9edf7;
  }

  .csf-warning{
    color: #8a6d3b;
    border-color: #faebcc;
    background-color: #fcf8e3;
  }

  .csf-danger{
    color: #a94442;
    border-color: #ebccd1;
    background-color: #f2dede;
  }

}

//
// Field: Icon
//
.csf-field-icon{

  input{
    display: none;
  }

  .button{
    margin-right: 5px;
  }

  .csf-icon-preview i{
    display: inline-block;
    font-size: 14px;
    width: 30px;
    height: 26px;
    line-height: 26px;
    margin-right: 5px;
    text-align: center;
    vertical-align: top;
    color: #555;
    border: 1px solid #ccc;
    background-color: #f7f7f7;
    @include border-radius(3px);
    @include box-shadow(0 1px 0 rgba(black, 0.08));
  }
}

//
// Field: Image
//
.csf-field-image{

  input{
    display: none;
  }
}

//
// Field: Gallery
//
.csf-field-gallery{

  input{
    display: none;
  }

  ul{
    margin: 0;
    padding: 0;
    list-style-type: none;

    li{
      display: inline-block;
      position: relative;
      padding: 4px;
      margin: 0 5px 10px 0;
      border: 1px solid #ccc;
      background-color: #f9f9f9;
      @include border-radius(2px);
      @include box-shadow(0 1px 0 rgba(black, 0.08));

      img{
        max-height: 60px;
        display: inline-block;
        vertical-align: middle;
      }
    }
  }

  .button{
    margin-right: 5px;
    margin-bottom: 5px;
  }
}

//
// Field: Sorter
//
.csf-field-sorter{

  .ui-sortable-placeholder{
    height: 20px;
    border: 1px dashed #f1c40f;
    background-color: #fffae4;
  }

  .csf-modules{
    float: left;
    width: 50%;
  }

  .csf-disabled{
    margin-left: 15px;
  }

  .csf-disabled,
  .csf-enabled{
    padding: 5px 15px;
    border: 1px dashed #ddd;
    background-color: #fff;
  }

  .csf-disabled{
    li{
      @include transition(opacity 0.15s);
      @include opacity(0.5);
    }

    .ui-sortable-helper{
      @include opacity(1);
    }
  }

  .csf-sorter-title{
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin: 0 0 10px 0;
    text-align: center;
  }

  ul{
    list-style-type: none;
    margin: 0;
    padding: 0;
    min-height: 62px;

    li{
      margin: 10px 0;
      padding: 10px 15px;
      cursor: move;
      font-weight: bold;
      text-align: center;
      border: 1px solid #e5e5e5;
      background-color: #fafafa;
      @include transition(border-color 0.15s);

      &:hover{
        border-color: #bbb;
      }
    }
  }
}

//
// Field: Ace Editor
//
.csf-field-ace_editor{

  .csf-ace-editor-wrapper{
    border: 1px solid #eee;
    background-color: #eee;
  }

  .csf-ace-editor{
    width: 100%;
    height: 400px;
    font-size: 13px;
  }

}


//
// Field: Datepicker
//
.csf-datepicker-wrapper{

  * {
    float: none;
    margin: 0;
    padding: 0;
    font-family: inherit;
    font-weight: normal;
    font-style: normal;
    text-decoration: none;
    border: none;
    background: none;
    @include box-shadow(none);
    @include border-radius(none);
  }

  .ui-datepicker{
    margin-top: 5px;
    width: auto;
    background-color: #fff;
    z-index: 9999999 !important;
    @include box-shadow(0 0 30px rgba(black, 0.15));
  }

  .ui-widget-header,
  .ui-datepicker-header{
    color: #fff;
    background: #00a0d2;
  }

  .ui-datepicker-header .ui-state-hover{
    cursor: pointer;
  }

  .ui-datepicker-title{
    font-size: 14px;
    line-height: 40px;
    text-align: center;
  }

  .ui-datepicker-prev,
  .ui-datepicker-next{
    position: static;
    top: auto;
    left: auto;
    right: auto;
    font-family: "FontAwesome";
    font-size: 12px;
    text-align: center;
    width: 41px;
    height: 40px;
    line-height: 40px;
    color: #fff;
    background-color: rgba(white, 0.1);
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .ui-datepicker-next span,
  .ui-datepicker-prev span{
    display: none;
  }

  .ui-datepicker-prev{
    float: left;
  }

  .ui-datepicker-next{
    float: right;
  }

  .ui-datepicker-prev:before{
    content: '\f053';
  }

  .ui-datepicker-next:before{
    content: '\f054';
  }

  .ui-datepicker-prev-hover,
  .ui-datepicker-next-hover{
    opacity: 0.75;
  }

  tbody .ui-datepicker-week-col{
    background-color: #f7f7f7;
  }

  .ui-datepicker-buttonpane{
    padding: 10px;
    text-align: center;
    background-color: #f7f7f7;
  }

  .ui-datepicker-buttonpane button{
    cursor: pointer;
    margin: 0 5px;
    padding: 7px 14px;
    border: 1px solid #eee;
    background-color: #fff;
  }

  select{
    margin: 0 4px;
    color: #fff;
    border: 1px solid rgba(white, 0.5);
  }

  select option{
    color: #555;
  }

  table{
    font-size: 13px;
    border-collapse: collapse;
    width: 100%;
  }

  thead{
    color: #fff;
    background: #32373c;
  }

  th{
    text-align: center;
    padding: 7px;
    border: 1px solid #444;
  }

  td{
    text-align: center;
    border: 1px solid #f4f4f4;
  }

  td.ui-datepicker-other-month{
    border: transparent;
  }

  td .ui-state-default{
    color: #555;
    width: auto;
    display: block;
    padding: 6px 12px;
  }

  td .ui-state-active,
  td .ui-state-hover{
    color: #fff;
    background-color: #0073aa;
  }

  td.ui-state-disabled .ui-state-default{
    opacity: 0.5;
  }
}


//
// Field: Tabbed
//
.csf-field-tabbed{

  .csf-tabbed-section{
    border: 1px solid #eee;
    background: #fff;
  }

  .csf-tabbed-nav{

    .fa{
      padding-right: 5px;
    }

    a{
      display: inline-block;
      padding: 12px 15px;
      margin-top: 1px;
      margin-right: 5px;
      margin-bottom: -1px;
      position: relative;
      text-decoration: none;
      color: #444;
      background-color: #f3f3f3;
      border: 1px solid #eee;
      @include transition(all .2s);

      &:hover{
        background-color: #f9f9f9;
      }

      &.csf-tabbed-active{
        background-color: #fff;
        border-bottom-color: #fff;
      }

      &:focus{
        @include box-shadow(none);
      }
    }
  }
}

//
// Common
//
.csf-image-inner{
  display: inline-block;
  position: relative;
  padding: 4px;
  min-width: 44px;
  min-height: 22px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  background-color: #f9f9f9;
  @include box-shadow(0 1px 0 rgba(black, 0.08));

  img{
    max-height: 90px;
    display: inline-block;
    vertical-align: middle;
  }
}

.csf-image-remove{
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  font-size: 11px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  color: #fff;
  background-color: #e14d43;
  @include opacity(0.8);
  @include transition(opacity .2s);

  &:hover{
    @include opacity(1);
  }
}
