/*
 * Copyright 2020 IBM Corporation
 *
 * Licensed 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.
 */

@import 'carbon-components/scss/components/overflow-menu/_overflow-menu.scss';

$color: var(--color-text-01);
$bg-color: var(--color-base01);
$bg-open-color: var(--color-dropdown);
$button-hover-color: var(--color-table-border3);
$option-hover-color: var(--color-base02);

[kui-theme-style] {
  .sidecar-bottom-stripe-button .bx--overflow-menu.bx--overflow-menu--open svg,
  .sidecar-bottom-stripe-button:hover .bx--overflow-menu.bx--overflow-menu--open svg,
  .kui--toolbar-button-with-icon:hover .bx--overflow-menu.bx--overflow-menu--open svg {
    fill: var(--color-base01);
  }

  .bx--overflow-menu {
    &:hover {
      background-color: $button-hover-color;
    }
    &.bx--overflow-menu--open {
      background-color: $bg-open-color;
    }
  }
  .bx--overflow-menu--divider {
    border-top-color: var(--color-table-border3);
  }
  .bx--overflow-menu__icon {
    fill: currentColor;
  }
  .bx--tooltip__trigger:hover {
    .bx--overflow-menu--open svg {
      fill: $bg-color;
    }
    svg {
      fill: $color;
    }
  }
  .bx--overflow-menu-options {
    width: auto;
    background-color: $bg-color;

    &.bx--overflow-menu-options--open {
      background-color: $bg-open-color;
    }

    &:after {
      background-color: $bg-open-color;
    }
    &:active,
    &:focus {
      outline: none;
    }
  }
  .bx--overflow-menu-options__option {
    &:hover {
      background-color: $option-hover-color;
    }
  }
  .bx--overflow-menu--flip .bx--overflow-menu-options__btn {
    justify-content: flex-end;
  }
  .bx--overflow-menu-options__btn {
    max-width: unset;
    color: $color;

    svg {
      fill: currentColor;
    }
  }
}
