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

@mixin nga-card-header() {
  padding: nga-theme(card-padding);
  border-bottom: 1px solid nga-theme(card-separator);
  border-top-left-radius: nga-theme(card-border-radius);
  border-top-right-radius: nga-theme(card-border-radius);
  color: nga-theme(card-header-fg-heading);

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

  @include nga-headings();
}

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

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

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

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

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

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

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

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