.menubar {
  gap: 5px;
  margin: 1em 0;
  align-items: center;
  flex-wrap: wrap;
  padding: var(--nextui-space-6);
  box-shadow: var(--nextui-shadows-sm);
  border-radius: var(--nextui-radii-sm);
  width: fit-content;

  .divider {
    height: 1.5em;
    width: 2px;
    background: rgba($color: black, $alpha: 0.2);
    margin: 0 4px;
  }
}

.menubar,
.bubble-menu,
.table-controls-buttons-section {

  .menubar-button {
    align-items: center;
    justify-content: center;
    padding: 6px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    box-shadow: var(--nextui-shadows-sm);
    border-radius: 4px;
    transition: all 0.2s ease-in-out;

    &:active:focus {
      box-shadow: none;
    }

    &.disabled {
      opacity: 0.5;
      box-shadow: none;
    }

    &.active {
      background: var(--nextui-colors-primaryLight);

      svg {
        fill: var(--nextui-colors-primary);
      }
    }

    &.add-table-button {
      border-radius: unset;
      border-top-left-radius: 4px;
      border-bottom-left-radius: 4px;
    }

    &.table-controls-button {
      padding: 6px 0;
      border-radius: unset;
      border-top-right-radius: 4px;
      border-bottom-right-radius: 4px;
    }
  }
}

.dark-theme {
  .menubar {
    background: rgba(white, 0.1);
  }

  .menubar-button:not(.active) {
    box-shadow: 0 0 0 1px rgba(white, 0.25);
  }

  .menubar-button.active {
    box-shadow: 0 0 0 1px var(--nextui-colors-primary);
  }

  .divider {
    background: rgba($color: white, $alpha: 0.2);
  }

  .table-grid {
    .table-grid-row {
      .grid-box {
        border: 1px solid rgba(white, 0.25);
      }
    }
  }
}

.bubble-menu {
  background: var(--nextui-colors-background) !important;
  border-radius: 14px;
  box-shadow: var(--nextui-shadows-md);
  padding: 0.65em;
  margin: 0;

  &.hide {
    display: none;
  }
}

.search-and-replace-section {
  flex-direction: column;
  justify-content: center;
  width: fit-content;
  padding: 4px;
  gap: 8px;

  .inputs-section {
    justify-content: center;
    gap: 8px;
  }

  .buttons-section {
    justify-content: center;
    gap: 8px;
  }
}

.table-grid {
  display: flex;
  flex-direction: column;
  padding: 6px 4px;

  .table-grid-row {
    display: flex;
    flex-direction: row;

    article {
      height: 20px;
      width: 20px;

      .grid-box {
        height: 20px !important;
        width: 20px !important;
        outline: none;
        border: none;
        cursor: pointer;
        padding: 0;
        margin: 0;
        border: 1px solid rgba(49, 138, 255, 0.1);
        background: none;
        box-sizing: border-box;

        &.active {
          background: rgba(gray, 0.2);
        }
      }
    }

    &.first-row {
      article {
        .grid-box {
          &.active {
            background: rgba(60, 75, 93, 0.5);
          }
        }
      }
    }
  }
}

.table-controls-buttons-section {
  padding: 4px;
  gap: 5px;
}

.code-block-language-selector-section {
  padding: 0.65em;

  select {
    appearance: none;

    background-color: var(--nextui-colors-background);
    border: 2px solid var(--nextui-colors-primary);
    border-radius: var(--nextui-radii-sm);
    padding: 6px 0.75em;
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    cursor: inherit;
    line-height: inherit;
  }
}
