/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@use 'sass:math';

$button-border-width: 1px;
$button-padding: ($pt-grid-size * 0.5) ($pt-grid-size * 1.3);
$button-padding-small: 0 ($pt-grid-size * 0.7);
$button-padding-large: ($pt-grid-size * 0.5) ($pt-grid-size * 1.5);
$button-icon-spacing: math.div($pt-button-height - $pt-icon-size-standard, 1.6);
$button-icon-spacing-large: math.div($pt-button-height-large - $pt-icon-size-large, 1.8);

/*
CSS `border` property issues:
- An element can only have one border.
- Borders can't stack with shadows.
- Borders modify the size of the element they're applied to.
- Border positioning requires the extra `box-sizing` property.

`box-shadow` doesn't have these issues, we're using it instead of `border`.
*/
$button-box-shadow: inset 0 0 0 $button-border-width rgba($black, 0.2),
  inset 0 (-$button-border-width) 0 rgba($black, 0.1);
$button-box-shadow-active: inset 0 0 0 $button-border-width rgba($black, 0.2),
  inset 0 1px 2px rgba($black, 0.2);
$button-intent-box-shadow: none;
$button-intent-box-shadow-active: none;

/*
Overlay shadows are used for default buttons
floating on top of other elements. This way, the
shadows blend with the colors beneath it.
Switches and slider handles both use these variables.
*/
$button-box-shadow-overlay: 0 0 0 $button-border-width rgba($black, 0.2),
  0 1px 1px rgba($black, 0.2);
$button-box-shadow-overlay-active: 0 0 0 $button-border-width rgba($black, 0.2),
  inset 0 1px 1px rgba($black, 0.1);

$dark-button-box-shadow: 0 0 0 $button-border-width rgba($black, 0.4);
$dark-button-box-shadow-active: 0 0 0 $button-border-width rgba($black, 0.6),
  inset 0 1px 2px rgba($black, 0.2);
$dark-button-intent-box-shadow: none;
$dark-button-intent-box-shadow-active: none;

$button-gradient: none;
$button-intent-gradient: none;
$dark-button-gradient: none;

$button-color-disabled: $pt-text-color-disabled;
$button-background-color: white;
$button-background-color-hover: $light-gray4;
$button-background-color-active: $light-gray2;
$button-background-color-disabled: rgba($light-gray1, 0.5);
$button-background-color-active-disabled: rgba($light-gray1, 0.7);
$button-intent-color-disabled: rgba($white, 0.6);
$dark-button-color-disabled: $pt-dark-text-color-disabled;
$dark-button-background-color: $dark-gray4;
$dark-button-background-color-hover: $dark-gray5;
$dark-button-background-color-active: $dark-gray2;
$dark-button-background-color-disabled: rgba($dark-gray5, 0.5);
$dark-button-background-color-active-disabled: rgba($dark-gray5, 0.7);
$dark-button-intent-color-disabled: rgba($white, 0.3);

$minimal-button-divider-width: 1px;
$minimal-button-background-color: none;
$minimal-button-background-color-hover: rgba($gray4, 0.3);
$minimal-button-background-color-active: rgba($gray2, 0.3);
$dark-minimal-button-background-color: none;
$dark-minimal-button-background-color-hover: rgba($gray3, 0.15);
$dark-minimal-button-background-color-active: rgba($gray3, 0.3);

$button-outlined-width: 1px;
$button-outlined-border-intent-opacity: 0.6;
$button-outlined-border-disabled-intent-opacity: 0.2;

// "intent": (default, hover, active colors)
$button-intents: (
  'primary': (
    $pt-intent-primary,
    $blue2,
    $blue1,
  ),
  'success': (
    $pt-intent-success,
    $green2,
    $green1,
  ),
  'warning': (
    $pt-intent-warning,
    $orange2,
    $orange1,
  ),
  'danger': (
    $pt-intent-danger,
    $red2,
    $red1,
  ),
);
