@use "sass:math";
@use "sass:map";

@function divide($a, $b) {
  @return math.div($a, $b);
}

// THEME COLORS.
// ========================================================
// If you don't need themes, you can leave this as is and override the global defaults.
$theme-light: (
  base-bg-color: #fff,
  base-color: #000,
  contrast-bg-color: #000,
  contrast-color: #fff,
  caption-color: #a0a0a0,
  disabled-color: #ccc
) !default;

$theme-dark: (
  base-bg-color: #222,
  base-color: #fff,
  contrast-bg-color: #fff,
  contrast-color: #000,
  caption-color: #6e6e6e,
  disabled-color: #4a4a4a
) !default;

// These variables are filled up with the current theme colors for you to use.
$primary: var(--w-primary-color);
$secondary: var(--w-secondary-color);
$base-bg-color: var(--w-base-bg-color);
$base-color: var(--w-base-color);
$contrast-bg-color: var(--w-contrast-bg-color);
$contrast-color: var(--w-contrast-color);
$caption-color: var(--w-caption-color);
// When a form element is disabled (checkbox, radio, input, select list).
$disabled-color: var(--w-disabled-color);

// GLOBAL DEFAULTS.
// ========================================================
$css-scope: '.w-app' !default; // Allows control on CSS rules priority.
// True by default. False allows you to use an external CSS library (like Tailwind).
$use-layout-classes: true !default;

$base-font-size: 14px !default; // Must be a px unit.
$base-increment: math.round(divide($base-font-size, 4)) !default;
$layout-padding: $base-increment * 4 !default; // Applied on the .content-wrap tag.
$border-radius: 4px !default;
$border-color: color-mix(in srgb, var(--w-contrast-bg-color) 12%, transparent) !default;
$border: 1px solid $border-color !default;
$transition-duration: 0.25s !default;
$fast-transition-duration: 0.15s !default;
$box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2),
             0 2px 2px 0 rgba(0, 0, 0, 0.15),
             0 1px 5px 0 rgba(0, 0, 0, 0.15) !default;
$form-field-height: math.round(2 * $base-font-size) !default;
// Always an even number for better vertical alignment. (Used in checkbox, radio, switch)
$small-form-el-size: math.round(divide(1.3 * $base-font-size, 2)) * 2 !default;

// Detachable elements are: w-tooltip, w-menu, w-confirm.
$detachable-bg-color: $base-bg-color !default;
$detachable-color: $base-color !default;

// COMPONENTS DEFAULTS.
// ========================================================
// w-confirm.
// --------------------------------------------------------
$confirm-bg-color: $detachable-bg-color !default;
$confirm-color: $detachable-color !default;
// --------------------------------------------------------

// w-dialog.
// --------------------------------------------------------
$dialog-bg-color: $base-bg-color !default;
// --------------------------------------------------------

// w-divider.
// --------------------------------------------------------
$divider-color: $border-color !default;
// --------------------------------------------------------

// w-drawer.
// --------------------------------------------------------
$drawer-max-size: 380px !default;
$drawer-bg-color: $base-bg-color !default;
// --------------------------------------------------------

// w-menu.
// --------------------------------------------------------
$menu-bg-color: $detachable-bg-color !default;
$menu-color: $detachable-color !default;
// --------------------------------------------------------

// w-progress.
// --------------------------------------------------------
$progress-bg-color: color-mix(in srgb, var(--w-contrast-bg-color) 15%, transparent) !default;
// --------------------------------------------------------

// w-rating.
// --------------------------------------------------------
$rating-bg-color: color-mix(in srgb, var(--w-contrast-bg-color) 25%, transparent) !default;
// --------------------------------------------------------

// w-slider.
// --------------------------------------------------------
$slider-height: $base-increment !default;
$slider-track-color: color-mix(in srgb, var(--w-contrast-bg-color) 15%, transparent) !default;
$slider-thumb-button-bg-color: $base-bg-color !default;
$slider-thumb-label-bg-color: $base-bg-color !default;
$slider-thumb-label-color: color-mix(in srgb, var(--w-base-color) 75%, transparent) !default;
$slider-step-label-bg-color: color-mix(in srgb, var(--w-contrast-bg-color) 20%, transparent) !default;
$slider-step-label-color: color-mix(in srgb, var(--w-base-color) 50%, transparent) !default;

// w-switch.
// --------------------------------------------------------
$switch-inactive-color: color-mix(in srgb, var(--w-contrast-bg-color) 25%, transparent) !default;
$switch-thumb-color: $base-bg-color !default;
// --------------------------------------------------------

// w-table.
// --------------------------------------------------------
$table-tr-odd-color: color-mix(in srgb, var(--w-contrast-bg-color) 2%, transparent) !default;
$table-tr-hover-color: color-mix(in srgb, var(--w-contrast-bg-color) 5%, transparent) !default;
$table-color: color-mix(in srgb, var(--w-contrast-color) 70%, transparent) !default;
// --------------------------------------------------------

// w-textarea.
// --------------------------------------------------------
$textarea-line-height: 1.2 !default;
// --------------------------------------------------------

// w-timeline.
// --------------------------------------------------------
$timeline-bullet-color: $base-bg-color !default;
$timeline-bg-color: color-mix(in srgb, var(--w-contrast-bg-color) 25%, transparent) !default;
// --------------------------------------------------------

// w-toolbar.
// --------------------------------------------------------
$toolbar-max-size: 380px !default;
$toolbar-bg-color: $base-bg-color !default;
// --------------------------------------------------------

// w-tooltip.
// --------------------------------------------------------
$tooltip-bg-color: $detachable-bg-color !default;
$tooltip-color: $detachable-color !default;
$tooltip-border-color: $border-color !default;
// --------------------------------------------------------

// w-scrollable.
// --------------------------------------------------------
$scrollbar-size: 8px !default;
$scrollbar-bg-color: color-mix(in srgb, var(--w-contrast-bg-color) 8%, var(--w-base-bg-color)) !default;
$scrollbar-thumb-color: color-mix(in srgb, var(--w-contrast-bg-color) 25%, var(--w-base-bg-color)) !default;
// --------------------------------------------------------
