// Copyright 2018-Present Okta, 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.

.toast--pen {
  position: fixed;
  z-index: 1;
  right: $big-spacing;
  bottom: $big-spacing;
}

.toast {
  display: flex;
  position: relative;
  align-items: flex-start;
  max-width: calc((#{$max-line-length} / 2) + #{$base-spacing});
  margin-bottom: $base-spacing;
  padding: $small-spacing ($small-spacing + ms(-1) + $small-spacing) $small-spacing $small-spacing;
  border: 0;
  border-radius: $base-border-radius;
  background: $white;
  box-shadow: 0 3px 6px rgba(cv('gray', '900'), 0.2);

  &:last-child {
    margin-bottom: 0;
  }
}

.toast--icon {
  flex-grow: 0;
  flex-shrink: 0;
  width: $base-spacing;
  height: $base-spacing;
  margin: 0 $small-spacing 0 0;

  .icon--fill {
    fill: cv('success', 'base');
  }

  .icon--stroke {
    stroke: $white;
    fill: $white;
  }
}

.toast--title {
  margin-bottom: $small-spacing;
  color: $text-heading;
  font-size: ms(1);
  font-weight: 600;
}

.toast--close {
  position: absolute;
  top: $small-spacing;
  right: $small-spacing;
  width: ms(-1);
  height: ms(-1);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: $white;
  font-size: ms(0);
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: default;
  appearance: none;
}

.toast--close-icon {
  .icon--stroke {
    stroke: $text-sub;
  }
}
