/*
 * Common SCSS File - SCSS v1.0
 * last edited 02/17/12
 * @author Justin Stollsteimer - Fusionbox, Inc.
 * http://www.fusionbox.com
 *
 *
 * Lists: Line
 * HR: Line
 * Table: Line
 * Form Elements: Line
 *
 */


/* SASS Mixins
--------------------------------------------------*/


@mixin default {
  display: inline;
  float: left;
  height: auto;
  width: 100%;
}

@mixin shadow($color: rgba(0,0,0,0.3), $left: 0px, $top: 0px, $blur: 8px) {
  box-shadow: $left $top $blur $color;
    -o-box-shadow: $left $top $blur $color;
    -ms-box-shadow: $left $top $blur $color;
    -moz-box-shadow: $left $top $blur $color;
    -webkit-box-shadow: $left $top $blur $color;
}

@mixin inset-shadow($color: rgba(0,0,0,0.3), $left: 0px, $top: 0px, $blur: 8px) {
  box-shadow: inset $left $top $blur $color;
    -o-box-shadow: inset $left $top $blur $color;
    -ms-box-shadow: inset $left $top $blur $color;
    -moz-box-shadow: inset $left $top $blur $color;
    -webkit-box-shadow: inset $left $top $blur $color;
}


@mixin text-shadow($color: rgba(0,0,0,0.3), $left: 0px, $top: 0px, $blur: 8px) {
  text-shadow: $left $top $blur $color;
    -o-text-shadow: $left $top $blur $color;
    -moz-text-shadow: $left $top $blur $color;
    -webkit-text-shadow: $left $top $blur $color;
}

@mixin rounded($radius) {
  border-radius: $radius;
    -o-border-radius: $radius;
    -ms-border-radius: $radius;
    -moz-border-radius: $radius;
    -webkit-border-radius: $radius;
}

@mixin gradient($bottom,$top) {
  background-color: $bottom;
    background-image: -o-linear-gradient(center bottom, $bottom 1%, $top 100%);
    background-image: -ms-linear-gradient(center bottom, $bottom 1%, $top 100%);
    background-image: -moz-linear-gradient(center bottom, $bottom 1%, $top 100%);
    background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.01, $bottom), color-stop(1.00, $top));
}

@mixin important-gradient($bottom,$top) {
  background-color: $bottom !important;
    background-image: -o-linear-gradient(center bottom, $bottom 1%, $top 100%) !important;
    background-image: -ms-linear-gradient(center bottom, $bottom 1%, $top 100%) !important;
    background-image: -moz-linear-gradient(center bottom, $bottom 1%, $top 100%) !important;
    background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.01, $bottom), color-stop(1.00, $top)) !important;
}

@mixin transition($basic: all 0.25s ease 0s) {
  transition: $basic;
    -o-transition: $basic;
    -ms-transition: $basic;
    -moz-transition: $basic;
    -webkit-transition: $basic;
}


@mixin inner {
  display: block;
  margin: 0 auto;
  padding: 0px;
  text-align: left;
  width: 960px;
}

@mixin clearfix {
  &:after {
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
  }
  * html & { height: 1px }
}

@mixin wrapper {
  display: block;
  height: auto;
  min-width: 960px;
  position: relative;
  width: 100%;
  z-index: 1;
}

@mixin html {
  h1, h2, h3, h4, h5, h6, p, blockquote, ol, ul, hgroup, hr {
    display: block !important;
    float: none !important;
    margin: 0px 0px 15px 0px !important;
    width: auto !important;
  }
  .fl { float: left; margin: 0px 25px 15px 0px; }
  .fr { float: right; margin: 0px 0px 15px 25px; }
  img { @include rounded(2px); &.left { float: left; margin: 5px 20px 15px 0px; } &.right { float: right; margin: 5px 0px 15px 20px; }}
  table { display: table; width: 100% !important; }
}

@mixin box-sizing($box-sizing) {
  box-sizing: $box-sizing;
  -moz-box-sizing: $box-sizing;
}

@mixin button {
  @include rounded(3px);
  background: $blue;
  border: 0px;
  color: white;
  cursor: pointer;
  display: inline-block;
  height: auto;
  font-weight: bold;
  font-size: 11px;
  line-height: 12px;
  text-decoration: none;
  text-transform: capitalize;
  padding: 2px 4px;
  width: auto;

  &:hover {
    background: lighten($blue,10%);
    color: white;
  }

  &.cancel {
    background: $grey;
    color: white;

    &:hover {
      background: lighten($grey,10%);
    }
  }

  &.delete {
    background: $red;
    color: white;

    &:hover {
      background: lighten($red,10%);
    }
  }

  &.loading {
    @extend %loading;
  }

  &[type='submit'] {
    @include rounded(3px);
    background: $green;
    color: white;
    height: auto;
    line-height: 15px;
    font-weight: bold;
    padding: 0px 4px 1px !important;

    &:hover {
      background: lighten($green,10%);
    }
  }
}

/* Variables
-----------------------------------------------*/

$black10: rgba(0,0,0,0.1);
$black30: rgba(0,0,0,0.3);
$black50: rgba(0,0,0,0.5);
$white20: rgba(255,255,255,0.2);
$reallylightgrey: #fafafa;
$lightgrey:   #bbbbbb;
$grey:        #999999;
$darkgrey:    #666666;
$red:         #BF3030;
$blue:        #309BBF;
$green:       #559911;
$purple:      #A56ED3;
$orange:      #FF9900;

$inputFields: "input[type='text'], input[type='password'], input[type='email'], input[type='search'], input[type='number'], textarea";


$widget_icon_sprite: sprite-map("widgy/image/widget-*");

@mixin node-icon-sprite ($class, $icon, $sprite: $widget_icon_sprite) {
  &.#{$class} > span.title:before {
    background-image: sprite-url($sprite, $icon);
    background-position: sprite-position($sprite, $icon);
  }
}

@mixin node-icon ($class, $img) {
  &.#{$class} > span.title:before {
    background-image: url($img);
  }
}

%loading {
  background: inline-image('widgy/image/loading.gif') center no-repeat !important;
  color: transparent !important;
}

%horizontalChildren {
  & > .widget > .drag-row {
    span.title {
      display: none;
    }
  }

  & > .widget > .nodeChildren {
    display: table;
    width: 100%;

    & > li {
      display: table-cell;
      width: auto;

      & > .widget > .drag-row {
        span.title,
        .delete span {
          display: none;
        }
      }

      &.node_drop_target {
        width: 50px;
      }
    }
  }
}

@mixin cursor($cursor, $fallback: '') {
  @if $fallback != '' {  cursor: $fallback; }
  cursor: $cursor;
  cursor: -moz-#{$cursor};
  cursor: -webkit-#{$cursor};
}

@mixin outside-button {
  // This button style is for buttons that exist outside of the widgy editor.
  @include rounded(3px);
  background: transparent;
  border: 1px solid $blue;
  color: $blue;
  display: inline-block;
  height: auto;
  font-weight: bold;
  font-size: 12px;
  line-height: 18px;
  padding: 4px 8px;
  width: auto;

  &:hover {
    background-color: lighten($blue,35%);
    color: $blue;
  }

  &.cancel {
    border-color: $grey;
    color: $grey;

    &:hover {
      background: lighten($lightgrey,15%);
    }
  }

  &.delete {
    border-color: $red;
    color: $red;

    &:hover {
      background: lighten($red,35%);
    }
  }

  &.loading {
    @extend %loading;
  }

  &[type='submit'] {
    @include rounded(3px);
    border-color: $green;
    color: $green;
    height: auto;
    font-weight: bold;
    line-height: 16px;
    padding: 5px !important;
    position: relative;
    top: -1px;

    &:hover {
      background: lighten($green,50%);
    }
  }
}
