//
// Copyright IBM Corp. 2022, 2022
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

// Standard imports.
@import '../../global/styles/project-settings';

// Other Carbon settings.
// TODO: @import 'carbon-components/scss/globals/grid/grid'; if needed

// EditUpdateCards uses the following Carbon components:
// TODO: @import(s) of Carbon component styles used by EditUpdateCards

// EditUpdateCards uses the following Carbon for IBM Products components:
// TODO: @import(s) of IBM Products component styles used by EditUpdateCards

// Define all component styles in a mixin which is then exported using
// the Carbon import-once mechanism.
@mixin edit-update-cards {
  $block-class: #{$pkg-prefix}--edit-update-cards;

  .#{$block-class} {
    &##{$block-class}--edit {
      /* Used id for overriding the SVG path fill */

      .#{$pkg-prefix}--card__header,
      .#{$pkg-prefix}--card__footer {
        button {
          &:hover {
            background-color: $hover-primary;
          }

          &:focus {
            box-shadow: none;
          }

          svg {
            path {
              // stylelint-disable-next-line carbon/theme-token-use
              fill: $white-0;
            }
          }

          &.#{$pkg-prefix}--loading {
            &:hover {
              background-color: transparent;
            }
          }
        }
      }
      .#{$pkg-prefix}--card__footer {
        // stylelint-disable-next-line carbon/theme-token-use
        background-color: $blue-60;
        // stylelint-disable-next-line carbon/theme-token-use
        color: $white-0;
      }
      .#{$pkg-prefix}--loading {
        animation-duration: $duration--slow-02;
        animation-fill-mode: forwards;
        animation-iteration-count: infinite;
        animation-name: rotate;
        animation-timing-function: $carbon--standard-easing;

        &:hover {
          background-color: transparent;
        }
      }
    }
    &:not(.#{$block-class}__actions-bottom) {
      &##{$block-class}--edit {
        .#{$pkg-prefix}--card__header {
          // stylelint-disable-next-line carbon/theme-token-use
          background-color: $blue-60;
          // stylelint-disable-next-line carbon/theme-token-use
          color: $white-0;
        }
      }
    }
  }
}

@include exports('edit-update-cards') {
  @include edit-update-cards;
}
