/**
 * @license
 * Copyright Akveo. All Rights Reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 */

@use '../../styles/theming' as *;

@mixin nb-menu-theme() {
  nb-menu {
    background-color: nb-theme(menu-background-color);

    ul.menu-items {
      margin: 0;
      padding: 0;
    }

    .menu-group,
    .menu-item a {
      font-family: nb-theme(menu-text-font-family);
      font-size: nb-theme(menu-text-font-size);
      font-weight: nb-theme(menu-text-font-weight);
      line-height: nb-theme(menu-text-line-height);
      padding: nb-theme(menu-item-padding);
    }

    .menu-group,
    .menu-group nb-icon.menu-icon {
      color: nb-theme(menu-group-text-color);
    }

    .menu-item {
      a {
        color: nb-theme(menu-text-color);
        border-radius: nb-theme(menu-item-border-radius);
      }

      a.active {
        background-color: nb-theme(menu-item-active-background-color);
        color: nb-theme(menu-item-active-text-color);

        .menu-icon {
          color: nb-theme(menu-item-icon-active-color);
        }
      }

      a:hover {
        background-color: nb-theme(menu-item-hover-background-color);
        color: nb-theme(menu-item-hover-text-color);
        cursor: nb-theme(menu-item-hover-cursor);

        .menu-icon {
          color: nb-theme(menu-item-icon-hover-color);
        }
      }

      .menu-icon {
        color: nb-theme(menu-item-icon-color);
        font-size: nb-theme(menu-item-icon-width);
        margin: nb-theme(menu-item-icon-margin);
        width: 1em;
        text-align: center;
      }

      .expand-state {
        color: nb-theme(menu-item-icon-color);
      }
    }

    $divider: nb-theme(menu-item-divider-width) nb-theme(menu-item-divider-style) nb-theme(menu-item-divider-color);
    .menu-item {
      border-bottom: $divider;

      &:first-child {
        border-top: none;
      }
      &:last-child {
        border-bottom: none;
      }

      .menu-item:first-child {
        border-top: $divider;
      }
    }

    .menu-item > .menu-items {
      background-color: nb-theme(menu-submenu-background-color);
      margin: nb-theme(menu-submenu-margin);
      padding: nb-theme(menu-submenu-padding);
    }

    .menu-item > .menu-items > .menu-item {
      background: nb-theme(menu-submenu-background-color);
      color: nb-theme(menu-submenu-text-color);

      a {
        border-color: nb-theme(menu-submenu-item-border-color);
        border-style: nb-theme(menu-submenu-item-border-style);
        border-width: nb-theme(menu-submenu-item-border-width);
        padding: nb-theme(menu-submenu-item-padding);
      }

      a.active {
        background-color: nb-theme(menu-submenu-item-active-background-color);
        border-color: nb-theme(menu-submenu-item-active-border-color);
        color: nb-theme(menu-submenu-item-active-text-color);

        .menu-icon {
          color: nb-theme(menu-submenu-item-icon-active-color);
        }
      }

      a:hover {
        background-color: nb-theme(menu-submenu-item-hover-background-color);
        border-color: nb-theme(menu-submenu-item-hover-border-color);
        color: nb-theme(menu-submenu-item-hover-text-color);

        .menu-icon {
          color: nb-theme(menu-submenu-item-icon-hover-color);
        }
      }

      a.active:hover {
        background-color: nb-theme(menu-submenu-item-active-hover-background-color);
        border-color: nb-theme(menu-submenu-item-active-hover-border-color);
        color: nb-theme(menu-submenu-item-active-hover-text-color);

        .menu-icon {
          color: nb-theme(menu-submenu-item-icon-active-hover-color);
        }
      }
    }

    .menu-item > .menu-items > .menu-group {
      &,
      & nb-icon.menu-icon {
        color: nb-theme(menu-group-text-color);
      }
    }
  }
}
