/*
 * 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 './common';
@import 'carbon-components/scss/components/ui-shell/_side-nav.scss';

[kui-theme-style] {
  .bx--side-nav {
    z-index: unset;
    position: unset;
    font-family: var(--font-sans-serif);
    background-color: var(--color-sidecar-header);

    .bx--side-nav__items {
      a.bx--side-nav__link:focus,
      .bx--side-nav a.bx--header__menu-item:focus {
        outline-color: var(--color-brand-03);
      }

      .bx--side-nav__menu {
        a.bx--side-nav__link {
          &:not(.bx--side-nav__link--current) {
            .bx--side-nav__link-text {
              color: var(--color-text-02);
            }
          }
        }
      }
      .bx--side-nav__link {
        &,
        &:hover {
          .bx--side-nav__link-text {
            color: var(--color-text-01);
          }
        }
      }

      .bx--side-nav__icon > svg {
        fill: var(--color-text-02);
      }

      .bx--side-nav__menu[role='menu'] a.bx--side-nav__link--current,
      .bx--side-nav__menu[role='menu'] a.bx--side-nav__link[aria-current='page'],
      a.bx--side-nav__link--current {
        background-color: var(--color-sidecar-background-01);
      }

      .bx--side-nav__item--active .bx--side-nav__submenu[aria-expanded='false'] {
        background-color: var(--color-sidecar-background-02);
      }

      .bx--side-nav__item:not(.bx--side-nav__item--active) > .bx--side-nav__link:hover,
      .bx--side-nav__menu[role='menu']
        a.bx--side-nav__link[role='menuitem']:not(.bx--side-nav__link--current):not([aria-current='page']):hover,
      .bx--side-nav__item--active .bx--side-nav__submenu:hover {
        background-color: var(--color-sidecar-background-01);
        color: var(--color-text-01);
      }

      .bx--side-nav__item:not(.bx--side-nav__item--active):hover
        .bx--side-nav__item:not(.bx--side-nav__item--active)
        > .bx--side-nav__submenu:hover,
      .bx--side-nav__item:not(.bx--side-nav__item--active) > .bx--side-nav__link:hover,
      .bx--side-nav__menu a.bx--side-nav__link:not(.bx--side-nav__link--current):not([aria-current='page']):hover,
      .bx--side-nav a.bx--header__menu-item:hover,
      .bx--side-nav .bx--header__menu-title[aria-expanded='true']:hover {
        background-color: var(--color-sidecar-background-01);
        color: var(--color-text-01);
      }
    }

    &:not(.bx--side-nav--fixed):hover,
    &.bx--side-nav--expanded {
      width: 30%;
      max-width: unset;
    }

    &.bx--side-nav--expanded ~ .bx--content {
      flex: 6;
      margin: unset;
      padding: 0;
      overflow: auto;
      display: flex;
    }

    .bx--side-nav__item--active .bx--side-nav__submenu {
      &.entity-name .bx--side-nav__submenu-title {
        color: var(--color-brand-03);
      }
      .bx--side-nav__submenu-title {
        color: var(--color-text-01);
      }
    }

    a.bx--side-nav__link[aria-current='page']::before,
    a.bx--side-nav__link--current::before {
      background-color: var(--color-brand-03);
    }
  }
}
