@import '../../../styles/var.less';

.box {
  display: flex;
  background-color: var(--color-bg);
  width: 100%;
  height: 100%;
}

.layoutLeft {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  width: 220px;
  overflow: hidden;
  background-color: var(--color-bg-subtle);
  border-right: 1px solid var(--color-border-secondary);
  border-top: 0px;
  border-bottom: 0px;
}

.pageTitle {
  font-size: 20px;
  line-height: 24px;
  font-weight: 500;
  margin: 20px 0px 10px;
  padding-left: 20px;
}

.menuBox {
  flex: 1;
  overflow-y: auto;
  padding: 0px 8px;

  .menuItem {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    margin-bottom: 4px;
    height: 20px;
    border-radius: 8px;
    user-select: none;

    .menuItemsTitle {
      flex: 1;
      width: 0;
      display: flex;
      align-items: center;

      .name {
        .f-single-line();
      }

      .envTag {
        flex-shrink: 0;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: var(--color-primary);
        margin-right: 8px;
      }

      .databaseTypeIcon {
        margin-right: 6px;
      }
    }

    .moreButton {
      flex-shrink: 0;
      display: none;
      transform: rotate(90deg);
    }

    &:hover {
      background-color: var(--color-hover-bg);

      .moreButton {
        display: block;
      }
    }
  }

  .menuItemIcon {
    color: var(--color-primary) !important;
  }


  .menuItemActive {
    color: var(--color-primary);
    // background-color: var(--color-primary-bg);
    background-color: var(--color-hover-bg);
  }

  :global {
    .ant-menu-inline {
      border-inline-end: none !important;
    }

    .ant-menu-item {
      padding-left: 14px !important;
    }
  }
}

.addConnection {
  margin: 0 20px 10px;
}

.layoutRight {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.dataBaseList {
  // display: flex;
  // justify-content: space-between;
  // flex-wrap: wrap;
  // max-width: 800px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 1000px) {
  .dataBaseList {
    grid-template-columns: repeat(2, 1fr);
  }
}

.databaseItem {
  min-width: 220px;
  border-radius: 4px;
  height: 50px;
  margin: 10px 20px;
  padding: 0px 16px;
  border-radius: 8px;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid var(--color-border);

  .databaseItemMain {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    border-radius: 8px;
  }

  .databaseItemLeft {
    display: flex;
    align-items: center;
  }

  .databaseItemRight {
    display: none;

    i {
      font-size: 16px;
    }
  }

  &:hover {
    background-color: var(--color-bg-medium);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    cursor: pointer;

    .databaseItemRight {
      display: block;

      i {
        color: var(--color-primary);
      }
    }
  }

  .logoBox {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 28px;
    width: 28px;
    border-radius: 8px;
    margin-right: 16px;

    i {
      font-size: 16px;
    }
  }
}

.databaseItemSpacer {
  flex-grow: 1;
  width: 210px;
  margin: 0px 20px;
  padding: 0px 16px;
  box-sizing: border-box;
}

.createConnections {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background-color: var(--color-bg);
  overflow-y: auto;
  transform: scale(0.2);
  transition: 0.1s ease-in-out;
}

.showCreateConnections {
  z-index: 1;
  transform: scale(1);
  transition: transform 0.3s ease-in-out;
}

.envLabel {
  display: flex;
  justify-content: space-between;
  line-height: 30px;
  padding: 4px;
  font-size: 14px;
}

.envRefreshBox {
  &:hover {
    cursor: pointer;
    color: var(--color-primary);
  }
}
