/**
 * Copyright 2014 Vecna Technologies, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you
 * may not use this file except in compliance with the License.  You may
 * obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied.  See the License for the specific language governing
 * permissions and limitations under the License.
 */

@mixin alert-colors($color) {
  border: 1px solid lighten(desaturate($color, 40%), 50%);
  background: lighten(desaturate($color, 40%), 71%);
  color: $color;

  > a {
    color: $color;
  }

  > .close {
    color: $color;

    &:hover {
      color: #333;
    }
  }
}

.alert {
  @extend %all;
  @extend %columns;
  margin: 1em 0;
  padding: 1em $gutter-width/2;
  text-shadow: 0 1px rgba(255, 255, 255, 0.5);
  @include alert-colors($alert-default-color);
  border-radius: 2px;

  .close {
    @extend .icon-remove;
    display: block;
    float: right;
    padding-top: 4px;
    font-size: ms(1);
    text-decoration: none;
    cursor: pointer;
  }
}

.alert.success {
  @include alert-colors($alert-success-color);
}

.alert.warning {
  @include alert-colors($alert-warning-color);
}

.alert.error {
  @include alert-colors($alert-error-color);
}

.alert-scroll {
  position: fixed;
  bottom: 0;
  left: $gutter-width;
  right: 376px;
  width: auto;
  margin: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  z-index: 1;

  .focus-help & {
    visibility: hidden;
  }

  // Medium screen (Tablets and small monitors)
  @media only screen and (min-width : $small-max-width + 1) and (max-width : $medium-screen) {
    right: $gutter-width + 2px;
  }

  @media only screen and (max-width : $small-max-width) {
    visibility: hidden;
  }
}
