/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
@mixin host() {
  display: block;
}

@mixin core-styles() {
  .forge-button-toggle-group {
    @include base;

    ::slotted(:not(:last-child)) {
      --forge-button-toggle-border-right-width: 0;
      --forge-button-toggle-border-top-left-radius: 0;
      --forge-button-toggle-border-bottom-left-radius: 0;
      --forge-button-toggle-border-top-right-radius: 0;
      --forge-button-toggle-border-bottom-right-radius: 0;
    }

    ::slotted(:first-child) {
      --forge-button-toggle-border-top-left-radius: 4px;
      --forge-button-toggle-border-bottom-left-radius: 4px;
    }

    ::slotted(:last-child) {
      --forge-button-toggle-border-top-left-radius: 0;
      --forge-button-toggle-border-bottom-left-radius: 0;
      --forge-button-toggle-border-top-right-radius: 4px;
      --forge-button-toggle-border-bottom-right-radius: 4px;
    }

    &--vertical {
      @include vertical;

      ::slotted(:not(:last-child)) {
        --forge-button-toggle-border-right-width: 1px;
        --forge-button-toggle-border-bottom-width: 0;
        --forge-button-toggle-border-top-left-radius: 0;
        --forge-button-toggle-border-bottom-left-radius: 0;
        --forge-button-toggle-border-top-right-radius: 0;
        --forge-button-toggle-border-bottom-right-radius: 0;
      }

      ::slotted(:first-child) {
        --forge-button-toggle-border-top-left-radius: 4px;
        --forge-button-toggle-border-top-right-radius: 4px;
      }
  
      ::slotted(:last-child) {
        --forge-button-toggle-border-top-left-radius: 0;
        --forge-button-toggle-border-top-right-radius: 0;
        --forge-button-toggle-border-bottom-left-radius: 4px;
        --forge-button-toggle-border-bottom-right-radius: 4px;
      }
    }

    // Keep this below the vertical class
    ::slotted(:only-child) {
      --forge-button-toggle-border-top-left-radius: 4px;
      --forge-button-toggle-border-bottom-left-radius: 4px;
      --forge-button-toggle-border-top-right-radius: 4px;
      --forge-button-toggle-border-bottom-right-radius: 4px;
    }

    &--stretch {
      width: 100%;
    }
  }
}

@mixin base() {
  display: flex;
}

@mixin vertical() {
  flex-direction: column;
}
