/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
@use '@material/theme/theme' as mdc-theme;
@use '@material/ripple/ripple' as mdc-ripple;
@use '@material/ripple/ripple-theme' as mdc-ripple-theme;
@use '../theme';

@mixin core-styles() {
  .forge-expansion-panel {
    @include base;
  
    &__header {
      @include header;

      &:hover {
        @include header-hover;
      }
      
      forge-open-icon {
        @include header-icon;
      }
    }
  
    &__content {
      @include content;
    }
  }
}

@mixin base() {
  @include theme.css-custom-property(display, --forge-expansion-panel-display, block);
  @include theme.css-custom-property(height, --forge-expansion-panel-height, auto);
}

@mixin header() {
  outline: none;
}

@mixin header-hover() {
  cursor: pointer;
}

@mixin header-icon() {
  margin-left: auto;
}

@mixin content() {
  @include theme.css-custom-property(overflow, --forge-expansion-panel-content-overflow, hidden);
  @include theme.css-custom-property(max-height, --forge-expansion-panel-content-max-height, none);
  @include theme.scrollbar;
}

@mixin slotted-button() {
  @include mdc-ripple.surface();
  @include mdc-ripple.radius-bounded();
  @include mdc-ripple-theme.states(text-hint-on-background, false);
  @include mdc-theme.property(color, text-primary-on-background);

  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  border: none;
  outline: none;
  line-height: inherit;
  user-select: none;
  -webkit-appearance: none;
  overflow: hidden;
  vertical-align: middle;
  font-size: 1rem;
  background: inherit;
  cursor: pointer;
  padding: 16px;
}

@mixin slotted-content {
  @include theme.property(border-top-color, border-color);

  border-top-width: 1px;
  border-top-style: solid;
  padding: 16px;
}
