/**
 * @license
 * Copyright Akveo. All Rights Reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 */

@mixin nb-card-header() {
  padding: nb-theme(card-padding);
  border-bottom-width: nb-theme(card-header-border-width);
  border-bottom-style: nb-theme(card-header-border-type);
  border-bottom-color: nb-theme(card-header-border-color);
  border-top-left-radius: nb-theme(card-border-radius);
  border-top-right-radius: nb-theme(card-border-radius);
  color: nb-theme(card-header-fg-heading);

  font-family: nb-theme(card-header-font-family);
  font-size: nb-theme(card-header-font-size);
  font-weight: nb-theme(card-header-font-weight);

  @include nb-headings();
}

@mixin nb-card-theme() {
  nb-card {
    font-size: nb-theme(card-font-size);
    line-height: nb-theme(card-line-height);

    background: nb-theme(card-bg);
    color: nb-theme(card-fg-text);
    // TODO: move card margin style to layout
    margin-bottom: nb-theme(card-margin);
    border-radius: nb-theme(card-border-radius);
    box-shadow: nb-theme(card-shadow);
    font-weight: nb-theme(card-font-weight);
    border: nb-theme(card-border-width) nb-theme(card-border-type) nb-theme(card-border-color);

    @include nb-scrollbars(
        nb-theme(scrollbar-fg),
        nb-theme(scrollbar-bg),
        nb-theme(scrollbar-width));

    &.xxsmall-card {
      height: nb-theme(card-height-xxsmall);
    }
    &.xsmall-card {
      height: nb-theme(card-height-xsmall);
    }
    &.small-card {
      height: nb-theme(card-height-small);
    }
    &.medium-card {
      height: nb-theme(card-height-medium);
    }
    &.large-card {
      height: nb-theme(card-height-large);
    }
    &.xlarge-card {
      height: nb-theme(card-height-xlarge);
    }
    &.xxlarge-card {
      height: nb-theme(card-height-xxlarge);
    }

    &.active-card {
      nb-card-header {
        background-color: nb-theme(card-header-active-bg);
        border-bottom-color: nb-theme(card-header-active-bg);
        color: nb-theme(card-header-active-fg);
      }
    }
    &.disabled-card {
      nb-card-header {
        background-color: nb-theme(card-header-disabled-bg);
        border-bottom-color: nb-theme(card-header-disabled-bg);
      }
    }
    &.primary-card {
      nb-card-header {
        background-color: nb-theme(card-header-primary-bg);
        border-bottom-color: nb-theme(card-header-primary-bg);
      }
    }
    &.info-card {
      nb-card-header {
        background-color: nb-theme(card-header-info-bg);
        border-bottom-color: nb-theme(card-header-info-bg);
      }
    }
    &.success-card {
      nb-card-header {
        background-color: nb-theme(card-header-success-bg);
        border-bottom-color: nb-theme(card-header-success-bg);
      }
    }
    &.warning-card {
      nb-card-header {
        background-color: nb-theme(card-header-warning-bg);
        border-bottom-color: nb-theme(card-header-warning-bg);
      }
    }
    &.danger-card {
      nb-card-header {
        background-color: nb-theme(card-header-danger-bg);
        border-bottom-color: nb-theme(card-header-danger-bg);
      }
    }

    &.accent {
      border-top-style: solid;
      border-top-width: nb-theme(card-border-radius);

      & nb-card-header {
        border-radius: 0;
      }
    }

    &.accent-active {
      border-top-color: nb-theme(card-header-active-bg);
    }
    &.accent-disabled {
      border-top-color: nb-theme(card-header-disabled-bg);
    }
    &.accent-primary {
      border-top-color: nb-theme(card-header-primary-bg);
    }
    &.accent-success {
      border-top-color: nb-theme(card-header-success-bg);
    }
    &.accent-info {
      border-top-color: nb-theme(card-header-info-bg);
    }
    &.accent-warning {
      border-top-color: nb-theme(card-header-warning-bg);
    }
    &.accent-danger {
      border-top-color: nb-theme(card-header-danger-bg);
    }
  }

  nb-card-body {
    flex: 1;
    -ms-flex: 1 1 auto;
    overflow: auto;
    padding: nb-theme(card-padding);
    position: relative;
    @include nb-scrollbars(
        nb-theme(scrollbar-fg),
        nb-theme(scrollbar-bg),
        nb-theme(scrollbar-width));
  }

  nb-card-footer {
    padding: nb-theme(card-padding);
    border-top: 1px solid nb-theme(card-separator);
    border-bottom-left-radius: nb-theme(card-border-radius);
    border-bottom-right-radius: nb-theme(card-border-radius);
  }

  nb-card-header {
    @include nb-card-header();
  }
}

