@import "compass/css3";

@mixin button($tcolor: #FFF, $bcolor: #DDD, $font: $text) {
  @include border-radius(3px);
  @include background(linear-gradient(top, $tcolor, $bcolor));
  background-color: $bcolor;
  border: $bcolor 1px solid;
  padding: 8px 20px;
  display: inline-block;
  line-height: 1.2em;
  color: $font;
  cursor: pointer;
  min-width: 0;
  max-width: 300px;
  text-decoration: none;

  &:hover {
    background: lighten($bcolor, 2%);
    border-color: darken($bcolor, 5%);
  }

  &.active {
    background: darken($bcolor, 2%);
    border-color: darken($bcolor, 5%);
  }

  i {
    font-size: 1.2em;
    margin: 0;
    padding: 0;
    line-height: .5em;
  }

  &.big, &.medium {
    i {
      display: block;
      font-size: 50px;
      margin: 0 auto;
      padding: 10px;
    }
  }

  &.medium {
    i {
      font-size: 34px;
    }
  }

  &.disabled, &:disabled {
    background: #EEE;
    border: #CCC 1px solid;
    color: #CCC;
    cursor: default;
  }

  &.print {
    padding: 10px;

    i {
      font-size: 1.5em;
    }
  }

  &.app {
    padding: 20px 10px;
    width: 150px;
    min-height: 90px;
    vertical-align: top;
    line-height: 1.3em;
    margin: 10px;
    text-align: center;
  }

  &.arrow {
    box-sizing: border-box;
  	position: relative;
		padding: 9px 5px;
		margin-left: -10px;
		background: darken($success, 10%);
		color: white;
		border-color: #BBB;
    height: 68px;

    span {
      display: block;
      line-height: 1em;
    }

		i {
      line-height: 1em;
			font-size: 2em;
		}

		.arrow-button {
			width: 0;
			height: 0;
			top: 0;
			right: -17px;
			border-bottom: 34px solid transparent;
			border-top: 33px solid transparent;
			border-left: 18px solid darken($success, 10%);
			position: absolute;
		}

		.arrow-border-button {
			width: 0;
			height: 0;
			top: 0;
			right: -18px;
			border-bottom: 34px solid transparent;
			border-top: 33px solid transparent;
			border-left: 18px solid #BBB;
			position: absolute;
		}

		&.disabled {
			background: #EEE;
			border: #CCC 1px solid;
			color: #CCC;
			cursor: default;

			.arrow-button {
				border-left: 18px solid #eee;
			}

			.arrow-border-button {
				border-left: 18px solid #ccc;
			}
		}
  }
}

.button, button, input[type="submit"], input[type="button"], input[type="submit"], a.button {
  @include button;

  &.task {
    @include button(lighten($text,20%), lighten($text, 20%), white);

    padding: 5px 6px;
    min-width: 221px;
    font-size: 0.9em;

    &:visited {
      color: white;
    }

    i {
      font-size: 1em;
      margin: 0px 2px;
    }
  }

  &.confirm {
    @include button($success, darken($success, 8%), white);
    max-width: 250px;
    min-width: 0;
    margin-right: 10px;
  }

  &.cancel {
    @include button($error, darken($error, 8%), white);
    max-width: 250px;
    min-width: 0;
    margin-right: 10px;
  }

  &.proceed {
    @include button($error, darken($error, 8%), white);
    max-width: 250px;
    min-width: 0;
    margin-right: 10px;
  }

  &.no-color {
    @include button();
  }
}