@use "../../abstracts/variables" as *;
@use "../../abstracts/mixins" as *;

.project-dropdowm-container {
  display: flex;
  align-items: center;
  gap: 2px;
  position: relative;
  height: 32px;
  .project-name {
    line-height: 32px;
    height: 100%;
  }
  .more-options-button {
    @include flex-center;
    border-radius: #{$border-radius-small};
    height: 28px;
    position: relative;
    &:hover {
      background: var(--highlight-accent-color);
      path {
        fill: var(--accent-color);
      }
    }
  }
  .more-options-button.active {
    background: var(--highlight-accent-color);
    path {
      fill: var(--accent-color);
    }
  }
}

.menu-bar {
  position: absolute;
  top: 32px;
  left: 0;
  z-index: 5;
  background-color: var(--background-color);
  color: var(--text-color);
  box-shadow: var(--box-shadow-light);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  .menu-buttons {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 4px;
    min-width: 178px;

    .menu-button-container {
      position: relative;
      height: 100%;
      padding: 4px 8px 4px 12px;
      border-radius: #{$border-radius-small};
      .menu-button {
        width: 100%;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative;

        .dropdown-icon {
          margin-left: 5px;
          font-size: var(--font-size-small);
          rotate: -90deg;
        }
      }

      .dropdown-menu {
        position: absolute;
        top: 0;
        left: 100%;
        background-color: var(--background-color);
        min-width: 220px;
        border-radius: 4px;
        box-shadow: var(--box-shadow-light);
        border: 1px solid var(--background-color);
        z-index: 100;
        padding: 4px;
        .menu-item-container {
          position: relative;
          .menu-item {
            padding: 4px 8px 4px 12px;
            border-radius: #{$border-radius-small};
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            white-space: nowrap;
            color: var(--text-color);
            .dropdown-icon {
              rotate: -90deg;
            }
            &:hover {
              background-color: var(--highlight-accent-color);
              span,
              .menu-item-right span {
                color: var(--accent-color);
              }
            }

            .menu-item-right {
              display: flex;
              align-items: center;
              gap: 15px;

              .shortcut {
                color: var(--text-color);
                font-size: var(--font-size-small);
              }

              .icon {
                font-size: var(--font-size-small);
                color: var(--text-color);
              }
            }
          }

          .submenu {
            position: absolute;
            left: 100%;
            top: 0;
            background-color: var(--background-color);
            min-width: 200px;
            border-radius: 0 4px 4px 4px;
            box-shadow: var(--box-shadow-light);
            border: 1px solid var(--background-color);
            z-index: 101;
            padding: 4px;
            .submenu-item {
              padding: 4px 8px 4px 12px;
              border-radius: #{$border-radius-small};
              display: flex;
              justify-content: space-between;
              align-items: center;
              cursor: pointer;
              white-space: nowrap;
              color: var(--text-color);
              &:hover {
                background-color: var(--highlight-accent-color);
                span {
                  color: var(--accent-color);
                }
              }
              .shortcut {
                color: var(--text-color);
              }
            }
          }
        }
      }

      &:hover {
        background-color: var(--highlight-accent-color);
        .menu-button {
          color: var(--accent-color);
        }
      }
    }
  }
  .split {
    width: 100%;
    height: 1px;
    background-color: var(--highlight-accent-color);
    margin: 2px 0;
  }
}
