//
// Buttons
// --------------------------------------------------

// Common styles
.btn-default,
.btn-primary,
.btn-success,
.btn-info,
.btn-warning,
.btn-danger {
  // text-shadow: 0 -1px 0 rgba(0,0,0,.2);
  // @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.075);
  // .box-shadow(@shadow);

  // Reset the shadow
  &:active,
  &.active {
    .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));
  }

  &.disabled,
  &[disabled],
  fieldset[disabled] & {
    .box-shadow(none);
  }

  .badge {
    text-shadow: none;
  }
}

// Mixin for generating new styles
.btn-styles(@btn-color: #555) {
  background-color: @btn-color;
  border-color: @btn-color;

  &:hover,
  &:focus  {
    background-color: darken(@btn-color, 12%);
  }

  &:active,
  &.active {
    background-color: darken(@btn-color, 12%);
    border-color: darken(@btn-color, 14%);
  }

  &.disabled,
  &[disabled],
  fieldset[disabled] & {
    &,
    &:hover,
    &:focus,
    &.focus,
    &:active,
    &.active {
      background-color: darken(@btn-color, 12%);
      background-image: none;
    }
  }
}

// Common styles
.btn {
  // Remove the gradient for the pressed/active state
  &:active,
  &.active {
    background-image: none;
  }
}

// Apply the mixin to the buttons
.btn-default { .btn-styles(@btn-default-bg); border-color: #ccc; }
.btn-primary { .btn-styles(@btn-primary-bg); }
.btn-success { .btn-styles(@btn-success-bg); }
.btn-info    { .btn-styles(@btn-info-bg); }
.btn-warning { .btn-styles(@btn-warning-bg); }
.btn-danger  { .btn-styles(@btn-danger-bg); }



//
// Progress bars
// --------------------------------------------------

// Give the progress background some depth
.progress {
  #gradient > .vertical(@start-color: darken(@progress-bg, 4%); @end-color: @progress-bg)
}

// Mixin for generating new styles
.progress-bar-styles(@color) {
  #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 10%));
}

// Apply the mixin to the progress bars
.progress-bar            { .progress-bar-styles(@progress-bar-bg); }
.progress-bar-success    { .progress-bar-styles(@progress-bar-success-bg); }
.progress-bar-info       { .progress-bar-styles(@progress-bar-info-bg); }
.progress-bar-warning    { .progress-bar-styles(@progress-bar-warning-bg); }
.progress-bar-danger     { .progress-bar-styles(@progress-bar-danger-bg); }

// Reset the striped class because our mixins don't do multiple gradients and
// the above custom styles override the new `.progress-bar-striped` in v3.2.0.
.progress-bar-striped {
  #gradient > .striped();
}


//
// List groups
// --------------------------------------------------

.list-group {
  border-radius: @border-radius-base;
  .box-shadow(0 1px 2px rgba(0,0,0,.075));
}
.list-group-item.active,
.list-group-item.active:hover,
.list-group-item.active:focus {
  text-shadow: 0 -1px 0 darken(@list-group-active-bg, 10%);
  #gradient > .vertical(@start-color: @list-group-active-bg; @end-color: darken(@list-group-active-bg, 7.5%));
  border-color: darken(@list-group-active-border, 7.5%);

  .badge {
    text-shadow: none;
  }
}


//
// Panels
// --------------------------------------------------

// Common styles
.panel {
  .box-shadow(0 1px 2px rgba(0,0,0,.05));
}

// Mixin for generating new styles
.panel-heading-styles(@color) {
  #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 5%));
}

// Apply the mixin to the panel headings only
.panel-default > .panel-heading   { .panel-heading-styles(@panel-default-heading-bg); }
.panel-primary > .panel-heading   { .panel-heading-styles(@panel-primary-heading-bg); }
.panel-success > .panel-heading   { .panel-heading-styles(@panel-success-heading-bg); }
.panel-info > .panel-heading      { .panel-heading-styles(@panel-info-heading-bg); }
.panel-warning > .panel-heading   { .panel-heading-styles(@panel-warning-heading-bg); }
.panel-danger > .panel-heading    { .panel-heading-styles(@panel-danger-heading-bg); }


//
// Wells
// --------------------------------------------------

.well {
  #gradient > .vertical(@start-color: darken(@well-bg, 5%); @end-color: @well-bg);
  border-color: darken(@well-bg, 10%);
  @shadow: inset 0 1px 3px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.1);
  .box-shadow(@shadow);
}

// IA-UTILS
//---------------------------

.text-overflow {
  .text-overflow();
}

.text-break-word {
  word-wrap: break-word;
}

// bottom margin if neccecary
.gap {
  margin-bottom: 10px;
}
.js-iad + .js-iad {
  margin-top: 10px;
}

// 
.js-actions {
  margin-top: 5px;
}

// 
.required {
  color: #f2395b;
}

// 
.template-tags {
  padding: 10px;
}

// Style chooser in admin panel
#sap_style {
  display: none;
}

.sap-style-color {
  cursor: pointer;
  position: relative;

  &.active { cursor: default; }
  &.active:hover {
    outline: 0 none;
  }
  &.active:after {
    content: '\e045';
    font-family: 'Subrion';
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    color: @base-dark-color;
    width: 14px;
    height: 14px;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -7px;
    margin-left: -7px;
  }

  &:hover {
    outline: 5px solid #eee;
  }
}

.sap-style-transition *:not(.tooltip, .cke) {
  .transition(all .6s ease);
}



// EDIT AREA STYLES
//---------------------------

#editor {
  border: 1px solid #ccc;
}

.area_toolbar {
  padding: 10px;
  background-color: #f5f5f5;
  text-align: left;
}

#EditAreaArroundInfos_codeContainer {

  > div {
    padding: 10px 0 0;
    margin-bottom: 0;
  }
  
  input {
    cursor: pointer;
    margin-right: 4px;
  }

  label {
    cursor: pointer;
  }
}


// CKEDITOR FIXES
//---------------------------

.cke_maximized {
  z-index: 10001 !important;
}


// PACKAGES INSTALLATION and stuff
//---------------------------

#package_form {
  .url_type {
    margin-bottom: 10px;
  }

  .url_type label {
    display: block;
    background: #f5f5f5;
    padding: 7px;
    border: 1px solid #f5f5f5;
    cursor: pointer;
    font-weight: bold;

    &.selected {
      border: 1px solid @brand-primary;
      background: fadeout(@brand-primary, 90%);
      color: @brand-primary;
    }
  }

  .url_type_info {
    padding: 10px;
    color: #777;
    font-size: 12px;
  }
}


// SPARKLINE TOOLTIP STYLES
//---------------------------

.jqstooltip,
.jqsfield {
  .box-sizing(content-box);
}

.jqstooltip {
  border-radius: 3px;
  border: 0 none !important;
}


// NOTIFICATION BOX 
// intelli.js - notifFloatBox
//---------------------------

.notifFloatBox {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 15000;
  display: none;
  max-width: 300px;
  padding: 20px;
  background: #00b6de;
  color: #fff;
  border-radius: 4px;

  &--info {
    background: #00b6de;
  }

  &--success {
    background: #95ba12;
  }

  &--error {
    background: #f9644e;
  }

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


// DATETIMEPICKER toggler
// http://www.malot.fr/bootstrap-datetimepicker/
//---------------------------

.js-datepicker-toggle {
  cursor: pointer;
}


// TREEVIEW FOR CATEGORIES
//---------------------------

.categories-toggle {
  display: inline-block;
  font-size: 12px;
  color: @link-color;
  cursor: pointer;
  border-bottom: 1px dashed @link-color;
  text-decoration: none;
  
  &:hover {
    text-decoration: none;
  }
}

.categories-tree {
  .box-simple();
  margin-top: 15px;
  margin-bottom: 0;
  padding: 6px;
}

.tree-filter {
  margin-top: 15px;
  margin-bottom: -16px;
}


// RESOLVE ISSUES
//---------------------------

.b-resolve {
  position: relative;

  &__wrapper {
    position: relative;
    overflow: hidden;

    a {

      &.disabled,
      &.disabled:hover {
        border: 2px solid @brand-info;
        background: @brand-info;
        color: #fff;
      }
    }
  }

  &__btn {
    position: relative;
    color: @link-color;

    i {
      display: inline-block;
      width: 12px;
      height: 12px;
    }

    &--progress {
      display: none;
      color: #999;

      i {
        -webkit-animation: spin 0.7s infinite linear;
        -moz-animation: spin 0.7s infinite linear;
        -ms-animation: spin 0.7s infinite linear;
        -o-animation: spin 0.7s infinite linear;
        animation: spin 0.7s infinite linear;
      }
    }

    &--result {
      display: none;
      color: @brand-info;
    }
  }
}


//
// Animations
// Using Animate.css https://github.com/daneden/animate.css
// --------------------------------------------------

.animated {
  -webkit-animation-duration: 1s;
  animation-duration: 1s;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
}

@-webkit-keyframes bounceInDown {
  0%, 60%, 75%, 90%, 100% {
    -webkit-transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
  }

  0% {
    opacity: 0;
    -webkit-transform: translate3d(0, -3000px, 0);
    transform: translate3d(0, -3000px, 0);
  }

  60% {
    opacity: 1;
    -webkit-transform: translate3d(0, 25px, 0);
    transform: translate3d(0, 25px, 0);
  }

  75% {
    -webkit-transform: translate3d(0, -10px, 0);
    transform: translate3d(0, -10px, 0);
  }

  90% {
    -webkit-transform: translate3d(0, 5px, 0);
    transform: translate3d(0, 5px, 0);
  }

  100% {
    -webkit-transform: none;
    transform: none;
  }
}

@keyframes bounceInDown {
  0%, 60%, 75%, 90%, 100% {
    -webkit-transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
  }

  0% {
    opacity: 0;
    -webkit-transform: translate3d(0, -3000px, 0);
    -ms-transform: translate3d(0, -3000px, 0);
    transform: translate3d(0, -3000px, 0);
  }

  60% {
    opacity: 1;
    -webkit-transform: translate3d(0, 25px, 0);
    -ms-transform: translate3d(0, 25px, 0);
    transform: translate3d(0, 25px, 0);
  }

  75% {
    -webkit-transform: translate3d(0, -10px, 0);
    -ms-transform: translate3d(0, -10px, 0);
    transform: translate3d(0, -10px, 0);
  }

  90% {
    -webkit-transform: translate3d(0, 5px, 0);
    -ms-transform: translate3d(0, 5px, 0);
    transform: translate3d(0, 5px, 0);
  }

  100% {
    -webkit-transform: none;
    -ms-transform: none;
    transform: none;
  }
}

.bounceInDown {
  -webkit-animation-name: bounceInDown;
  animation-name: bounceInDown;
}

@-webkit-keyframes bounceIn {
  0%, 20%, 40%, 60%, 80%, 100% {
    -webkit-transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
            transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
  }

  0% {
    opacity: 0;
    -webkit-transform: scale3d(.3, .3, .3);
            transform: scale3d(.3, .3, .3);
  }

  20% {
    -webkit-transform: scale3d(1.1, 1.1, 1.1);
            transform: scale3d(1.1, 1.1, 1.1);
  }

  40% {
    -webkit-transform: scale3d(.9, .9, .9);
            transform: scale3d(.9, .9, .9);
  }

  60% {
    opacity: 1;
    -webkit-transform: scale3d(1.63, 1.63, 1.63);
            transform: scale3d(1.63, 1.63, 1.63);
  }

  80% {
    -webkit-transform: scale3d(.97, .97, .97);
            transform: scale3d(.97, .97, .97);
  }

  100% {
    opacity: 1;
    -webkit-transform: scale3d(1, 1, 1);
            transform: scale3d(1, 1, 1);
  }
}

@keyframes bounceIn {
  0%, 20%, 40%, 60%, 80%, 100% {
    -webkit-transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
            transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
  }

  0% {
    opacity: 0;
    -webkit-transform: scale3d(.3, .3, .3);
            transform: scale3d(.3, .3, .3);
  }

  20% {
    -webkit-transform: scale3d(1.1, 1.1, 1.1);
            transform: scale3d(1.1, 1.1, 1.1);
  }

  40% {
    -webkit-transform: scale3d(.9, .9, .9);
            transform: scale3d(.9, .9, .9);
  }

  60% {
    opacity: 1;
    -webkit-transform: scale3d(1.63, 1.63, 1.63);
            transform: scale3d(1.63, 1.63, 1.63);
  }

  80% {
    -webkit-transform: scale3d(.97, .97, .97);
            transform: scale3d(.97, .97, .97);
  }

  100% {
    opacity: 1;
    -webkit-transform: scale3d(1, 1, 1);
            transform: scale3d(1, 1, 1);
  }
}

.bounceIn {
  -webkit-animation-name: bounceIn;
          animation-name: bounceIn;
  -webkit-animation-duration: .75s;
          animation-duration: .75s;
}